Skip to content

Commit

Permalink
Merge pull request #592 from newfold-labs/fix/site-logo-error-state
Browse files Browse the repository at this point in the history
Add Site Logo Error State
  • Loading branch information
officiallygod authored Jul 24, 2024
2 parents 947d6d9 + 7eff4f2 commit d7102a6
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions src/OnboardingSPA/steps/SiteGen/SiteLogo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ACTION_SITEGEN_LOGO_SKIPPED,
} from '../../../utils/analytics/hiive/constants';
import { SITEGEN_FLOW } from '../../../data/flows/constants';
import { SiteGenStateHandler } from '../../../components/StateHandlers';

const SiteGenSiteLogo = () => {
const [ siteLogo, setSiteLogo ] = useState();
Expand Down Expand Up @@ -121,49 +122,51 @@ const SiteGenSiteLogo = () => {
const content = getContents();

return (
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__site-logo"
>
<div className="nfd-onboarding-step--site-gen__site-logo__container">
<AIHeading title={ content.heading } />
<ImageUploaderWithText
image={ siteLogo }
imageSetter={ handleSiteLogo }
onFailure={ handleFailure }
/>
<div className="nfd-onboarding-step--site-gen__site-logo__container__buttons">
<SkipButton
callback={ () => resetSiteLogo() }
className="nfd-onboarding-step--site-gen__site-logo__container__buttons__skip"
text={ content.buttons.skip }
<SiteGenStateHandler>
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__site-logo"
>
<div className="nfd-onboarding-step--site-gen__site-logo__container">
<AIHeading title={ content.heading } />
<ImageUploaderWithText
image={ siteLogo }
imageSetter={ handleSiteLogo }
onFailure={ handleFailure }
/>
{ isLargeViewport && (
<NextButtonSiteGen
callback={ () => {
if ( siteLogo ) {
trackOnboardingEvent(
new OnboardingEvent(
ACTION_LOGO_ADDED,
undefined,
{
source: SITEGEN_FLOW,
}
)
);
}
} }
text={ content.buttons.next }
disabled={
siteLogo === undefined || siteLogo?.id === 0
? true
: false
}
<div className="nfd-onboarding-step--site-gen__site-logo__container__buttons">
<SkipButton
callback={ () => resetSiteLogo() }
className="nfd-onboarding-step--site-gen__site-logo__container__buttons__skip"
text={ content.buttons.skip }
/>
) }
{ isLargeViewport && (
<NextButtonSiteGen
callback={ () => {
if ( siteLogo ) {
trackOnboardingEvent(
new OnboardingEvent(
ACTION_LOGO_ADDED,
undefined,
{
source: SITEGEN_FLOW,
}
)
);
}
} }
text={ content.buttons.next }
disabled={
siteLogo === undefined || siteLogo?.id === 0
? true
: false
}
/>
) }
</div>
</div>
</div>
</CommonLayout>
</CommonLayout>
</SiteGenStateHandler>
);
};

Expand Down

0 comments on commit d7102a6

Please sign in to comment.