Skip to content

Commit 5e04a57

Browse files
committed
Remove ConsolidateStatsCard and StepSection temporary core style prop.
1 parent ff509c0 commit 5e04a57

File tree

15 files changed

+21
-107
lines changed

15 files changed

+21
-107
lines changed

client/a8c-for-agencies/components/consolidated-stats-card/index.tsx

+2-14
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ interface ConsolidatedStatsCardProps {
8282
popoverTitle?: string;
8383
popoverContent: React.ReactNode;
8484
isLoading?: boolean;
85-
applyCoreStyles?: boolean;
8685
}
8786

8887
export function ConsolidatedStatsCard( {
@@ -91,27 +90,16 @@ export function ConsolidatedStatsCard( {
9190
popoverTitle,
9291
popoverContent,
9392
isLoading = false,
94-
applyCoreStyles = false,
9593
}: ConsolidatedStatsCardProps ) {
9694
const cardRef = useRef< HTMLDivElement | null >( null );
9795

9896
return (
99-
<Card
100-
compact
101-
ref={ cardRef }
102-
className={ clsx( 'consolidated-stats-card', { 'is-core-styles': applyCoreStyles } ) }
103-
>
97+
<Card compact ref={ cardRef } className="consolidated-stats-card">
10498
<div className="consolidated-stats-card__value">
10599
{ isLoading ? <TextPlaceholder /> : value }
106100
</div>
107101
<CardInfo title={ popoverTitle } wrapperRef={ cardRef } footerText={ footerText }>
108-
<div
109-
className={ clsx( 'consolidated-stats-card__popover-content', {
110-
'is-core-styles': applyCoreStyles,
111-
} ) }
112-
>
113-
{ popoverContent }
114-
</div>
102+
<div className="consolidated-stats-card__popover-content">{ popoverContent }</div>
115103
</CardInfo>
116104
</Card>
117105
);

client/a8c-for-agencies/components/consolidated-stats-card/style.scss

+3-22
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636

3737
.consolidated-stats-card__value {
3838
color: var(--color-accent-100);
39-
font-size: rem(24px);
40-
font-weight: 700;
39+
@include heading-x-large;
4140
margin-block-end: 8px;
4241
}
4342

@@ -81,7 +80,7 @@
8180

8281
.consolidated-stats-card__label {
8382
color: var(--color-accent);
84-
font-size: rem(12px);
83+
@include body-medium;
8584
text-wrap: balance;
8685
}
8786

@@ -94,7 +93,7 @@
9493

9594
.consolidated-stats-card__popover-content {
9695
min-width: 200px;
97-
@include a4a-font-body-md;
96+
@include body-medium;
9897

9998
@include break-mobile {
10099
min-width: 300px;
@@ -109,21 +108,3 @@
109108
outline: none;
110109
}
111110
}
112-
113-
// Core styles
114-
115-
.consolidated-stats-card.is-core-styles {
116-
.consolidated-stats-card__value {
117-
@include heading-x-large;
118-
}
119-
120-
.consolidated-stats-card__label {
121-
@include body-medium;
122-
}
123-
}
124-
125-
.consolidated-stats-card__popover-content.is-core-styles {
126-
@include body-medium;
127-
}
128-
129-
// End of core styles

client/a8c-for-agencies/components/step-section-item/index.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ interface StepSectionItemProps {
2020
iconClassName?: string;
2121
isNewLayout?: boolean;
2222
stepNumber?: number;
23-
applyCoreStyles?: boolean;
2423
}
2524

2625
export default function StepSectionItem( {
@@ -33,7 +32,6 @@ export default function StepSectionItem( {
3332
iconClassName,
3433
isNewLayout = false,
3534
stepNumber,
36-
applyCoreStyles = false,
3735
}: StepSectionItemProps ) {
3836
const status = <StatusBadge statusProps={ statusProps } />;
3937

@@ -48,9 +46,7 @@ export default function StepSectionItem( {
4846
);
4947

5048
return (
51-
<div
52-
className={ clsx( 'step-section-item', className, { 'is-core-styles': applyCoreStyles } ) }
53-
>
49+
<div className={ clsx( 'step-section-item', className ) }>
5450
{ icon && (
5551
<div className={ clsx( 'step-section-item__icon', iconClassName ) }>
5652
<Icon className="sidebar__menu-icon" icon={ icon } size={ ICON_SIZE } />

client/a8c-for-agencies/components/step-section-item/style.scss

+2-14
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
}
2323

2424
.step-section-item__heading {
25-
font-size: rem(16px);
26-
font-weight: 500;
25+
@include heading-medium;
2726
}
2827

2928
.step-section-item__description {
3029
margin-block-start: 4px;
31-
font-size: rem(14px);
32-
line-height: 1.7;
30+
@include body-medium;
3331
color: var(--color-accent);
3432
}
3533

@@ -48,16 +46,6 @@
4846
}
4947
}
5048
}
51-
52-
&.is-core-styles {
53-
.step-section-item__heading {
54-
@include heading-medium;
55-
}
56-
57-
.step-section-item__description {
58-
@include body-medium;
59-
}
60-
}
6149
}
6250

6351
.step-section-item__status {

client/a8c-for-agencies/components/step-section/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ interface StepSectionProps {
88
stepCount?: number;
99
children: React.ReactNode;
1010
className?: string;
11-
applyCoreStyles?: boolean;
1211
}
1312

1413
export default function StepSection( {
1514
stepCount,
1615
heading,
1716
children,
1817
className,
19-
applyCoreStyles = false,
2018
}: StepSectionProps ) {
2119
return (
22-
<div className={ clsx( 'step-section', className, { 'is-core-styles': applyCoreStyles } ) }>
20+
<div className={ clsx( 'step-section', className ) }>
2321
<div className="step-section__header">
2422
{ !! stepCount && <div className="step-section__step-count">{ stepCount }</div> }
2523
<div className="step-section__step-heading">{ heading }</div>

client/a8c-for-agencies/components/step-section/style.scss

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import "@wordpress/base-styles/breakpoints";
22
@import "@wordpress/base-styles/mixins";
33
@import "@wordpress/base-styles/variables";
4+
45
.step-section {
56
.step-section__header {
67
display: flex;
@@ -16,25 +17,17 @@
1617
display: flex;
1718
justify-content: center;
1819
align-items: center;
19-
font-size: rem(12px);
20-
font-weight: 600;
20+
@include heading-small;
2121
background: var(--color-primary-50);
2222
width: 24px;
2323
border-radius: 50%;
2424
height: 24px;
2525
color: var(--color-text-inverted);
2626
}
2727

28-
.step-section__step-heading {
29-
font-size: rem(20px);
30-
font-weight: 600;
31-
text-wrap: pretty;
32-
}
33-
}
34-
35-
&.is-core-styles {
3628
.step-section__step-heading {
3729
@include heading-large;
30+
text-wrap: pretty;
3831
}
3932
}
4033
}

client/a8c-for-agencies/sections/migrations/primary/migrations-commissions/empty-state.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ export default function MigrationsCommissionsEmptyState( {
2525
const a4aPluginUrl = 'https://wordpress.org/plugins/automattic-for-agencies-client';
2626

2727
return (
28-
<StepSection
29-
applyCoreStyles
30-
heading={ translate( 'View your migrated websites and commisions right here.' ) }
31-
>
28+
<StepSection heading={ translate( 'View your migrated websites and commisions right here.' ) }>
3229
<StepSectionItem
33-
applyCoreStyles
3430
isNewLayout
3531
heading={ translate( "We'll tag the sites we moved for you once they're transferred." ) }
3632
description={ preventWidows(
@@ -41,7 +37,6 @@ export default function MigrationsCommissionsEmptyState( {
4137
/>
4238
<StepSectionItem
4339
isNewLayout
44-
applyCoreStyles
4540
heading={ translate( 'Tag your transferred sites so we can pay you for them.' ) }
4641
description={
4742
<>

client/a8c-for-agencies/sections/partner-directory/dashboard/index.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ const PartnerDirectoryDashboard = () => {
212212

213213
const programLinks = (
214214
<StepSection
215-
applyCoreStyles
216215
className="partner-directory-dashboard__learn-more-section"
217216
heading={ translate( 'Learn more about the program' ) }
218217
>
@@ -291,7 +290,6 @@ const PartnerDirectoryDashboard = () => {
291290

292291
return (
293292
<StepSectionItem
294-
applyCoreStyles
295293
key={ application.brand }
296294
isNewLayout
297295
iconClassName={ clsx( brandMeta.className ) }
@@ -302,7 +300,6 @@ const PartnerDirectoryDashboard = () => {
302300
);
303301
} ) }
304302
<StepSection
305-
applyCoreStyles
306303
className="partner-directory-dashboard__edit-section"
307304
heading={ translate( "Edit your agency's information" ) }
308305
>
@@ -344,9 +341,8 @@ const PartnerDirectoryDashboard = () => {
344341
'List your agency in our partner directories. Showcase your skills, attract clients, and grow your business.'
345342
) }
346343
</div>
347-
<StepSection applyCoreStyles heading={ translate( 'How do I start?' ) }>
344+
<StepSection heading={ translate( 'How do I start?' ) }>
348345
<StepSectionItem
349-
applyCoreStyles
350346
isNewLayout
351347
className={
352348
currentApplicationStep > 0 ? 'partner-directory-dashboard__checked-step' : ''
@@ -392,7 +388,6 @@ const PartnerDirectoryDashboard = () => {
392388
} }
393389
/>
394390
<StepSectionItem
395-
applyCoreStyles
396391
isNewLayout
397392
className={
398393
currentApplicationStep > 1 ? 'partner-directory-dashboard__checked-step' : ''
@@ -413,7 +408,6 @@ const PartnerDirectoryDashboard = () => {
413408
} }
414409
/>
415410
<StepSectionItem
416-
applyCoreStyles
417411
isNewLayout
418412
stepNumber={ currentApplicationStep > 2 ? undefined : 3 }
419413
icon={ currentApplicationStep > 2 ? check : undefined }

client/a8c-for-agencies/sections/referrals/consolidated-view/index.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
2929
<ConsolidatedStatsGroup className="consolidated-view">
3030
{ totalPayouts !== undefined && (
3131
<ConsolidatedStatsCard
32-
applyCoreStyles
3332
value={ formatCurrency( totalPayouts, 'USD' ) }
3433
footerText={ translate( 'All time referral payouts' ) }
3534
popoverTitle={ translate( 'Total payouts' ) }
@@ -46,7 +45,6 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
4645
/>
4746
) }
4847
<ConsolidatedStatsCard
49-
applyCoreStyles
5048
value={ formatCurrency( expectedCommission, 'USD' ) }
5149
footerText={ translate( 'Next estimated payout amount' ) }
5250
popoverTitle={ translate( 'Estimated amount' ) }
@@ -70,7 +68,6 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
7068
isLoading={ isFetching }
7169
/>
7270
<ConsolidatedStatsCard
73-
applyCoreStyles
7471
value={ nextPayoutDate + '*' }
7572
footerText={ translate( 'Next estimated payout date' ) }
7673
popoverTitle={ translate( 'Estimated date' ) }
@@ -87,7 +84,6 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
8784
) }
8885
/>
8986
<ConsolidatedStatsCard
90-
applyCoreStyles
9187
value={ pendingOrders }
9288
footerText={ translate( 'Pending referral orders' ) }
9389
popoverTitle={ translate( 'Pending orders' ) }

client/a8c-for-agencies/sections/referrals/primary/commission-overview/index.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default function CommissionOverview( {
9999
</>
100100
) }
101101
<div className="commission-overview__section-container">
102-
<StepSection applyCoreStyles heading={ translate( 'How much can I earn?' ) }>
102+
<StepSection heading={ translate( 'How much can I earn?' ) }>
103103
<FoldableCard
104104
header={
105105
<>
@@ -181,10 +181,7 @@ export default function CommissionOverview( {
181181
</FoldableCard>
182182
</StepSection>
183183

184-
<StepSection
185-
applyCoreStyles
186-
heading={ translate( 'Eligibility requirements and terms of use?' ) }
187-
>
184+
<StepSection heading={ translate( 'Eligibility requirements and terms of use?' ) }>
188185
<FoldableCard
189186
header={ translate( 'Active referrals' ) }
190187
expanded

client/a8c-for-agencies/sections/referrals/primary/referrals-overview/layout-body-content.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,13 @@ export default function LayoutBodyContent( {
213213
<>
214214
{ ! isAutomatedReferral && <MigrationOffer /> }
215215
<StepSection
216-
applyCoreStyles
217216
heading={
218217
isAutomatedReferral
219218
? translate( 'How do I start?' )
220219
: translate( 'How do I get started?' )
221220
}
222221
>
223222
<StepSectionItem
224-
applyCoreStyles
225223
isNewLayout={ isAutomatedReferral }
226224
icon={ tipaltiLogo }
227225
heading={
@@ -268,7 +266,6 @@ export default function LayoutBodyContent( {
268266
/>
269267
{ isAutomatedReferral ? (
270268
<StepSectionItem
271-
applyCoreStyles
272269
iconClassName="referrals-overview__opacity-70-percent"
273270
isNewLayout
274271
icon={ reusableBlock }
@@ -285,7 +282,6 @@ export default function LayoutBodyContent( {
285282
/>
286283
) : (
287284
<StepSectionItem
288-
applyCoreStyles
289285
iconClassName="referrals-overview__opacity-70-percent"
290286
icon={ plugins }
291287
heading={ translate( 'Verify your relationship with your clients' ) }
@@ -301,7 +297,6 @@ export default function LayoutBodyContent( {
301297
/>
302298
) }
303299
<StepSectionItem
304-
applyCoreStyles
305300
isNewLayout={ isAutomatedReferral }
306301
className="referrals-overview__step-section-woo-payments"
307302
icon={ <WooLogo /> }
@@ -343,7 +338,6 @@ export default function LayoutBodyContent( {
343338
</StepSection>
344339
{ isAutomatedReferral && (
345340
<StepSection
346-
applyCoreStyles
347341
className="referrals-overview__step-section-learn-more"
348342
heading={ translate( 'Find out more' ) }
349343
>

client/a8c-for-agencies/sections/team/primary/get-started/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ export default function GetStarted() {
5858
) }
5959
</div>
6060

61-
<StepSection applyCoreStyles heading={ translate( 'How do I start?' ) }>
61+
<StepSection heading={ translate( 'How do I start?' ) }>
6262
<StepSectionItem
63-
applyCoreStyles
6463
isNewLayout
6564
stepNumber={ 1 }
6665
heading={ translate( 'Invite a team member' ) }
@@ -88,7 +87,7 @@ export default function GetStarted() {
8887
/>
8988
</StepSection>
9089

91-
<StepSection applyCoreStyles heading={ translate( 'Learn more about team members' ) }>
90+
<StepSection heading={ translate( 'Learn more about team members' ) }>
9291
<Button
9392
className="team-list-get-started__learn-more-button"
9493
variant="link"

0 commit comments

Comments
 (0)