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

Domain forwarding: Update DNS A name warning copy and CSS #81041

Merged
merged 3 commits into from
Aug 25, 2023
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
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