Skip to content

Commit

Permalink
Merge pull request #471 from newfold-labs/fixes-some-minor-issues-in-…
Browse files Browse the repository at this point in the history
…sitegen

More Minor Changes
  • Loading branch information
officiallygod authored Feb 21, 2024
2 parents ab4cde0 + dac34e8 commit 693a7a6
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/Building/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ const SiteGenBuilding = () => {
setSidebarActiveView,
setHeaderActiveView,
setDrawerActiveView,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

useEffect( () => {
setIsHeaderEnabled( true );
setSidebarActiveView( false );
setIsHeaderNavigationEnabled( false );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
} );
Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const StepSiteGenEditor = () => {
setDrawerActiveView,
setHideFooterNav,
setCurrentOnboardingData,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

const { currentData } = useSelect( ( select ) => {
Expand All @@ -48,6 +49,7 @@ const StepSiteGenEditor = () => {
setIsHeaderEnabled( true );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
setIsHeaderNavigationEnabled( false );
const activeHomepage = currentData.sitegen.homepages.active;
setHomepage( activeHomepage );
const globalStylesResponse = await getGlobalStyles();
Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/Experience/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const SiteGenExperience = () => {
setDrawerActiveView,
setHideFooterNav,
setCurrentOnboardingData,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

useEffect( () => {

Check warning on line 34 in src/OnboardingSPA/steps/SiteGen/Experience/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect contains a call to 'setSelection'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [setHideFooterNav, setIsHeaderEnabled, setSidebarActiveView, setIsHeaderNavigationEnabled, setHeaderActiveView, setDrawerActiveView, currentData.sitegen.experience.level] as a second argument to the useEffect Hook
setHideFooterNav( true );
setIsHeaderEnabled( true );
setSidebarActiveView( false );
setIsHeaderNavigationEnabled( false );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );

Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/Preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const SiteGenPreview = () => {
updateInitialize,
setHideFooterNav,
updateSiteGenErrorStatus,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

const { currentData, nextStep, siteGenErrorStatus } = useSelect(
Expand All @@ -55,6 +56,7 @@ const SiteGenPreview = () => {
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
updateInitialize( true );
setIsHeaderNavigationEnabled( false );
}, [ currentData ] );

Check warning on line 60 in src/OnboardingSPA/steps/SiteGen/Preview/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView', 'setHeaderActiveView', 'setHideFooterNav', 'setIsHeaderEnabled', 'setIsHeaderNavigationEnabled', 'setSidebarActiveView', and 'updateInitialize'. Either include them or remove the dependency array

useEffect( () => {
Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ const SiteGenSiteDetails = () => {
setDrawerActiveView,
setHideFooterNav,
setCurrentOnboardingData,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

useEffect( () => {
setHideFooterNav( false );
setIsHeaderEnabled( true );
setSidebarActiveView( false );
setHeaderActiveView( HEADER_SITEGEN );
setIsHeaderNavigationEnabled( true );
setDrawerActiveView( false );
if ( currentData.sitegen.siteDetails?.prompt !== '' ) {
setIsValidInput( true );
Expand Down
7 changes: 5 additions & 2 deletions src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
.nfd-sg-site-details {

margin-top: 20%;
width: 40vw;
height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;


@media (max-width: #{ ($break-large) }) {
width: 80vw;
}

@media (max-width: #{ ($break-small) }) {
margin: 10px;
height: 100vh;
margin-top: 30%;
margin-bottom: 150px;
}

Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const SiteGenSiteLogo = () => {
setDrawerActiveView,
setHideFooterNav,
setCurrentOnboardingData,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

const resetSiteLogo = () => {
Expand All @@ -57,6 +58,7 @@ const SiteGenSiteLogo = () => {
setHideFooterNav( false );
setIsHeaderEnabled( true );
setSidebarActiveView( false );
setIsHeaderNavigationEnabled( true );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
if ( currentData.data.siteLogo?.id !== 0 ) {
Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ const SiteGenSiteSocialMedia = () => {
setDrawerActiveView,
setIsFooterNavAllowed,
updateSiteGenErrorStatus,
setIsHeaderNavigationEnabled,
} = useDispatch( nfdOnboardingStore );

useEffect( () => {
setIsHeaderEnabled( true );
setSidebarActiveView( false );
setHeaderActiveView( HEADER_SITEGEN );
setDrawerActiveView( false );
setIsHeaderNavigationEnabled( true );
} );

const { nextStep } = useSelect( ( select ) => {
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/steps/SiteGen/Welcome/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const getContents = () => {
return {
heading: __( 'Website Creator for WordPress', 'wp-module-onboarding' ),
subHeading: __(
'Tell our AI engine what kind of site you want to make and let it handle the content and design for you',
'Tell our AI engine what kind of site you want to make and let it handle the content and design for you.',
'wp-module-onboarding'
),
buttonText: __( 'Get Started', 'wp-module-onboarding' ),
Expand Down
11 changes: 7 additions & 4 deletions src/OnboardingSPA/steps/TheFork/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const getContents = () => {
),
options: [
{
title: __( 'Build it myself', 'wp-module-onboarding' ),
title: __( 'Guided Configuration', 'wp-module-onboarding' ),
subtitle: __(
"We'll stay out of your way.",
'A few questions & settings to get you a jumpstart.',
'wp-module-onboarding'
),
flow: 'sitebuild',
},
{
title: __( ' Website Creator', 'wp-module-onboarding' ),
subtitle: __(
'Custom AI generated content & design.',
'Unique AI generated content & design curated for you.',
'wp-module-onboarding'
),
span: __( 'AI', 'wp-module-onboarding' ),
Expand All @@ -35,7 +35,6 @@ const getContents = () => {
flow: 'hirepro',
},
],

importtext: __(
'Already have a WordPress site you want to import?',
'wp-module-onboarding'
Expand All @@ -44,6 +43,10 @@ const getContents = () => {
'https://my.bluehost.com/cgi/services/migration',
'wp-module-onboarding'
),
exitToWordPress: __(
'I’m following a tutorial',
'wp-module-onboarding'
),
};
};

Expand Down
12 changes: 11 additions & 1 deletion src/OnboardingSPA/steps/TheFork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { useEffect } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';

import { store as nfdOnboardingStore } from '../../store';
import { FOOTER_SITEGEN, HEADER_SITEGEN } from '../../../constants';
import {
FOOTER_SITEGEN,
HEADER_SITEGEN,
pluginDashboardPage,
} from '../../../constants';

import { DEFAULT_FLOW } from '../../data/flows/constants';
import HeadingWithSubHeading from '../../components/HeadingWithSubHeading/SiteGen/index';
Expand Down Expand Up @@ -69,6 +73,12 @@ const TheFork = () => {
>
{ content.importtext }
</a>
<a
className="nfd-onboarding-step--site-gen__fork__exit"
href={ pluginDashboardPage }
>
{ content.exitToWordPress }
</a>
</CommonLayout>
</SitegenAiStateHandler>
);
Expand Down
14 changes: 11 additions & 3 deletions src/OnboardingSPA/steps/TheFork/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,20 @@
}

&__importsite {
color: var(--nfd-onboarding-primary);
font-size: 18px;
font-weight: 510;
line-height: 20px;
text-align: center;
font-size: 18px;
margin: 25px !important;
color: var(--nfd-onboarding-primary);
}

&__exit {
cursor: pointer;
font-weight: 510;
line-height: 20px;
margin: 35px !important;
text-align: center;
color: var(--nfd-onboarding-primary);
}
}
}
Expand Down

0 comments on commit 693a7a6

Please sign in to comment.