[Rewards] Hide empty recurring contributions card (#27794)
This commit is contained in:
@@ -247,7 +247,6 @@ static constexpr webui::LocalizedString kStrings[] = {
|
||||
{"payoutPendingText", IDS_REWARDS_PAYMENT_PENDING},
|
||||
{"payoutProcessingText", IDS_REWARDS_PAYMENT_PROCESSING},
|
||||
{"payoutSupportLink", IDS_REWARDS_PAYMENT_SUPPORT},
|
||||
{"recurringListEmptyText", IDS_REWARDS_RECURRING_LIST_EMPTY_TEXT},
|
||||
{"recurringNextContributionLabel",
|
||||
IDS_REWARDS_RECURRING_NEXT_CONTRIBUTION_LABEL},
|
||||
{"recurringTitle", IDS_REWARDS_RECURRING_TITLE},
|
||||
|
||||
+4
@@ -11,6 +11,10 @@ export const style = scoped.css`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
@container style(--is-wide-view) {
|
||||
gap: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
|
||||
-6
@@ -99,12 +99,6 @@ export const style = scoped.css`
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 24px 0;
|
||||
text-align: center;
|
||||
color: ${color.text.secondary};
|
||||
}
|
||||
|
||||
.show-all {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
+4
-4
@@ -92,10 +92,6 @@ export function RecurringContributionCard() {
|
||||
}
|
||||
|
||||
function renderList() {
|
||||
if (contributions.length === 0) {
|
||||
return <p className='empty'>{getString('recurringListEmptyText')}</p>
|
||||
}
|
||||
|
||||
const topEntries = [...contributions]
|
||||
.sort((a, b) => a.nextContributionDate - b.nextContributionDate)
|
||||
.slice(0, showAll ? Infinity : 5)
|
||||
@@ -119,6 +115,10 @@ export function RecurringContributionCard() {
|
||||
return null
|
||||
}
|
||||
|
||||
if (contributions.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='content-card' {...style}>
|
||||
<h4>{getString('recurringTitle')}</h4>
|
||||
|
||||
@@ -173,7 +173,6 @@ export type StringKey =
|
||||
'payoutPendingText' |
|
||||
'payoutProcessingText' |
|
||||
'payoutSupportLink' |
|
||||
'recurringListEmptyText' |
|
||||
'recurringNextContributionLabel' |
|
||||
'recurringTitle' |
|
||||
'removeButtonLabel' |
|
||||
|
||||
@@ -171,7 +171,6 @@ export const localeStrings: { [K in StringKey]: string } = {
|
||||
payoutPendingText: 'The payout for $1 rewards will begin processing by $2.',
|
||||
payoutProcessingText: 'The payout for $1 rewards is in progress.',
|
||||
payoutSupportLink: 'Support',
|
||||
recurringListEmptyText: 'You don\'t have any recurring contributions set up yet.',
|
||||
recurringNextContributionLabel: 'Next contribution:',
|
||||
recurringTitle: 'Recurring Contributions',
|
||||
removeButtonLabel: 'Remove',
|
||||
|
||||
@@ -825,9 +825,6 @@
|
||||
<message name="IDS_REWARDS_BENEFITS_TITLE" desc="">
|
||||
Your benefits
|
||||
</message>
|
||||
<message name="IDS_REWARDS_RECURRING_LIST_EMPTY_TEXT" desc="">
|
||||
You don't have any recurring contributions set up yet.
|
||||
</message>
|
||||
<message name="IDS_REWARDS_RECURRING_NEXT_CONTRIBUTION_LABEL" desc="">
|
||||
Next contribution:
|
||||
</message>
|
||||
|
||||
Reference in New Issue
Block a user