-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Page Content Focus: Add welcome guides (#52014)
* Page Content Focus: Add welcome guides * Don't show when editor guide is active * Just use regular accent/theme color in all guides * slight copy change page guide * Update components changelog * Disable new guides in E2E tests * Use s.w.org videos --------- Co-authored-by: Saxon Fletcher <[email protected]>
- Loading branch information
1 parent
5023dd5
commit c93857b
Showing
14 changed files
with
220 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useDispatch, useSelect } from '@wordpress/data'; | ||
import { Guide } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { store as preferencesStore } from '@wordpress/preferences'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { store as editSiteStore } from '../../store'; | ||
|
||
export default function WelcomeGuidePage() { | ||
const { toggle } = useDispatch( preferencesStore ); | ||
|
||
const isVisible = useSelect( ( select ) => { | ||
const isPageActive = !! select( preferencesStore ).get( | ||
'core/edit-site', | ||
'welcomeGuidePage' | ||
); | ||
const isEditorActive = !! select( preferencesStore ).get( | ||
'core/edit-site', | ||
'welcomeGuide' | ||
); | ||
const { hasPageContentFocus } = select( editSiteStore ); | ||
return isPageActive && ! isEditorActive && hasPageContentFocus(); | ||
}, [] ); | ||
|
||
if ( ! isVisible ) { | ||
return null; | ||
} | ||
|
||
const heading = __( 'Editing your page' ); | ||
|
||
return ( | ||
<Guide | ||
className="edit-site-welcome-guide guide-page" | ||
contentLabel={ heading } | ||
finishButtonText={ __( 'Continue' ) } | ||
onFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) } | ||
pages={ [ | ||
{ | ||
image: ( | ||
<video | ||
className="edit-site-welcome-guide__video" | ||
autoPlay | ||
loop | ||
muted | ||
width="312" | ||
height="240" | ||
> | ||
<source | ||
src="https://s.w.org/images/block-editor/editing-your-page.mp4" | ||
type="video/mp4" | ||
/> | ||
</video> | ||
), | ||
content: ( | ||
<> | ||
<h1 className="edit-site-welcome-guide__heading"> | ||
{ heading } | ||
</h1> | ||
<p className="edit-site-welcome-guide__text"> | ||
{ __( | ||
'We’ve recently introduced the ability to edit pages within the site editor. You can switch to editing your template using the settings sidebar.' | ||
) } | ||
</p> | ||
</> | ||
), | ||
}, | ||
] } | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.