Skip to content

Commit

Permalink
fix lint wrt new @wordpress/scripts standards
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Apr 14, 2023
1 parent 96515c3 commit 4a3f6cc
Show file tree
Hide file tree
Showing 23 changed files with 361 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ const CheckboxItem = ( {
<div className={ `${ className }__contents` }>
<div
className={ `${ className }__contents-icon
${ isSelected &&
${
isSelected &&
`${ className }__contents-icon--selected`
}
}
${
showDescription &&
showDescription &&
`${ className }__contents-icon--shown`
}` }
}` }
>
<div
style={ {
Expand Down Expand Up @@ -91,7 +92,9 @@ const CheckboxItem = ( {
</div>
</div>
<div
className={ `${ className }__contents-help ${ showDescription ? 'highlighted' : '' }` }
className={ `${ className }__contents-help ${
showDescription ? 'highlighted' : ''
}` }
onClick={ handleShowDesc }
role="button"
onKeyDown={ handleShowDesc }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,30 @@ const IllustrationPanel = ( {
baseClassName = 'nfd-onboarding-sidebar-learn-more--illustration-panel',
backgroundPosition = 'center',
} ) => {
const iconExists = window.getComputedStyle( document.body ).getPropertyValue( `--${ cssIcon }` ) !== '';
const iconExists =
window
.getComputedStyle( document.body )
.getPropertyValue( `--${ cssIcon }` ) !== '';

return (
iconExists && <PanelBody
className={ `${ baseClassName }__container` }
initialOpen={ true }
>
<div
className={ `${ baseClassName }__image` }
style={ {
backgroundImage: `var(--${ cssIcon })`,
width: '100%',
height: '100%',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition,
} }
></div>
</PanelBody>
iconExists && (
<PanelBody
className={ `${ baseClassName }__container` }
initialOpen={ true }
>
<div
className={ `${ baseClassName }__image` }
style={ {
backgroundImage: `var(--${ cssIcon })`,
width: '100%',
height: '100%',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition,
} }
></div>
</PanelBody>
)
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ const SidebarSkeleton = () => {
</div>
</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> }
{ 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
23 changes: 17 additions & 6 deletions src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,26 @@ const StepIntroPanel = lazy( () =>
);

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

const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink );
const content = getContents(
brandName,
techSupportLink,
fullServiceCreativeTeamLink
);

return (
<div className="nfd-onboarding-sidebar-learn-more__basic-info">
Expand All @@ -48,8 +58,9 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && (
<IllustrationPanel cssIcon={ content.illustration.icon } />
) }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -59,7 +70,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,13 +30,19 @@ const StepIntroPanel = lazy( () =>
);

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

const content = getContents( techSupportLink, fullServiceCreativeTeamLink );

Expand All @@ -47,8 +53,9 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && (
<IllustrationPanel cssIcon={ content.illustration.icon } />
) }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -58,7 +65,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,13 +30,19 @@ const StepIntroPanel = lazy( () =>
);

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

const content = getContents( techSupportLink, fullServiceCreativeTeamLink );

Expand All @@ -47,8 +53,9 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && (
<IllustrationPanel cssIcon={ content.illustration.icon } />
) }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -58,7 +65,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,13 +30,19 @@ const StepIntroPanel = lazy( () =>
);

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

const content = getContents( techSupportLink, fullServiceCreativeTeamLink );

Expand All @@ -47,8 +53,9 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && (
<IllustrationPanel cssIcon={ content.illustration.icon } />
) }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -58,7 +65,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,16 +34,26 @@ const StepIntroPanel = lazy( () =>
);

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

const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink );
const content = getContents(
brandName,
techSupportLink,
fullServiceCreativeTeamLink
);

return (
<div className="nfd-onboarding-sidebar-learn-more__design-theme-styles-menu">
Expand All @@ -52,8 +62,9 @@ const LearnMore = () => {
subheading={ content.introduction.subheading }
icon={ content.introduction.icon }
/>
{ brandConfig?.views?.sidebar?.illustration?.shown !== false &&
<IllustrationPanel cssIcon={ content.illustration.icon } /> }
{ brandConfig?.views?.sidebar?.illustration?.shown !== false && (
<IllustrationPanel cssIcon={ content.illustration.icon } />
) }
<InfoPanel
headingWithDescriptions={
content.information.headingWithDescriptions
Expand All @@ -63,7 +74,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
Loading

0 comments on commit 4a3f6cc

Please sign in to comment.