Skip to content

Commit

Permalink
Merge pull request #190 from newfold-labs/enhance/crazydomains-hide-s…
Browse files Browse the repository at this point in the history
…idebar-illustrations

Add dynamic brand configuration to hide sidebar illustrations for crazy domains
  • Loading branch information
arunshenoy99 authored Mar 8, 2023
2 parents 0363c7b + 5981cf0 commit 2fbf1a8
Show file tree
Hide file tree
Showing 38 changed files with 164 additions and 100 deletions.
12 changes: 12 additions & 0 deletions includes/Data/Brands.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'config' => array(),
),
'bluehost-india' => array(
'brand' => 'bluehost-india',
Expand Down Expand Up @@ -114,6 +115,7 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'config' => array(),
),
'webcom' => array(
'brand' => 'webcom',
Expand Down Expand Up @@ -165,6 +167,7 @@ public static function get_brands() {
'utm_medium' => '',
),
),
'config' => array(),
),
'crazy-domains' => array(
'brand' => 'crazy-domains',
Expand Down Expand Up @@ -216,6 +219,15 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'config' => array(
'views' => array(
'sidebar' => array(
'illustration' => array(
'shown' => false,
),
),
),
),
),
);
}
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { PanelBody } from '@wordpress/components';
const IllustrationPanel = ( {
cssIcon = 'nfd-onboarding-sidebar-learn-more-get-started-welcome-illustration',
baseClassName = 'nfd-onboarding-sidebar-learn-more--illustration-panel',
backgroundPosition = 'center'
backgroundPosition = 'center',
} ) => {
const iconExists = window.getComputedStyle( document.body ).getPropertyValue( `--${ cssIcon }` ) !== '';

return (
<PanelBody
iconExists && <PanelBody
className={ `${ baseClassName }__container` }
initialOpen={ true }
>
Expand All @@ -18,7 +20,7 @@ const IllustrationPanel = ( {
height: '100%',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition: backgroundPosition,
backgroundPosition,
} }
></div>
</PanelBody>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { useSelect } from '@wordpress/data';
import { Fragment } from '@wordpress/element';

import Animate from '../../../../Animate';
import { store as nfdOnboardingStore } from '../../../../../store';

/** Skeleton Structure for the SideBar */
const SidebarSkeleton = () => {
const { brandConfig } = useSelect( ( select ) => {
return {
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

return (
<div className="sidebar-skeleton">
<div className="sidebar-skeleton-header">
Expand All @@ -27,13 +37,15 @@ const SidebarSkeleton = () => {
</div>
</div>
<div className="sidebar-skeleton-divider" />
<div className="sidebar-skeleton-body">
<Animate
type={ 'shine-placeholder' }
className="shimmer sidebar-skeleton-body-image"
/>
</div>
<div className="sidebar-skeleton-divider" />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && <Fragment>
<div className="sidebar-skeleton-body">
<Animate
type={ 'shine-placeholder' }
className="shimmer sidebar-skeleton-body-image"
/>
</div>
<div className="sidebar-skeleton-divider" />
</Fragment> }
<div className="sidebar-skeleton-footer">
<Animate
type={ 'shine-placeholder' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -47,7 +48,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -57,7 +59,7 @@ const LearnMore = () => {
<ButtonWhite
text={ content.help.fullService.text }
onClick={ () =>
( window.open( content.help.fullService.link, '_blank') )
( window.open( content.help.fullService.link, '_blank' ) )
}
/>
<SupportLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {

const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -47,7 +47,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {

const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -47,7 +47,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {

const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -47,7 +47,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -51,7 +52,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -51,7 +52,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -45,7 +46,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -51,7 +52,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -61,7 +63,7 @@ const LearnMore = () => {
<ButtonWhite
text={ content.help.fullService.text }
onClick={ () =>
( window.open( content.help.fullService.link, '_blank') )
( window.open( content.help.fullService.link, '_blank' ) )
}
/>
<SupportLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } = useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(),
fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -51,7 +52,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -61,7 +63,7 @@ const LearnMore = () => {
<ButtonWhite
text={ content.help.fullService.text }
onClick={ () =>
( window.open( content.help.fullService.link, '_blank') )
( window.open( content.help.fullService.link, '_blank' ) )
}
/>
<SupportLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StepIntroPanel = lazy( () =>
);

const LearnMore = () => {
const { brandName, techSupportLink, fullServiceCreativeTeamLink } =
const { brandName, techSupportLink, fullServiceCreativeTeamLink, brandConfig } =
useSelect( ( select ) => {
return {
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(),
Expand All @@ -44,6 +44,7 @@ const LearnMore = () => {
select(
nfdOnboardingStore
).getfullServiceCreativeTeamUrl(),
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
};
} );

Expand All @@ -60,7 +61,8 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
<IllustrationPanel cssIcon={ content.illustration.icon } />
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand Down
Loading

0 comments on commit 2fbf1a8

Please sign in to comment.