diff --git a/src/OnboardingSPA/components/CardWithOptions/index.js b/src/OnboardingSPA/components/CardWithOptions/index.js index 14e54db71..0c5ef008b 100644 --- a/src/OnboardingSPA/components/CardWithOptions/index.js +++ b/src/OnboardingSPA/components/CardWithOptions/index.js @@ -1,49 +1,18 @@ import { memo } from '@wordpress/element'; -import { Icon, chevronRight } from '@wordpress/icons'; +import OptionWithHeadingSubHeading from '../OptionWithHeadingSubHeading'; -const CardWithOptions = ( { title, options, skip, callback } ) => { - const buildOptions = () => { +const CardWithOptions = ( { title, options, selection, callback } ) => { + const buildCardOptions = () => { return options.map( ( data, idx ) => { return ( -
{ - if ( callback && typeof callback === 'function' ) { - callback( idx + 1 ); - } - } } - onKeyDown={ () => { - if ( callback && typeof callback === 'function' ) { - callback( idx + 1 ); - } - } } - > -
-
-
- { data.title } -
-
- { data.desc } -
-
- -
-
+ idx={ idx } + title={ data.title } + desc={ data.desc } + isSelected={ data.key === selection } + callback={ callback } + /> ); } ); }; @@ -51,24 +20,7 @@ const CardWithOptions = ( { title, options, skip, callback } ) => { return (
{ title }
-
{ buildOptions() }
-
{ - if ( callback && typeof callback === 'function' ) { - callback( -1 ); - } - } } - onKeyDown={ () => { - if ( callback && typeof callback === 'function' ) { - callback( -1 ); - } - } } - > - { skip } -
+
{ buildCardOptions() }
); }; diff --git a/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss b/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss index b12d46074..92d32f151 100644 --- a/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss +++ b/src/OnboardingSPA/components/CardWithOptions/stylesheet.scss @@ -28,64 +28,5 @@ $background-color: var(--nfd-onboarding-card-background); &__data { margin: 12px; - - &__option { - - &__wrapper { - display: flex; - cursor: pointer; - margin: 16px 4px; - align-items: center; - border-radius: 8px; - padding: 16px 12px 16px 12px; - justify-content: space-between; - transition: background-color 400ms ease-in-out; - - &:hover { - background-color: var(--nfd-onboarding-hover); - } - } - - &:not(:last-child) { - border-bottom: 0.5px solid rgba(var(--nfd-onboarding-primary-rgb), 0.3); - } - - &__left_top { - color: var(--nfd-onboarding-primary); - font-size: 15px; - font-weight: 500; - margin-bottom: 7px; - line-height: 24px; - } - - &__left_bottom { - color: rgba(var(--nfd-onboarding-primary-rgb), 0.7); - - font-size: 14px; - font-weight: 300; - } - - &__right { - fill: var(--nfd-onboarding-primary); - transition: all 200ms ease-in-out; - - &:hover { - transform: scale(1.1); - } - } - } - } - - &__skip { - cursor: pointer; - text-align: end; - margin: 0 20px 6px 20px; - transition: color 200ms ease-in-out; - color: rgba(var(--nfd-onboarding-primary-rgb), 0.8); - font-weight: 500; - - &:hover { - color: var(--nfd-onboarding-primary); - } } } diff --git a/src/OnboardingSPA/components/Drawer/DrawerPanel/NavPrimary.js b/src/OnboardingSPA/components/Drawer/DrawerPanel/NavPrimary.js index 250061aa2..3e9a0b827 100644 --- a/src/OnboardingSPA/components/Drawer/DrawerPanel/NavPrimary.js +++ b/src/OnboardingSPA/components/Drawer/DrawerPanel/NavPrimary.js @@ -27,6 +27,9 @@ const NavPrimary = () => {
- +
diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/Header/center.js b/src/OnboardingSPA/steps/SiteGen/Editor/Header/center.js index c6fe6106e..f9b5d663d 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/Header/center.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/Header/center.js @@ -116,6 +116,7 @@ const TitleContent = memo( onChange={ handleOnChange } /> { diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/contents.js b/src/OnboardingSPA/steps/SiteGen/Experience/contents.js index 246dbb06e..5d0f92a0a 100644 --- a/src/OnboardingSPA/steps/SiteGen/Experience/contents.js +++ b/src/OnboardingSPA/steps/SiteGen/Experience/contents.js @@ -8,28 +8,27 @@ const getContents = () => { ), options: [ { + key: 1, title: __( 'Beginner', 'wp-module-onboarding' ), desc: __( - 'First time here, where am I?', + 'First time building a website using WordPress', 'wp-module-onboarding' ), }, { - title: __( 'Used it some', 'wp-module-onboarding' ), + key: 2, + title: __( 'Intermediate', 'wp-module-onboarding' ), desc: __( - "I'll ask for help when I need it", + 'I’ve built a few sites for myself or others', 'wp-module-onboarding' ), }, { + key: 3, title: __( 'Expert', 'wp-module-onboarding' ), - desc: __( - "Stay out of my way, I know what I'm doing", - 'wp-module-onboarding' - ), + desc: __( 'I do this frequently', 'wp-module-onboarding' ), }, ], - skip: __( 'Skip', 'wp-module-onboarding' ), }; }; diff --git a/src/OnboardingSPA/steps/SiteGen/Experience/index.js b/src/OnboardingSPA/steps/SiteGen/Experience/index.js index 0e340ee47..198b7e60a 100644 --- a/src/OnboardingSPA/steps/SiteGen/Experience/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Experience/index.js @@ -1,4 +1,3 @@ -import { useNavigate } from 'react-router-dom'; import { useSelect, useDispatch } from '@wordpress/data'; import { useEffect, useState } from '@wordpress/element'; @@ -11,17 +10,14 @@ import SiteGenLoader from '../../../components/Loaders/SiteGenLoader'; import SitegenAiStateHandler from '../../../components/StateHandlers/SitegenAi'; const SiteGenExperience = () => { - const navigate = useNavigate(); const content = getContents(); // Index of the selection user makes - /* eslint-disable no-unused-vars */ - const [ selection, setSelection ] = useState(); + const [ selection, setSelection ] = useState( 0 ); - const { currentData, nextStep } = useSelect( ( select ) => { + const { currentData } = useSelect( ( select ) => { return { currentData: select( nfdOnboardingStore ).getCurrentOnboardingData(), - nextStep: select( nfdOnboardingStore ).getNextStep(), }; } ); @@ -48,25 +44,25 @@ const SiteGenExperience = () => { const checkAndNavigate = ( idx ) => { // 0 - Not Selected - // 1-2 Options + // 1-3 Options // -1 Skip setSelection( idx ); currentData.sitegen.experience.level = idx; setCurrentOnboardingData( currentData ); - if ( nextStep ) { - navigate( nextStep.path ); - } }; return (
- +
diff --git a/src/OnboardingSPA/steps/SiteGen/Preview/index.js b/src/OnboardingSPA/steps/SiteGen/Preview/index.js index fed3f2747..b2e58d1df 100644 --- a/src/OnboardingSPA/steps/SiteGen/Preview/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Preview/index.js @@ -14,6 +14,7 @@ import RegeneratingSiteCard from './regeneratingCard'; import { getHomepages, regenerateHomepage } from '../../../utils/api/siteGen'; import { getGlobalStyles } from '../../../utils/api/themes'; import SitegenAiStateHandler from '../../../components/StateHandlers/SitegenAi'; +import Animate from '../../../components/Animate'; const SiteGenPreview = () => { const navigate = useNavigate(); @@ -241,16 +242,20 @@ const SiteGenPreview = () => {
-
-

- { content.heading } -

-
-
-

- { content.subheading } -

-
+ { ! isPreviewLoading && ( + +
+

+ { content.heading } +

+
+
+

+ { content.subheading } +

+
+
+ ) }
{ buildPreviews() } diff --git a/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss index 70fc27b7e..bb5d970f2 100644 --- a/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss +++ b/src/OnboardingSPA/steps/SiteGen/Preview/stylesheet.scss @@ -9,6 +9,7 @@ flex-wrap: wrap; max-width: 500px; padding-top: 32px; + min-height: 160px; margin-bottom: 15px; &__heading { diff --git a/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js b/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js index db0365abc..d2136efa2 100644 --- a/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js @@ -60,6 +60,7 @@ const SiteGenSiteLogo = () => { setHeaderActiveView( HEADER_SITEGEN ); setDrawerActiveView( false ); if ( currentData.data.siteLogo?.id !== 0 ) { + setIsFooterNavAllowed( true ); return setSiteLogo( currentData.data.siteLogo ); } setIsFooterNavAllowed( false ); diff --git a/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js b/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js index 3c8633f65..4889439c6 100644 --- a/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js @@ -24,6 +24,7 @@ const SiteGenSiteSocialMedia = () => { setSidebarActiveView, setHeaderActiveView, setDrawerActiveView, + setIsFooterNavAllowed, updateSiteGenErrorStatus, } = useDispatch( nfdOnboardingStore ); @@ -49,6 +50,7 @@ const SiteGenSiteSocialMedia = () => { }; useEffect( () => { + setIsFooterNavAllowed( connected ); if ( interacted && connected ) { navigate( nextStep.path ); } diff --git a/src/OnboardingSPA/steps/TheFork/step.js b/src/OnboardingSPA/steps/TheFork/step.js index 143f79615..d2f833d37 100644 --- a/src/OnboardingSPA/steps/TheFork/step.js +++ b/src/OnboardingSPA/steps/TheFork/step.js @@ -7,9 +7,10 @@ const StepTheFork = lazy( () => import( './index' ) ); export const stepTheFork = new Step( { path: '/wp-setup/step/fork', - title: __( 'Page Layouts', 'wp-module-onboarding' ), + title: __( 'The Fork', 'wp-module-onboarding' ), Component: StepTheFork, icon: copy, + drawerNavigation: false, sidebars: { LearnMore: { SidebarComponents: [], diff --git a/src/OnboardingSPA/styles/app.scss b/src/OnboardingSPA/styles/app.scss index 4b00aa040..2921e45f8 100644 --- a/src/OnboardingSPA/styles/app.scss +++ b/src/OnboardingSPA/styles/app.scss @@ -56,6 +56,7 @@ @import "../components/TextInput/TextInputSiteGen/stylesheet"; @import "../components/ToggleDarkMode/stylesheet"; @import "../components/Button/NextButtonSiteGen/stylesheet"; +@import "../components/OptionWithHeadingSubHeading/stylesheet"; @import "../components/CardWithOptions/stylesheet"; @import "../components/Loaders/SiteGenLoader/stylesheet"; @import "../components/Footer/stylesheet";