-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/assets/src/components/svg/icon-laptop-search.js b/assets/src/components/svg/icon-laptop-search.js
new file mode 100644
index 00000000000..2dd0d4307fa
--- /dev/null
+++ b/assets/src/components/svg/icon-laptop-search.js
@@ -0,0 +1,41 @@
+/**
+ * External dependencies
+ */
+import PropTypes from 'prop-types';
+
+/**
+ * WordPress dependencies
+ */
+import { useInstanceId } from '@wordpress/compose';
+
+const INTRINSIC_ICON_WIDTH = 42;
+const INTRINSIC_ICON_HEIGHT = 29;
+const INTRINSIC_STROKE_WIDTH = 2;
+
+export function IconLaptopSearch( { width = INTRINSIC_ICON_WIDTH, ...props } ) {
+ const clipPathId = `clip-icon-laptop-search-${ useInstanceId( IconLaptopSearch ) }`;
+ const strokeWidth = INTRINSIC_STROKE_WIDTH * ( INTRINSIC_ICON_WIDTH / width );
+
+ return (
+
+ );
+}
+IconLaptopSearch.propTypes = {
+ width: PropTypes.number,
+};
diff --git a/assets/src/components/svg/icon-laptop-toggles.js b/assets/src/components/svg/icon-laptop-toggles.js
new file mode 100644
index 00000000000..bc06a62d5a4
--- /dev/null
+++ b/assets/src/components/svg/icon-laptop-toggles.js
@@ -0,0 +1,26 @@
+/**
+ * WordPress dependencies
+ */
+import { useInstanceId } from '@wordpress/compose';
+
+export function IconLaptopToggles( props ) {
+ const clipPathId = `clip-icon-laptop-toggles-${ useInstanceId( IconLaptopToggles ) }`;
+
+ return (
+
+ );
+}
diff --git a/assets/src/components/user-context-provider/index.js b/assets/src/components/user-context-provider/index.js
index 5e6ccaa6495..2d7c78c96a9 100644
--- a/assets/src/components/user-context-provider/index.js
+++ b/assets/src/components/user-context-provider/index.js
@@ -20,19 +20,28 @@ export const User = createContext();
/**
* Context provider user data.
*
- * @param {Object} props Component props.
- * @param {?any} props.children Component children.
- * @param {boolean} props.onlyFetchIfPluginIsConfigured Flag indicating whether the users data should be fetched only if the plugin is fully configured (i.e. the Onboarding Wizard has been completed).
- * @param {string} props.userOptionDeveloperTools The key of the option to use from the settings endpoint.
- * @param {string} props.usersResourceRestPath The REST path for interacting with the `users` resources.
+ * @param {Object} props Component props.
+ * @param {?any} props.children Component children.
+ * @param {boolean} props.onlyFetchIfPluginIsConfigured Flag indicating whether the users data should be fetched only if the plugin is fully configured (i.e. the Onboarding Wizard has been completed).
+ * @param {string} props.userFieldReviewPanelDismissedForTemplateMode The key of the option to use from the settings endpoint.
+ * @param {string} props.userOptionDeveloperTools The key of the option to use from the settings endpoint.
+ * @param {string} props.usersResourceRestPath The REST path for interacting with the `users` resources.
*/
-export function UserContextProvider( { children, onlyFetchIfPluginIsConfigured = true, userOptionDeveloperTools, usersResourceRestPath } ) {
+export function UserContextProvider( {
+ children,
+ onlyFetchIfPluginIsConfigured = true,
+ userFieldReviewPanelDismissedForTemplateMode,
+ userOptionDeveloperTools,
+ usersResourceRestPath,
+} ) {
const { originalOptions, fetchingOptions } = useContext( Options );
const { plugin_configured: pluginConfigured } = originalOptions;
const [ fetchingUser, setFetchingUser ] = useState( false );
const [ developerToolsOption, setDeveloperToolsOption ] = useState( null );
+ const [ reviewPanelDismissedForTemplateMode, setReviewPanelDismissedForTemplateMode ] = useState( null );
const [ originalDeveloperToolsOption, setOriginalDeveloperToolsOption ] = useState( null );
const [ savingDeveloperToolsOption, setSavingDeveloperToolsOption ] = useState( false );
+ const [ savingReviewPanelDismissedForTemplateMode, setSavingReviewPanelDismissedForTemplateMode ] = useState( false );
const [ didSaveDeveloperToolsOption, setDidSaveDeveloperToolsOption ] = useState( false );
const { setAsyncError } = useAsyncError();
@@ -82,6 +91,10 @@ export function UserContextProvider( { children, onlyFetchIfPluginIsConfigured =
setOriginalDeveloperToolsOption( fetchedUser[ userOptionDeveloperTools ] );
setDeveloperToolsOption( fetchedUser[ userOptionDeveloperTools ] );
+
+ if ( userFieldReviewPanelDismissedForTemplateMode ) {
+ setReviewPanelDismissedForTemplateMode( fetchedUser[ userFieldReviewPanelDismissedForTemplateMode ] );
+ }
} catch ( e ) {
setAsyncError( e );
return;
@@ -89,10 +102,10 @@ export function UserContextProvider( { children, onlyFetchIfPluginIsConfigured =
setFetchingUser( false );
} )();
- }, [ onlyFetchIfPluginIsConfigured, fetchingOptions, fetchingUser, originalDeveloperToolsOption, pluginConfigured, setAsyncError, userOptionDeveloperTools, usersResourceRestPath ] );
+ }, [ onlyFetchIfPluginIsConfigured, fetchingOptions, fetchingUser, originalDeveloperToolsOption, pluginConfigured, setAsyncError, userFieldReviewPanelDismissedForTemplateMode, userOptionDeveloperTools, usersResourceRestPath ] );
/**
- * Sends the option back to the REST endpoint to be saved.
+ * Sends the dev tools option back to the REST endpoint to be saved.
*/
const saveDeveloperToolsOption = useCallback( async () => {
if ( ! hasDeveloperToolsOptionChange ) {
@@ -125,6 +138,39 @@ export function UserContextProvider( { children, onlyFetchIfPluginIsConfigured =
setSavingDeveloperToolsOption( false );
}, [ hasDeveloperToolsOptionChange, developerToolsOption, setAsyncError, userOptionDeveloperTools, usersResourceRestPath ] );
+ /**
+ * Sends the template mode for which the "Review" panel is dismissed back to
+ * the REST endpoint to be saved.
+ */
+ const saveReviewPanelDismissedForTemplateMode = useCallback( async ( templateMode ) => {
+ if ( savingReviewPanelDismissedForTemplateMode || ! userFieldReviewPanelDismissedForTemplateMode ) {
+ return;
+ }
+
+ // Update the local state immediately.
+ setReviewPanelDismissedForTemplateMode( templateMode );
+ setSavingReviewPanelDismissedForTemplateMode( true );
+
+ try {
+ await apiFetch( {
+ method: 'post',
+ path: `${ usersResourceRestPath }/me`,
+ data: {
+ [ userFieldReviewPanelDismissedForTemplateMode ]: templateMode,
+ },
+ } );
+
+ if ( true === hasUnmounted.current ) {
+ return;
+ }
+ } catch ( e ) {
+ setAsyncError( e );
+ return;
+ }
+
+ setSavingReviewPanelDismissedForTemplateMode( false );
+ }, [ savingReviewPanelDismissedForTemplateMode, setAsyncError, userFieldReviewPanelDismissedForTemplateMode, usersResourceRestPath ] );
+
return (
@@ -148,6 +197,7 @@ export function UserContextProvider( { children, onlyFetchIfPluginIsConfigured =
UserContextProvider.propTypes = {
children: PropTypes.any,
onlyFetchIfPluginIsConfigured: PropTypes.bool,
+ userFieldReviewPanelDismissedForTemplateMode: PropTypes.string,
userOptionDeveloperTools: PropTypes.string.isRequired,
usersResourceRestPath: PropTypes.string.isRequired,
};
diff --git a/assets/src/css/elements.css b/assets/src/css/elements.css
index 7b331556050..332f6e989c2 100644
--- a/assets/src/css/elements.css
+++ b/assets/src/css/elements.css
@@ -28,7 +28,7 @@
}
.amp p {
- font-size: 16px;
+ font-size: var(--amp-settings-font-size);
}
.amp,
diff --git a/assets/src/css/variables.css b/assets/src/css/variables.css
index 622c7f64818..3c906a1e4dd 100644
--- a/assets/src/css/variables.css
+++ b/assets/src/css/variables.css
@@ -5,7 +5,9 @@
*/
:root {
--amp-settings-color-black: #212121;
+ --amp-settings-color-dark-gray: #333;
--amp-settings-color-brand: #2459e7;
+ --amp-settings-color-muted: #48525c;
--gray: #6c7781;
--amp-settings-color-border: #e8e8e8;
--very-light-gray: #fafafc;
@@ -16,4 +18,5 @@
--color-valid: #46b450;
--amp-settings-color-danger: #dc3232;
--color-gray-medium: rgba(0, 0, 0, 0.54);
+ --amp-settings-font-size: 16px;
}
diff --git a/assets/src/onboarding-wizard/__mocks__/amp-settings.js b/assets/src/onboarding-wizard/__mocks__/amp-settings.js
index cbdd1e3857b..b291caa4804 100644
--- a/assets/src/onboarding-wizard/__mocks__/amp-settings.js
+++ b/assets/src/onboarding-wizard/__mocks__/amp-settings.js
@@ -4,7 +4,7 @@ module.exports = {
CURRENT_THEME: {
name: 'Twenty Twenty',
},
- FINISH_LINK: 'http://site.test/wp-admin/?page=amp-options',
+ SETTINGS_LINK: 'http://site.test/wp-admin/?page=amp-options',
OPTIONS_REST_PATH: 'http://site.test/wp-json/amp/v1/options',
READER_THEMES_REST_PATH: 'http://site.test/wp-json/amp/v1/reader-themes',
UPDATES_NONCE: '',
diff --git a/assets/src/onboarding-wizard/components/navigation-context-provider.js b/assets/src/onboarding-wizard/components/navigation-context-provider.js
index 8bad19582d1..51ba502f9f1 100644
--- a/assets/src/onboarding-wizard/components/navigation-context-provider.js
+++ b/assets/src/onboarding-wizard/components/navigation-context-provider.js
@@ -23,7 +23,7 @@ export const Navigation = createContext();
* @param {Array} props.pages Pages in the app.
*/
export function NavigationContextProvider( { children, pages } ) {
- const [ activePageIndex, setActivePageIndex ] = useState( 0 );
+ const [ currentPage, setCurrentPage ] = useState( pages[ 0 ] );
const [ canGoForward, setCanGoForward ] = useState( true ); // Allow immediately moving forward on first page. @todo This may need to change in 2.1.
const { editedOptions } = useContext( Options );
@@ -37,7 +37,7 @@ export function NavigationContextProvider( { children, pages } ) {
return pages.filter( ( page ) => 'theme-selection' !== page.slug );
}, [ pages, themeSupport ] );
- const currentPage = adaptedPages[ activePageIndex ];
+ const activePageIndex = adaptedPages.findIndex( ( adaptedPage ) => adaptedPage.slug === currentPage.slug );
const isLastPage = activePageIndex === adaptedPages.length - 1;
@@ -45,7 +45,7 @@ export function NavigationContextProvider( { children, pages } ) {
* Navigates back to the previous page.
*/
const moveBack = () => {
- setActivePageIndex( activePageIndex - 1 );
+ setCurrentPage( adaptedPages[ activePageIndex - 1 ] );
setCanGoForward( true );
};
@@ -57,7 +57,7 @@ export function NavigationContextProvider( { children, pages } ) {
return;
}
- setActivePageIndex( activePageIndex + 1 );
+ setCurrentPage( adaptedPages[ activePageIndex + 1 ] );
setCanGoForward( false ); // Each page is responsible for setting this to true.
};
@@ -72,7 +72,6 @@ export function NavigationContextProvider( { children, pages } ) {
moveBack,
moveForward,
pages: adaptedPages,
- setActivePageIndex,
setCanGoForward,
}
}
diff --git a/assets/src/onboarding-wizard/components/template-mode-override-context-provider.js b/assets/src/onboarding-wizard/components/template-mode-override-context-provider.js
index c20d3c8fa7e..d0909656741 100644
--- a/assets/src/onboarding-wizard/components/template-mode-override-context-provider.js
+++ b/assets/src/onboarding-wizard/components/template-mode-override-context-provider.js
@@ -14,6 +14,7 @@ import { createContext, useState, useEffect, useContext } from '@wordpress/eleme
import { Options } from '../../components/options-context-provider';
import { ReaderThemes } from '../../components/reader-themes-context-provider';
import { User } from '../../components/user-context-provider';
+import { READER } from '../../common/constants';
import { Navigation } from './navigation-context-provider';
export const TemplateModeOverride = createContext();
@@ -26,13 +27,14 @@ export const TemplateModeOverride = createContext();
*/
export function TemplateModeOverrideContextProvider( { children } ) {
const { editedOptions, originalOptions, updateOptions, readerModeWasOverridden, setReaderModeWasOverridden } = useContext( Options );
- const { activePageIndex, currentPage: { slug: currentPageSlug }, setActivePageIndex } = useContext( Navigation );
+ const { currentPage } = useContext( Navigation );
const { selectedTheme, currentTheme } = useContext( ReaderThemes );
const { developerToolsOption, fetchingUser, originalDeveloperToolsOption } = useContext( User );
const [ respondedToDeveloperToolsOptionChange, setRespondedToDeveloperToolsOptionChange ] = useState( false );
const [ mostRecentlySelectedThemeSupport, setMostRecentlySelectedThemeSupport ] = useState( null );
const [ technicalQuestionChangedAtLeastOnce, setTechnicalQuestionChangedAtLeastOnce ] = useState( false );
+ const { slug: currentPageSlug } = currentPage || {};
const { theme_support: themeSupport } = editedOptions || {};
const { theme_support: originalThemeSupport } = originalOptions || {};
@@ -60,17 +62,15 @@ export function TemplateModeOverrideContextProvider( { children } ) {
* Override with transitional if the user has selected reader mode and their currently active theme is the same as the selected reader theme.
*/
useEffect( () => {
- if ( 'summary' === currentPageSlug && 'reader' === themeSupport && selectedTheme.name === currentTheme.name ) {
+ if ( 'done' === currentPageSlug && READER === themeSupport && selectedTheme.name === currentTheme.name ) {
if ( ! readerModeWasOverridden ) {
updateOptions( { theme_support: 'transitional' } );
setReaderModeWasOverridden( true );
- setActivePageIndex( activePageIndex - 1 );
} else {
setReaderModeWasOverridden( false );
}
}
}, [
- activePageIndex,
selectedTheme.name,
currentTheme.name,
themeSupport,
@@ -78,7 +78,6 @@ export function TemplateModeOverrideContextProvider( { children } ) {
readerModeWasOverridden,
updateOptions,
setReaderModeWasOverridden,
- setActivePageIndex,
] );
/**
@@ -119,7 +118,7 @@ export function TemplateModeOverrideContextProvider( { children } ) {
] );
return (
-
+
{ children }
);
diff --git a/assets/src/onboarding-wizard/index.js b/assets/src/onboarding-wizard/index.js
index ea7db292c5e..4571a468e65 100644
--- a/assets/src/onboarding-wizard/index.js
+++ b/assets/src/onboarding-wizard/index.js
@@ -12,7 +12,7 @@ import {
APP_ROOT_ID,
CLOSE_LINK,
CURRENT_THEME,
- FINISH_LINK,
+ SETTINGS_LINK,
OPTIONS_REST_PATH,
READER_THEMES_REST_PATH,
UPDATES_NONCE,
@@ -57,7 +57,7 @@ export function Providers( { children } ) {
{
render(
-
+ ,
root,
);
diff --git a/assets/src/onboarding-wizard/pages/done/index.js b/assets/src/onboarding-wizard/pages/done/index.js
new file mode 100644
index 00000000000..525f4a6f0ab
--- /dev/null
+++ b/assets/src/onboarding-wizard/pages/done/index.js
@@ -0,0 +1,191 @@
+/**
+ * WordPress dependencies
+ */
+import { __, sprintf } from '@wordpress/i18n';
+import { useContext, useEffect } from '@wordpress/element';
+
+/**
+ * External dependencies
+ */
+import { SETTINGS_LINK } from 'amp-settings'; // From WP inline script.
+
+/**
+ * Internal dependencies
+ */
+import './style.scss';
+import {
+ AMPNotice,
+ NOTICE_SIZE_LARGE,
+ NOTICE_TYPE_SUCCESS,
+ NOTICE_TYPE_INFO,
+} from '../../../components/amp-notice';
+import { Navigation } from '../../components/navigation-context-provider';
+import { Options } from '../../../components/options-context-provider';
+import { ReaderThemes } from '../../../components/reader-themes-context-provider';
+import { User } from '../../../components/user-context-provider';
+import { IconLaptopToggles } from '../../../components/svg/icon-laptop-toggles';
+import { IconLaptopSearch } from '../../../components/svg/icon-laptop-search';
+import { AMPSettingToggle } from '../../../components/amp-setting-toggle';
+import { NavMenu } from '../../../components/nav-menu';
+import { READER, STANDARD, TRANSITIONAL } from '../../../common/constants';
+import { Preview } from './preview';
+import { Saving } from './saving';
+import { usePreview } from './use-preview';
+
+/**
+ * Final screen, where data is saved.
+ */
+export function Done() {
+ const {
+ didSaveOptions,
+ editedOptions: { theme_support: themeSupport, reader_theme: readerTheme },
+ hasOptionsChanges,
+ readerModeWasOverridden,
+ saveOptions,
+ savingOptions,
+ } = useContext( Options );
+ const { didSaveDeveloperToolsOption, saveDeveloperToolsOption, savingDeveloperToolsOption } = useContext( User );
+ const { canGoForward, setCanGoForward } = useContext( Navigation );
+ const { downloadedTheme, downloadingTheme, downloadingThemeError } = useContext( ReaderThemes );
+ const { previewLinks, setActivePreviewLink, previewUrl, isPreviewingAMP, toggleIsPreviewingAMP } = usePreview();
+
+ /**
+ * Allow the finish button to be enabled.
+ */
+ useEffect( () => {
+ if ( ! canGoForward ) {
+ setCanGoForward( true );
+ }
+ }, [ setCanGoForward, canGoForward ] );
+
+ /**
+ * Triggers saving of options on arrival to this screen.
+ */
+ useEffect( () => {
+ if ( ! didSaveOptions && ! savingOptions ) {
+ saveOptions();
+ }
+ }, [ didSaveOptions, saveOptions, savingOptions ] );
+
+ /**
+ * Triggers saving of user options on arrival of this screen.
+ */
+ useEffect( () => {
+ if ( ! didSaveDeveloperToolsOption && ! savingDeveloperToolsOption ) {
+ saveDeveloperToolsOption();
+ }
+ }, [ didSaveDeveloperToolsOption, savingDeveloperToolsOption, saveDeveloperToolsOption ] );
+
+ if ( savingOptions || savingDeveloperToolsOption || downloadingTheme || hasOptionsChanges ) {
+ return ;
+ }
+
+ return (
+
+
+ { __( 'Done', 'amp' ) }
+
+
+
+
+ { __( 'Review', 'amp' ) }
+
+ { READER === themeSupport && downloadedTheme === readerTheme && (
+
+ { __( 'Your Reader theme was automatically installed', 'amp' ) }
+
+ ) }
+ { readerModeWasOverridden && (
+
+ { __( 'Because you selected a Reader theme that is the same as your site\'s active theme, your site has automatically been switched to Transitional template mode.', 'amp' ) }
+
+ ) }
+
+ { __( 'Your site is ready to bring great experiences to your users!', 'amp' ) }
+
+ { STANDARD === themeSupport && (
+
+ { __( 'In Standard mode there is a single AMP version of your site. Browse your site here to ensure it meets your expectations.', 'amp' ) }
+
+ { __( 'In Transitional mode AMP and non-AMP versions of your site are served using your currently active theme.', 'amp' ) }
+
+
+ { __( 'Browse your site here to ensure it meets your expectations, and toggle the AMP setting to compare both versions.', 'amp' ) }
+
+ >
+ ) }
+ { READER === themeSupport && (
+ <>
+
+ { __( 'In Reader mode AMP is served using your selected Reader theme, and pages for your non-AMP site are served using your primary theme. Browse your site here to ensure it meets your expectations, and toggle the AMP setting to compare both versions.', 'amp' ) }
+
+
+ { __( 'As a last step, use the Customizer to tailor the Reader theme as needed.', 'amp' ) }
+
+ { READER === themeSupport && downloadingThemeError && (
+
+ { __( 'There was an error downloading your Reader theme. As a result, your site is currently using the legacy reader theme. Please install your chosen theme manually.', 'amp' ) }
+
+ ) }
+ { STANDARD !== themeSupport && (
+
+ ) }
+
+
+
+
+
+ { __( 'Need help?', 'amp' ) }
+
+
+ { /* dangerouslySetInnerHTML reason: Injection of a link. */ }
+
support forums', 'amp' ),
+ 'https://wordpress.org/support/plugin/amp/#new-topic-0',
+ ),
+ } } />
+ { /* dangerouslySetInnerHTML reason: Injection of a link. */ }
+
in settings', 'amp' ),
+ SETTINGS_LINK,
+ ),
+ } } />
+ { /* dangerouslySetInnerHTML reason: Injection of a link. */ }
+
Learn more how the AMP plugin works', 'amp' ),
+ 'https://amp-wp.org/documentation/how-the-plugin-works/',
+ ),
+ } } />
+
+
+
+ );
+}
diff --git a/assets/src/onboarding-wizard/pages/done/preview.js b/assets/src/onboarding-wizard/pages/done/preview.js
new file mode 100644
index 00000000000..fe7e7aefa30
--- /dev/null
+++ b/assets/src/onboarding-wizard/pages/done/preview.js
@@ -0,0 +1,63 @@
+/**
+ * External dependencies
+ */
+import PropTypes from 'prop-types';
+
+/**
+ * WordPress dependencies
+ */
+import { useEffect, useRef, useState } from '@wordpress/element';
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import { Phone } from '../../../components/phone';
+
+/**
+ * Page preview component.
+ *
+ * @param {Object} props Component props.
+ * @param {string} props.url URL of the page to be previewed.
+ */
+export function Preview( { url } ) {
+ const iframeRef = useRef( null );
+ const [ isLoading, setIsLoading ] = useState( true );
+
+ useEffect( () => {
+ if ( ! iframeRef.current ) {
+ return null;
+ }
+
+ const iframe = iframeRef.current;
+ const onLoad = () => setIsLoading( false );
+
+ iframe.addEventListener( 'load', onLoad );
+
+ return () => {
+ iframe.removeEventListener( 'load', onLoad );
+ };
+ }, [] );
+
+ useEffect( () => {
+ if ( url ) {
+ setIsLoading( true );
+ }
+ }, [ url ] );
+
+ return (
+
+
+
+ );
+}
+
+Preview.propTypes = {
+ url: PropTypes.string,
+};
diff --git a/assets/src/onboarding-wizard/pages/save/index.js b/assets/src/onboarding-wizard/pages/done/saving.js
similarity index 56%
rename from assets/src/onboarding-wizard/pages/save/index.js
rename to assets/src/onboarding-wizard/pages/done/saving.js
index c4379d6792d..ef83265da73 100644
--- a/assets/src/onboarding-wizard/pages/save/index.js
+++ b/assets/src/onboarding-wizard/pages/done/saving.js
@@ -2,46 +2,11 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { useContext, useEffect } from '@wordpress/element';
-import { Button } from '@wordpress/components';
-
-/**
- * Internal dependencies
- */
-import { User } from '../../../components/user-context-provider';
-import { Phone } from '../../../components/phone';
-import './style.css';
-import { ReaderThemes } from '../../../components/reader-themes-context-provider';
-import { AMPNotice, NOTICE_SIZE_LARGE, NOTICE_TYPE_SUCCESS, NOTICE_TYPE_INFO } from '../../../components/amp-notice';
-import { Navigation } from '../../components/navigation-context-provider';
-import { Options } from '../../../components/options-context-provider';
-import { Done } from '../../../components/svg/done';
-
-/**
- * Provides the description for the done screen.
- *
- * @param {string} mode The selected mode.
- * @return {string} The text.
- */
-function getDescription( mode ) {
- switch ( mode ) {
- case 'standard':
- return __( 'Your site is ready to serve AMP pages to your users! In Standard mode (AMP-first) all canonical URLs are AMP by default. You can still opt out of AMP for specific content types and templates from the AMP settings screen. Depending on the theme and plugins you are using, development work may be required to maintain your site’s AMP compatibility.', 'amp' );
-
- case 'transitional':
- return __( 'Your site is ready to serve AMP pages to your users! In Transitional mode both the AMP and non-AMP versions of your site will be served using your currently active theme. With further development work to address AMP-compatibility issues in your themes and plugins, your site can be made fully AMP-first.', 'amp' );
-
- case 'reader':
- return __( 'Your site is ready to serve AMP pages to your users! In Reader mode the AMP version of your site will be served using the Reader theme you have selected (shown to the right), while pages for the non-AMP version of your site will be served using your primary theme. As a last step, make sure you tailor the Reader theme as needed using the Customizer.', 'amp' );
- default:
- return '';
- }
-}
/**
* UI for a saving state.
*/
-function Saving() {
+export function Saving() {
return (
- { 'reader' === themeSupport && downloadingThemeError && (
-
- { __( 'There was an error downloading your Reader theme. As a result, your site is currently using the legacy reader theme. Please install your chosen theme manually.', 'amp' ) }
-
- ) }
-
-
-
- );
-}
-
-SummaryHeader.propTypes = {
- illustration: PropTypes.node.isRequired,
- title: PropTypes.string.isRequired,
- text: PropTypes.string.isRequired,
-};
diff --git a/assets/src/onboarding-wizard/pages/summary/transitional.js b/assets/src/onboarding-wizard/pages/summary/transitional.js
deleted file mode 100644
index f802b9a7d79..00000000000
--- a/assets/src/onboarding-wizard/pages/summary/transitional.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * External dependencies
- */
-import PropTypes from 'prop-types';
-
-/**
- * WordPress dependencies
- */
-import { __ } from '@wordpress/i18n';
-
-/**
- * Internal dependencies
- */
-import { useContext } from '@wordpress/element';
-import { Transitional as TransitionalIllustration } from '../../../components/svg/transitional';
-import { AMPNotice, NOTICE_TYPE_INFO, NOTICE_SIZE_LARGE } from '../../../components/amp-notice';
-import { Options } from '../../../components/options-context-provider';
-import { SummaryHeader } from './summary-header';
-import { DesktopScreenshot } from './desktop-screenshot';
-
-/**
- * Summary screen when transitional mode was selected.
- *
- * @param {Object} props
- * @param {Object} props.currentTheme Data for the theme currently active on the site.
- */
-export function Transitional( { currentTheme } ) {
- const { readerModeWasOverridden } = useContext( Options );
-
- return (
- <>
- { readerModeWasOverridden && (
-
- { __( 'Because you selected a Reader theme that is the same as your site\'s active theme, your site has automatically been switched to Transitional template mode.', 'amp' ) }
-
- ) }
- }
- title={ __( 'Transitional', 'amp' ) }
- text={ __( 'In Transitional mode your site will have a non-AMP and an AMP version, and both will use the same theme. If automatic mobile redirection is enabled, the AMP version of the content will be served on mobile devices. If AMP-to-AMP linking is enabled, once users are on an AMP page, they will continue navigating your AMP content.', 'amp' ) }
- />
-
-
- >
- );
-}
-
-Transitional.propTypes = {
- currentTheme: PropTypes.shape( {
- description: PropTypes.string,
- name: PropTypes.string,
- screenshot: PropTypes.string,
- url: PropTypes.string,
- } ).isRequired,
-};
diff --git a/assets/src/onboarding-wizard/pages/technical-background/index.js b/assets/src/onboarding-wizard/pages/technical-background/index.js
index 289fdcab669..dc7c49a0fe2 100644
--- a/assets/src/onboarding-wizard/pages/technical-background/index.js
+++ b/assets/src/onboarding-wizard/pages/technical-background/index.js
@@ -48,47 +48,11 @@ export function TechnicalBackground() {
return (
- { __( 'In order to recommend the best plugin configuration options for your site, please indicate your level of technical expertise.', 'amp' ) }
+ { __( 'To recommend the best AMP experience we’d like to know if you’re a more technical user, or less technical.', 'amp' ) }
- { __( 'I am a “Developer or technically savvy” user. I am familiar with HTML, CSS, JavaScript, and PHP. I am able to do WordPress development, including making changes to themes and plugins, as well as assembling full WordPress sites out of plugins and theme components. I can understand and address AMP validation issues.', 'amp' ) }
+ { __( 'I can do WordPress development by modifying themes and plugins. I am familiar with PHP, JavaScript, HTML, and CSS.', 'amp' ) }
@@ -132,13 +94,11 @@ export function TechnicalBackground() {
-
-
- { __( 'Non-technically savvy or wanting a simpler setup', 'amp' ) }
-
-
+
+ { __( 'Non-technical or wanting a simpler setup', 'amp' ) }
+
- { __( 'I am not a developer and I am not responsible for configuring and fixing issues on my site. I am a site owner and/or content creator who wants to take advantage of AMP to build user-first sites.', 'amp' ) }
+ { __( 'I am not responsible for configuring and fixing issues on my site. I am a site owner and/or content creator who wants to take advantage of AMP performance.', 'amp' ) }
- { __( 'Welcome to the Official AMP Plugin for WordPress', 'amp' ) }
+ { __( 'AMP for WordPress', 'amp' ) }
@@ -72,9 +73,11 @@ export function Welcome() {
{ __( 'AMP and WordPress', 'amp' ) }
- { __( 'AMP is a web framework designed to make it easier to build user-first sites, which are beautiful, fast, engaging, secure, and accessible.', 'amp' ) }
+ { __( 'AMP provides support for building beautiful, fast, engaging, secure, and accessible sites, and the AMP plugin makes it easy to take advantage of AMP on WordPress.', 'amp' ) }
{ ' ' }
- { __( 'The Official AMP plugin for WordPress enables you to incorporate AMP into your site.', 'amp' ) }
+
+ { __( 'Learn more.', 'amp' ) }
+
@@ -107,7 +110,7 @@ export function Welcome() {
{ __( 'Configure your site with AMP', 'amp' ) }
- { __( 'There are different ways in which you can incorporate AMP content into your site, depending on its configuration (e.g. which theme and/or plugins you are using), your technical expertise and the level of resources you may have for addressing AMP compatibility issues as your site evolves.', 'amp' ) }
+ { __( 'Regardless of technical expertise, the onboarding flow guides you through configuring the plugin in a few easy steps.', 'amp' ) }
- { __( 'This onboarding flow will guide you through the plugin configuration and getting started with AMP on your site.', 'amp' ) }
+ { __( 'At the end of onboarding the AMP plugin is fully configured, and your site is ready to start serving great experiences to your users.', 'amp' ) }