-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Preview: Show the current theme name on the theme activation modal #57588
Live Preview: Show the current theme name on the theme activation modal #57588
Conversation
22e7337
to
142d29d
Compare
} ); | ||
|
||
apiFetch( { path } ).then( ( activeThemes ) => | ||
setCurrentTheme( activeThemes[ 0 ] ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to handle a request error here? Wondering if it's safe to access activeThemes[ 0 ]
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🎉
themeName | ||
/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */ | ||
__( | ||
'Saving your changes will change your active theme from %1$s to %2$s' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're missing the last period (.
) here; it was there before this PR.
What?
Display the name of the currently active theme on the theme activation modal
Why?
Resolved Automattic/wp-calypso#81878
How?
Use the
apiFetch
withwp_theme_preview=
to bypass thecreateThemePreviewMiddleware
and get the currently active theme.Another way is to create a new resolver, selector, and reducer to get the raw current theme and save it into the redux store. But I think it's only used by this modal now so we don't need to introduce new variable into the redux store.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast