-
-
- { isLargeViewport && (
-
-
+ ) : (
+
+
+
+ { isLargeViewport && (
+ <>
+
+
+
+ >
+ ) }
+
+ { content.walkThroughText }
+
+ { content.walkThroughlink }
+
- ) }
-
+
+ ) }
);
diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss b/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
index 4ea61864c..32239545a 100644
--- a/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
+++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/stylesheet.scss
@@ -1,6 +1,9 @@
.nfd-sg-site-details {
+ margin-top: 20%;
width: 40vw;
+ height: 100vh;
+
@media (max-width: #{ ($break-large) }) {
width: 80vw;
@@ -8,12 +11,15 @@
@media (max-width: #{ ($break-small) }) {
margin: 10px;
+ height: 100vh;
+ margin-bottom: 150px;
}
&-endrow {
width: 100%;
display: flex;
justify-content: flex-end;
+ margin-top: 20px;
@media (max-width: #{ ($break-small) }) {
justify-content: center;
@@ -32,4 +38,193 @@
box-shadow: 5px 5px rgba($color: var(--nfd-onboarding-secondary), $alpha: 0.1);
}
}
+
+ &-walkThrough {
+ width: 100%;
+ max-width: 431px;
+ margin-top: 50px;
+ margin-left: 40px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 16px;
+ border-radius: 12px;
+
+ background: #1e2327;
+
+ font-size: 15px;
+ font-weight: 400;
+ line-height: 20px;
+ letter-spacing: 0;
+ text-align: center;
+ color: #fff;
+ display: flex;
+
+ @media (max-width: #{ ($break-small) }) {
+ // justify-content: center;
+ margin-left: 0;
+ max-width: none;
+ width: 90%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ }
+
+
+ }
+
+ &-walkThrough span {
+ font-size: 15px;
+ font-weight: 510;
+ line-height: 20px;
+ letter-spacing: 0;
+ margin-left: 5px;
+ background: #1e2327;
+ color: #fff;
+ text-decoration: underline;
+ border: none;
+ cursor: pointer;
+ text-align: center;
+ transition: background-color 0.3s ease;
+ }
+
+ &-walkThrough span:hover {
+ cursor: pointer !important;
+ }
+
+ &-businessname {
+ margin-top: 20px;
+ }
+
+ &-rows > * {
+ margin-top: 20px;
+ }
+
+ &-rows {
+ margin-top: 30px;
+
+ label {
+ font-weight: 500;
+ font-size: 16px;
+ line-height: 19px;
+ color: var(--nfd-onboarding-primary);
+ }
+
+ input,
+ textarea {
+ max-width: 600px;
+ width: 100%;
+ height: 40px;
+ border: soild #9ca2a7 1px;
+ border-radius: 8px;
+ background-color: rgba(var(--nfd-onboarding-secondary-rgb), 0.3);
+ // opacity: 0.25;
+ color: var(--nfd-onboarding-primary);
+ font-weight: 400;
+ font-size: 17px;
+ line-height: 19px;
+ box-sizing: border-box;
+
+ }
+
+ textarea {
+ padding-top: 8px !important;
+ height: 100px;
+ }
+
+ textarea::placeholder,
+ input::placeholder {
+ font-size: 17px;
+ font-weight: 400;
+ line-height: 19px;
+ letter-spacing: 0;
+ text-align: left;
+ color: rgba(var(--nfd-onboarding-primary-rgb), 0.5);
+
+ }
+
+ button {
+ min-width: 79px;
+ height: 40px;
+ padding: 8px, 24px;
+ border-radius: 8px;
+ margin-right: 8px;
+ background-color: #00000040;
+ // opacity: 0.25;
+ border: 1px solid #9ca2a7;
+ color: var(--nfd-onboarding-primary) !important;
+
+
+ font-size: 18px;
+ font-weight: 500;
+ line-height: 19px;
+ letter-spacing: 0;
+ justify-content: center;
+ }
+
+ &-button-selected {
+ font-size: 15px;
+ font-style: italic;
+ font-weight: 500;
+ line-height: 19px;
+ letter-spacing: 0;
+ color: var(--nfd-onboarding-primary) !important;
+ opacity: 0.6;
+
+ }
+
+ &-write-style {
+ width: 292px;
+ min-width: auto;
+ height: 40px;
+ padding: 8px, 24px;
+ border-radius: 8px;
+ margin-right: 8px;
+ background-color: #00000040;
+ // opacity: 0.25;
+ border: 1px solid #9ca2a7;
+ color: var(--nfd-onboarding-primary) !important;
+ font-size: 15px !important;
+ font-weight: 500;
+ line-height: 19px;
+ letter-spacing: 0;
+
+ @media (max-width: #{ ($break-small) }) {
+ width: 100% !important;
+ margin: 0;
+ margin-top: 10px !important;
+ }
+ }
+
+ &-write-style:hover,
+ button:hover {
+ cursor: pointer;
+
+ }
+
+ @media (max-width: #{ ($break-small) }) {
+
+ label,
+ input,
+ textarea,
+ &-write-style {
+ width: 100%; /* Use full width on small screens */
+ padding: 8px, 24px;
+ display: flex;
+ max-width: none !important;
+ min-width: none !important;
+ flex-direction: column;
+ align-items: center;
+ }
+
+ button {
+ width: 45%;
+ display: inline-flex;
+ margin-right: 5% !important;
+ }
+ }
+ }
+
+ &-rows:last-child {
+ margin-bottom: 20px;
+ }
}
diff --git a/src/OnboardingSPA/steps/SiteGen/SiteDetails/walkthrough/index.js b/src/OnboardingSPA/steps/SiteGen/SiteDetails/walkthrough/index.js
new file mode 100644
index 000000000..f1d9719a3
--- /dev/null
+++ b/src/OnboardingSPA/steps/SiteGen/SiteDetails/walkthrough/index.js
@@ -0,0 +1,159 @@
+import { useViewportMatch } from '@wordpress/compose';
+import { useSelect, useDispatch } from '@wordpress/data';
+import { useEffect, useState } from '@wordpress/element';
+
+import getContents from '../contents';
+import { store as nfdOnboardingStore } from '../../../../store';
+import AIHeading from '../../../../components/Heading/AIHeading';
+import TextInputSiteGenDetails from '../../../../components/TextInput/TextInputSiteGenDetails';
+import TextAreaSiteGenDetails from '../../../../components/TextInput/TextAreaSiteGenDetails';
+import NextButtonSiteGen from '../../../../components/Button/NextButtonSiteGen';
+
+const SiteGenSiteDetailsWalkthrough = ( { siteDetailsmeta } ) => {
+ const content = getContents();
+ const isLargeViewport = useViewportMatch( 'small' );
+ const [ customerInputName, setCustomerInputName ] = useState();
+ const [ customerInputType, setCustomerInputType ] = useState();
+ const [ customerInputUnique, setCustomerInputUnique ] = useState();
+
+ const { currentData } = useSelect( ( select ) => {
+ return {
+ currentData:
+ select( nfdOnboardingStore ).getCurrentOnboardingData(),
+ };
+ } );
+
+ const { setFooterNavEnabled, setCurrentOnboardingData } =
+ useDispatch( nfdOnboardingStore );
+
+ useEffect( () => {
+ if ( currentData.sitegen.siteDetails?.name !== '' ) {
+ setCustomerInputName( currentData.sitegen.siteDetails.name );
+ }
+ if ( currentData.sitegen.siteDetails?.type !== '' ) {
+ setCustomerInputType( currentData.sitegen.siteDetails.type );
+ }
+ if ( currentData.sitegen.siteDetails?.uniqueAboutBusiness !== '' ) {
+ setCustomerInputUnique(
+ currentData.sitegen.siteDetails.uniqueAboutBusiness
+ );
+ }
+
+ setFooterNavEnabled( ! isdisabledNextButton() );
+ }, [] );
+
+ useEffect( () => {
+ setFooterNavEnabled( ! isdisabledNextButton() );
+ }, [ customerInputUnique, customerInputType ] );
+
+ const handlePromptChange = ( field, e ) => {
+ e.preventDefault();
+ currentData.sitegen.siteDetails[ field ] = e.target.value.trim();
+ currentData.sitegen.siteDetails.prompt = concatenatePrompt().trim();
+ setCurrentOnboardingData( currentData );
+ const setters = {
+ name: setCustomerInputName,
+ type: setCustomerInputType,
+ uniqueAboutBusiness: setCustomerInputUnique,
+ };
+
+ setters[ field ]( e.target.value );
+ setFooterNavEnabled( ! isdisabledNextButton() );
+ };
+
+ const concatenatePrompt = () => {
+ const siteDetails = currentData.sitegen.siteDetails;
+ let concatenatedString = '';
+
+ for ( const field in siteDetails ) {
+ if ( siteDetails[ field ] ) {
+ switch ( field ) {
+ case 'name':
+ concatenatedString += `${ siteDetailsmeta.businessName.prompt } ${ siteDetails[ field ] }. `;
+ break;
+ case 'type':
+ concatenatedString += `${ siteDetailsmeta.websiteType.prompt } ${ siteDetails[ field ] }. `;
+ break;
+ case 'uniqueAboutBusiness':
+ concatenatedString += `${ siteDetailsmeta.uniqueBusiness.prompt } ${ siteDetails[ field ] }.`;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return concatenatedString;
+ };
+
+ const checkAndNavigate = () => {
+ currentData.sitegen.siteDetails.prompt = concatenatePrompt().trim();
+ currentData.sitegen.siteDetails.mode = 'detailed';
+ setCurrentOnboardingData( currentData );
+ };
+
+ const isdisabledNextButton = () => {
+ return (
+ customerInputType === undefined ||
+ customerInputType === '' ||
+ customerInputUnique === undefined ||
+ customerInputUnique === ''
+ );
+ };
+
+ return (
+
+
+ { siteDetailsmeta && (
+ <>
+
+
+ handlePromptChange( 'name', e )
+ }
+ />
+
+
+
+ handlePromptChange( 'type', e )
+ }
+ />
+
+
+
+ handlePromptChange( 'uniqueAboutBusiness', e )
+ }
+ />
+
+ { isLargeViewport && (
+
+
+
+ ) }
+ >
+ ) }
+
+ );
+};
+
+export default SiteGenSiteDetailsWalkthrough;
diff --git a/src/OnboardingSPA/styles/app.scss b/src/OnboardingSPA/styles/app.scss
index 58882e322..85b03339a 100644
--- a/src/OnboardingSPA/styles/app.scss
+++ b/src/OnboardingSPA/styles/app.scss
@@ -61,6 +61,8 @@
@import "../components/Footer/stylesheet";
@import "../components/LivePreview/SiteGenCard/stylesheet";
@import "../components/Sidebar/components/SitegenEditorPatterns/stylesheet";
+@import "../components/TextInput/TextAreaSiteGenDetails/stylesheet";
+@import "../components/TextInput/TextInputSiteGenDetails/stylesheet";
// CSS for Pages
@import "../steps/BasicInfo/stylesheet";
diff --git a/src/OnboardingSPA/utils/api/siteGen.js b/src/OnboardingSPA/utils/api/siteGen.js
index 453f1f248..3f43c83d7 100644
--- a/src/OnboardingSPA/utils/api/siteGen.js
+++ b/src/OnboardingSPA/utils/api/siteGen.js
@@ -78,3 +78,11 @@ export async function toggleFavoriteHomepage( slug ) {
} ).then()
);
}
+
+export async function getSiteDetailsQuestionare() {
+ return await resolve(
+ apiFetch( {
+ url: onboardingRestURL( 'sitegen/site-details-meta' ),
+ } ).then()
+ );
+}