Skip to content

Commit

Permalink
Merge pull request #412 from newfold-labs/sitegen-hiive-capability-flag
Browse files Browse the repository at this point in the history
AI Sitegen Capability Check
  • Loading branch information
arunshenoy99 authored Jan 17, 2024
2 parents 9db0e43 + a447a6f commit cbe2366
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
flex-direction: column;
justify-content: center;
margin-left: 18px;
max-width: 27vw;

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

&__filename {
margin: 0;
Expand Down Expand Up @@ -133,7 +138,7 @@
border: none;
font-weight: 510;
font-style: normal;
background-color: #ff0e9099;
background-color: transparent;
color: var(--nfd-onboarding-primary);
font-size: clamp(0.5rem, 0.4091rem + 0.4545vw, 1.5rem);

Expand All @@ -143,7 +148,7 @@
}

&__icon {
fill: rgb(255, 14, 144);
fill: var(--nfd-onboarding-primary);
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/OnboardingSPA/components/StartOptions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
};
const selectFlow = ( flow ) => {
switch ( flow ) {
case 'onboarding':
case 'sitebuild':
return switchFlow( oldFlow );
case 'ai':
case 'sitegen':
return switchFlow( SITEGEN_FLOW );
case 'migration':
return window.open( migrationUrl, '_blank' );
Expand All @@ -68,6 +68,13 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
</p>
<div className="nfd-onboarding-sitegen-options__container">
{ options.map( ( tab, idx ) => {
if (
tab.flow === SITEGEN_FLOW &&
! validateFlow( brandConfig, tab.flow )
) {
// Do not show the Sitegen AI option if not enabled for the customer
return false;
}
return (
<div
className="nfd-onboarding-sitegen-options__container__options"
Expand Down
4 changes: 2 additions & 2 deletions src/OnboardingSPA/steps/TheFork/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getContents = () => {
"We'll stay out of your way.",
'wp-module-onboarding'
),
flow: 'onboarding',
flow: 'sitebuild',
},
{
title: __( ' Website Creator', 'wp-module-onboarding' ),
Expand All @@ -24,7 +24,7 @@ const getContents = () => {
'wp-module-onboarding'
),
span: __( 'AI', 'wp-module-onboarding' ),
flow: 'ai',
flow: 'sitegen',
},
{
title: __( 'Hire a Pro', 'wp-module-onboarding' ),
Expand Down

0 comments on commit cbe2366

Please sign in to comment.