Skip to content

Commit

Permalink
Adds gravatar wont load notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Partridge committed Feb 5, 2025
1 parent 5115592 commit c0aeea5
Showing 1 changed file with 39 additions and 21 deletions.
60 changes: 39 additions & 21 deletions client/my-sites/domains/domain-management/dns/dns-records.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class DnsRecords extends Component {
subtitleOverride: PropTypes.string,
};

getSelectedDomain = () => {
const { domains, selectedDomainName } = this.props;
return domains?.find( ( domain ) => domain?.name === selectedDomainName );
};

hasDefaultCnameRecord = () => {
const { dns, selectedDomainName } = this.props;
return dns?.records?.some(
Expand Down Expand Up @@ -98,13 +103,14 @@ class DnsRecords extends Component {
};

renderHeader = () => {
const { domains, translate, selectedSite, currentRoute, selectedDomainName, dns } = this.props;
const { translate, selectedSite, currentRoute, selectedDomainName, dns } = this.props;
const {
showBreadcrumb = true,
titleOverride,
subtitleOverride,
} = this.props.context?.params || {};
const selectedDomain = domains?.find( ( domain ) => domain?.name === selectedDomainName );

const selectedDomain = this.getSelectedDomain();

const items = [
{
Expand Down Expand Up @@ -198,6 +204,7 @@ class DnsRecords extends Component {

renderDefaultARecordsNotice = () => {
const { translate } = this.props;
const selectedDomain = this.getSelectedDomain();

if ( ! this.hasWpcomNameservers() ) {
return null;
Expand All @@ -207,6 +214,29 @@ class DnsRecords extends Component {
return null;
}

let translatedMessage = translate(
'Your domain is not using default A records. This means it may not be pointing to your WordPress.com site correctly. To restore default A records, click on the three dots menu and select "Restore default A records". {{defaultRecordsLink}}Learn more{{/defaultRecordsLink}}.',
{
components: {
defaultRecordsLink: (
<InlineSupportLink supportContext="dns_default_records" showIcon={ false } />
),
},
}
);
if ( selectedDomain?.isGravatarDomain ) {
translatedMessage = translate(
'Your domain is not using default A records. This means it may not be pointing to your Gravatar Profile correctly. To restore default A records, click on the three dots menu and select "Restore default A records". {{defaultRecordsLink}}Learn more{{/defaultRecordsLink}}.',
{
components: {
defaultRecordsLink: (
<InlineSupportLink supportContext="dns_default_records" showIcon={ false } />
),
},
}
);
}

return (
<div className="dns-records-notice">
<Icon
Expand All @@ -215,18 +245,7 @@ class DnsRecords extends Component {
className="dns-records-notice__icon gridicon"
viewBox="2 2 20 20"
/>
<div className="dns-records-notice__message">
{ translate(
'Your domain is not using default A records. This means it may not be pointing to your WordPress.com site correctly. To restore default A records, click on the three dots menu and select "Restore default A records". {{defaultRecordsLink}}Learn more{{/defaultRecordsLink}}.',
{
components: {
defaultRecordsLink: (
<InlineSupportLink supportContext="dns_default_records" showIcon={ false } />
),
},
}
) }
</div>
<div className="dns-records-notice__message">{ translatedMessage }</div>
</div>
);
};
Expand Down Expand Up @@ -267,8 +286,7 @@ class DnsRecords extends Component {
};

renderExternalNameserversNotice = () => {
const { translate, selectedSite, currentRoute, selectedDomainName, nameservers, domains } =
this.props;
const { translate, selectedSite, currentRoute, selectedDomainName, nameservers } = this.props;

if (
( ! englishLocales.includes( getLocaleSlug() ) &&
Expand All @@ -282,7 +300,7 @@ class DnsRecords extends Component {
return null;
}

const selectedDomain = domains?.find( ( domain ) => domain?.name === selectedDomainName );
const selectedDomain = this.getSelectedDomain();

let mappingSetupStep =
selectedDomain.connectionMode === modeType.ADVANCED
Expand Down Expand Up @@ -334,11 +352,11 @@ class DnsRecords extends Component {
);
};

renderMain() {
const { dns, selectedDomainName, selectedSite, translate, domains } = this.props;
renderMain = () => {
const { dns, selectedDomainName, selectedSite, translate } = this.props;
const { showDetails = true } = this.props.context?.params || {};
const selectedDomain = domains?.find( ( domain ) => domain?.name === selectedDomainName );
const headerText = translate( 'DNS Records' );
const selectedDomain = this.getSelectedDomain();

return (
<Main wideLayout className="dns-records">
Expand All @@ -364,7 +382,7 @@ class DnsRecords extends Component {
) }
</Main>
);
}
};

render() {
const { showPlaceholder, selectedDomainName } = this.props;
Expand Down

0 comments on commit c0aeea5

Please sign in to comment.