Skip to content

Commit

Permalink
Domain forwarding: Update DNS A name warning copy and CSS (#81041)
Browse files Browse the repository at this point in the history
* Update copy and CSS

* Use old translation until the new copy is translated

* Added mobile css fix for warning message

---------

Co-authored-by: Paulo Trentin <paulo@paulotrentin.com.br>
  • Loading branch information
DustyReagan and paulopmt1 authored Aug 25, 2023
1 parent 4c32338 commit ca3c7af
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, FormInputValidation } from '@automattic/components';
import { localizeUrl } from '@automattic/i18n-utils';
import { localizeUrl, useIsEnglishLocale } from '@automattic/i18n-utils';
import { hasTranslation } from '@wordpress/i18n';
import { Icon, trash, info } from '@wordpress/icons';
import classNames from 'classnames';
import { useTranslate } from 'i18n-calypso';
Expand Down Expand Up @@ -33,6 +34,7 @@ const noticeOptions = {
export default function DomainForwardingCard( { domain }: { domain: ResponseDomain } ) {
const dispatch = useDispatch();
const translate = useTranslate();
const isEnglishLocale = useIsEnglishLocale();

const { data: forwarding, isLoading, isError } = useDomainForwardingQuery( domain.name );

Expand Down Expand Up @@ -203,14 +205,35 @@ export default function DomainForwardingCard( { domain }: { domain: ResponseDoma
return null;
}

const noticeText = translate(
'Connect your domain to WordPress.com to enable domain forwarding. {{a}}Learn more{{/a}}.',
{
components: {
a: <a href={ localizeUrl( MAP_EXISTING_DOMAIN ) } />,
},
}
);
const newNoticeText =
'To enable domain forwarding please "restore default A records." {{a}}Learn more{{/a}}.';

let noticeText;
if ( hasTranslation( newNoticeText ) || isEnglishLocale ) {
noticeText = translate(
'To enable domain forwarding please "restore default A records." {{a}}Learn more{{/a}}.',
{
components: {
a: (
<a
href={ localizeUrl(
'https://wordpress.com/support/domains/custom-dns/#default-records'
) }
/>
),
},
}
);
} else {
noticeText = translate(
'Connect your domain to WordPress.com to enable domain forwarding. {{a}}Learn more{{/a}}.',
{
components: {
a: <a href={ localizeUrl( MAP_EXISTING_DOMAIN ) } />,
},
}
);
}

return (
<div className="domain-forwarding-card-notice">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@
}

.domain-forwarding-card-notice {
margin-bottom: 16px;
margin: 0 16px 16px;

@include break-mobile {
margin: 0 24px 16px 24px;
}
}

.site-redirect-card__explanation,
Expand Down

0 comments on commit ca3c7af

Please sign in to comment.