Skip to content

Commit 07be5e7

Browse files
committed
Replace isGravatarDomain checks by isGravatarRestrictedDomain checks where applicable
1 parent fa1ad13 commit 07be5e7

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

Diff for: client/me/purchases/cancel-purchase/refund-information.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import {
1313
} from 'calypso/lib/purchases';
1414
import { getDomainsBySiteId } from 'calypso/state/sites/domains/selectors';
1515

16-
const CancelPurchaseRefundInformation = ( { purchase, isGravatarDomain, isJetpackPurchase } ) => {
16+
const CancelPurchaseRefundInformation = ( {
17+
purchase,
18+
isGravatarRestrictedDomain,
19+
isJetpackPurchase,
20+
} ) => {
1721
const { refundPeriodInDays } = purchase;
1822
let text;
1923

@@ -93,7 +97,7 @@ const CancelPurchaseRefundInformation = ( { purchase, isGravatarDomain, isJetpac
9397
),
9498
];
9599

96-
if ( isGravatarDomain ) {
100+
if ( isGravatarRestrictedDomain ) {
97101
text.push(
98102
i18n.translate(
99103
'This domain is provided at no cost for the first year for use with your Gravatar profile. This offer is limited to one free domain per user. If you cancel this domain, you will have to pay the standard price to register another domain for your Gravatar profile.'
@@ -145,6 +149,6 @@ export default connect( ( state, props ) => {
145149
const selectedDomain = getSelectedDomain( { domains, selectedDomainName } );
146150

147151
return {
148-
isGravatarDomain: selectedDomain?.isGravatarDomain,
152+
isGravatarRestrictedDomain: selectedDomain?.isGravatarRestrictedDomain,
149153
};
150154
} )( CancelPurchaseRefundInformation );

Diff for: client/me/purchases/remove-purchase/remove-domain-dialog/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RemoveDomainDialog extends Component {
3030
};
3131

3232
renderDomainDeletionWarning( productName ) {
33-
const { translate, slug, currentRoute, isGravatarDomain } = this.props;
33+
const { translate, slug, currentRoute, isGravatarRestrictedDomain } = this.props;
3434

3535
return (
3636
<Fragment>
@@ -39,7 +39,7 @@ class RemoveDomainDialog extends Component {
3939
'Deleting a domain will make all services connected to it unreachable, including your email and website. It will also make the domain available for someone else to register.'
4040
) }
4141
</p>
42-
{ isGravatarDomain && (
42+
{ isGravatarRestrictedDomain && (
4343
<p>
4444
{ translate(
4545
'This domain is provided at no cost for the first year for use with your Gravatar profile. This offer is limited to one free domain per user. If you cancel this domain, you will have to pay the standard price to register another domain for your Gravatar profile.'
@@ -239,7 +239,7 @@ export default connect( ( state, ownProps ) => {
239239
const selectedDomainName = getName( ownProps.purchase );
240240
const selectedDomain = getSelectedDomain( { domains, selectedDomainName } );
241241
return {
242-
isGravatarDomain: selectedDomain?.isGravatarDomain,
242+
isGravatarRestrictedDomain: selectedDomain?.isGravatarRestrictedDomain,
243243
hasTitanWithUs: hasTitanMailWithUs( selectedDomain ),
244244
currentRoute: getCurrentRoute( state ),
245245
userEmail: getCurrentUserEmail( state ),

Diff for: client/my-sites/domains/domain-management/settings/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const Settings = ( {
186186
if (
187187
! ( domain && selectedSite?.options?.is_domain_only ) ||
188188
domain?.type === domainTypes.TRANSFER ||
189-
domain?.isGravatarDomain
189+
domain?.isGravatarRestrictedDomain
190190
) {
191191
return null;
192192
}
@@ -324,7 +324,7 @@ const Settings = ( {
324324
};
325325

326326
const renderNameServersSection = () => {
327-
if ( ! domain || domain.type !== domainTypes.REGISTERED || domain.isGravatarDomain ) {
327+
if ( ! domain || domain.type !== domainTypes.REGISTERED || domain.isGravatarRestrictedDomain ) {
328328
return null;
329329
}
330330

@@ -772,7 +772,7 @@ const Settings = ( {
772772
}
773773
return (
774774
<>
775-
{ ! domain.isGravatarDomain && (
775+
{ ! domain.isGravatarRestrictedDomain && (
776776
<DomainEmailInfoCard selectedSite={ selectedSite } domain={ domain } />
777777
) }
778778
{ ! domain.isHundredYearDomain && (

Diff for: client/my-sites/domains/domain-management/transfer/transfer-page/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ const TransferPage = ( props: TransferPageProps ) => {
374374
? __( 'Transfer to another registrar' )
375375
: __( 'Advanced Options' ) }
376376
</CardHeading>
377-
{ domain?.isGravatarDomain && (
377+
{ domain?.isGravatarRestrictedDomain && (
378378
<InfoNotice
379379
redesigned
380380
text={ __(

Diff for: client/my-sites/email/email-forwards-add/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ const EmailForwardsAdd = ( {
5757
const domains = useSelector( ( state ) => getDomainsBySiteId( state, selectedSite?.ID ) );
5858
const selectedDomain = getSelectedDomain( { domains, selectedDomainName } );
5959
const cannotAddEmailWarningReason = getCurrentUserCannotAddEmailReason( selectedDomain );
60-
const isGravatarDomain = cannotAddEmailWarningReason?.code === EMAIL_WARNING_CODE_GRAVATAR_DOMAIN;
60+
const isGravatarRestrictedDomain =
61+
cannotAddEmailWarningReason?.code === EMAIL_WARNING_CODE_GRAVATAR_DOMAIN;
6162

6263
const goToEmail = useCallback( (): void => {
6364
if ( ! selectedSite ) {
@@ -80,7 +81,7 @@ const EmailForwardsAdd = ( {
8081
page( getEmailManagementPath( selectedSite.slug, selectedDomainName, currentRoute ) );
8182
}, [ currentRoute, selectedDomainName, selectedSite ] );
8283

83-
const content = isGravatarDomain ? (
84+
const content = isGravatarRestrictedDomain ? (
8485
<Notice showDismiss={ false } className="email-forwards-add__notice">
8586
{ translate(
8687
'This domain is associated with a Gravatar profile and cannot be used for email services at this time.'

Diff for: client/my-sites/email/email-providers-comparison/stacked/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ const EmailProvidersStackedComparison = ( {
9999
const currentUserCanAddEmail = canCurrentUserAddEmail( domain );
100100
const showNonOwnerMessage = ! currentUserCanAddEmail && ! isDomainInCart;
101101
const cannotAddEmailWarningReason = getCurrentUserCannotAddEmailReason( domain );
102-
const isGravatarDomain = cannotAddEmailWarningReason?.code === EMAIL_WARNING_CODE_GRAVATAR_DOMAIN;
102+
const isGravatarRestrictedDomain =
103+
cannotAddEmailWarningReason?.code === EMAIL_WARNING_CODE_GRAVATAR_DOMAIN;
103104

104105
const isGSuiteSupported =
105106
domain && canPurchaseGSuite && ( isDomainInCart || hasGSuiteSupportedDomain( [ domain ] ) );
@@ -295,14 +296,14 @@ const EmailProvidersStackedComparison = ( {
295296
{ ! isDomainInCart && domain && <EmailExistingPaidServiceNotice domain={ domain } /> }
296297

297298
<>
298-
{ showNonOwnerMessage && ! isGravatarDomain && (
299+
{ showNonOwnerMessage && ! isGravatarRestrictedDomain && (
299300
<EmailNonDomainOwnerMessage
300301
domain={ domain }
301302
selectedSite={ selectedSite }
302303
source="email-comparison"
303304
/>
304305
) }
305-
{ isGravatarDomain && (
306+
{ isGravatarRestrictedDomain && (
306307
<Notice showDismiss={ false } className="email-providers-stacked-comparison__notice">
307308
{ translate(
308309
'This domain is associated with a Gravatar profile and cannot be used for email services at this time.'

0 commit comments

Comments
 (0)