-
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.
Merge add/edit dns record file into one
- Loading branch information
Showing
6 changed files
with
77 additions
and
115 deletions.
There are no files selected for viewing
51 changes: 0 additions & 51 deletions
51
client/my-sites/domains/domain-management/subpage-wrapper/headers/add-dns-record-header.tsx
This file was deleted.
Oops, something went wrong.
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; |
51 changes: 0 additions & 51 deletions
51
client/my-sites/domains/domain-management/subpage-wrapper/headers/edit-dns-record-header.tsx
This file was deleted.
Oops, something went wrong.
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