-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Domain management: Register Add/Edit DNS record paths (#97792)
* Domain management: Register 'Add new DNS record' path * Create custom header * Add dns record screen, adapt styling * Support edit DNS record * Fix constant name typo * Configure subpage header override * Update title for Edit DNS context * Update title style * Fix typo * Update tests * Merge add/edit dns record file into one
- Loading branch information
Showing
9 changed files
with
206 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...y-sites/domains/domain-management/subpage-wrapper/headers/custom-header-component-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export type CustomHeaderComponentType = React.ComponentType< { | ||
selectedDomainName: string; | ||
selectedSiteSlug: string; | ||
context?: string; | ||
} >; |
59 changes: 59 additions & 0 deletions
59
client/my-sites/domains/domain-management/subpage-wrapper/headers/dns-record-header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { localizeUrl } from '@automattic/i18n-utils'; | ||
import { translate } from 'i18n-calypso'; | ||
import React from 'react'; | ||
import ExternalLink from 'calypso/components/external-link'; | ||
import NavigationHeader from 'calypso/components/navigation-header'; | ||
import { CustomHeaderComponentType } from './custom-header-component-type'; | ||
|
||
export const addDnsRecordTitle = translate( 'Add a new DNS record' ); | ||
export const editDnsRecordTitle = translate( 'Edit DNS record' ); | ||
export const addDnsRecordsSubtitle = translate( | ||
'DNS records change how your domain works. {{a}}Learn more{{/a}}.', | ||
{ | ||
components: { | ||
a: ( | ||
<ExternalLink href={ localizeUrl( 'https://wordpress.com/support/domains/custom-dns/' ) } /> | ||
), | ||
}, | ||
} | ||
); | ||
|
||
const DnsRecordHeader: CustomHeaderComponentType = ( { | ||
selectedDomainName, | ||
selectedSiteSlug, | ||
context = 'add', | ||
} ) => { | ||
return ( | ||
<NavigationHeader | ||
className="navigation-header__breadcrumb" | ||
navigationItems={ [ | ||
{ | ||
label: selectedDomainName, | ||
href: `/domains/manage/all/overview/${ selectedDomainName }/${ selectedSiteSlug }`, | ||
}, | ||
{ | ||
label: translate( 'DNS records' ), | ||
href: `/domains/manage/all/overview/${ selectedDomainName }/dns/${ selectedSiteSlug }`, | ||
}, | ||
{ | ||
label: | ||
context === 'add' | ||
? translate( 'Add a new DNS record' ) | ||
: translate( 'Edit DNS record' ), | ||
}, | ||
] } | ||
title={ translate( 'DNS records' ) } | ||
subtitle={ translate( 'DNS records change how your domain works. {a}Learn more{/a}', { | ||
components: { | ||
a: ( | ||
<ExternalLink | ||
href={ localizeUrl( 'https://wordpress.com/support/domains/custom-dns/' ) } | ||
/> | ||
), | ||
}, | ||
} ) } | ||
/> | ||
); | ||
}; | ||
|
||
export default DnsRecordHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters