Skip to content

Commit fd65ebf

Browse files
committed
Apply modifier to child element to reduce nesting
1 parent 0653860 commit fd65ebf

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

client/my-sites/plugins/marketplace-footer/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export const MarketplaceFooter = () => {
1515
const isLoggedIn = useSelector( isUserLoggedIn );
1616
const currentUserSiteCount = useSelector( getCurrentUserSiteCount );
1717
const sectionName = useSelector( getSectionName );
18-
const classes = clsx( styles[ 'marketplace-footer' ], {
19-
[ styles[ 'is-logged-in' ] ]: isLoggedIn,
20-
} );
2118

2219
const startUrl = addQueryArgs(
2320
{
@@ -27,10 +24,12 @@ export const MarketplaceFooter = () => {
2724
);
2825

2926
return (
30-
<div className={ classes }>
27+
<div className={ styles[ 'marketplace-footer' ] }>
3128
<Section
3229
header={ preventWidows( __( 'You pick the plugin. We’ll take care of the rest.' ) ) }
33-
className={ styles[ 'marketplace-footer__section' ] }
30+
className={ clsx( styles[ 'marketplace-footer__section' ], {
31+
[ styles[ 'is-logged-in' ] ]: isLoggedIn,
32+
} ) }
3433
>
3534
{ ( ! isLoggedIn || currentUserSiteCount === 0 ) && (
3635
<Button primary className={ styles[ 'marketplace-footer__cta' ] } href={ startUrl }>

client/my-sites/plugins/marketplace-footer/style.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
& .marketplace-footer__section::before {
77
background-color: var( --studio-gray-0 );
88
}
9+
}
910

10-
&:not(.is-logged-in) .marketplace-footer__section {
11-
padding-bottom: 32px;
12-
}
11+
.marketplace-footer__section.is-logged-in {
12+
padding-bottom: 32px;
1313
}
1414

1515
.marketplace-footer__cta {

0 commit comments

Comments
 (0)