Closed ockham closed 7 years ago
Brief analysis:
I've thought about this and tinkered with it some more.
The issues we were running into with #9792 and #9823 weren't just due to implementation details, but due to a more fundamental complexity: ThemesSelection
isn't the only options
consumer inside ThemeShowcase
-- ThemePreview
is, too. With the current component arch, we might have to duplicate the preview. The cleaner solution would be something like #9832, plus moving some logic to determine the default and secondary option inside theme-options
, but hopefully we'll just get away with duplicating the preview.
First and foremost however, we cannot even experiment with duplicating ThemesSelection
for our Jetpack view before #8785, since due to the old Redux arch, queries will collide, and bad things will happen, rendering the Jetpack view unusable (I've tried this on a local branch).
Bottom line: I'll try to finish #8785 ASAP. We should revisit this only afterwards. I'll link an experimental branch.
Closing for now. Will revisit re-organizing our currently anarchic component hierarchy after the JetPress rally.
ThemesSearchCard
fromThemesSelection
toThemeShowcase
ThemeShowcase
shouldn't addThemeSelection
as a child automatically anymore. Instead,logged-out.jsx
,multi-site.jsx
,single-site-wpcom.jsx
, andsingle-site-jetpack.jsx
should do so (as they're already doing with other components).connectOptions
on the top-level components in those four files, we should then just wrap the respectively importedThemeSelection
components there (or, in the case ofmulti-site.jsx
, wrapThemeSelection
inThemeSiteSelectorModal
first).This will
ThemesSelection
tosingle-site-jetpack.jsx
(for our JetPress milestone).