Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

100 year domain - use "Paid until" label in domains list #99113

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/data-stores/src/queries/use-all-domains-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type PartialDomainData = Pick<
| 'google_apps_subscription'
| 'has_registration'
| 'is_wpcom_staging_domain'
| 'is_hundred_year_domain'
| 'registration_date'
| 'titan_mail_subscription'
| 'tld_maintenance_end_time'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ function getNotice( {
expiryDate,
isAutoRenewing,
isExpired,
isHundredYearDomain,
}: {
isAutoRenewing: boolean;
isExpired: boolean;
expiryDate: string;
isHundredYearDomain: boolean;
} ): string {
if ( isHundredYearDomain ) {
return sprintf(
/* translators: %s - The date until which a domain was paid for */
__( 'Paid until %s' ),
expiryDate
);
}

if ( isExpired ) {
return sprintf(
/* translators: %s - The date on which a domain has expired */
Expand Down Expand Up @@ -64,15 +74,20 @@ export const DomainsTableExpiresRenewsOnCell = ( {
domain.expiry && moment( domain.expiry ).utc().isBefore( moment().utc() )
);

const isHundredYearDomain = Boolean( domain.is_hundred_year_domain );

return (
<Element data-testid="expires-renews-on" className="domains-table-row__renews-on-cell">
{ expiryDate ? (
<>
{ ! isCompact && (
<Gridicon icon={ isExpired ? 'notice-outline' : 'reblog' } size={ 18 } />
<Gridicon
icon={ isExpired || isHundredYearDomain ? 'notice-outline' : 'reblog' }
size={ 18 }
/>
) }

{ getNotice( { expiryDate, isAutoRenewing, isExpired } ) }
{ getNotice( { expiryDate, isAutoRenewing, isExpired, isHundredYearDomain } ) }
</>
) : (
'-'
Expand Down
1 change: 1 addition & 0 deletions packages/domains-table/src/test-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function testDomain(
blog_id: 113,
type: 'mapping',
is_wpcom_staging_domain: false,
is_hundred_year_domain: false,
has_registration: true,
registration_date: '2020-03-11T22:23:58+00:00',
expiry: '2026-03-11T00:00:00+00:00',
Expand Down