11import { recordTracksEvent } from '@automattic/calypso-analytics' ;
2- import config from '@automattic/calypso-config' ;
32import { Button , Gridicon } from '@automattic/components' ;
43import { localize } from 'i18n-calypso' ;
54import page from 'page' ;
@@ -21,12 +20,10 @@ class AddDomainButton extends Component {
2120 static propTypes = {
2221 selectedSiteSlug : PropTypes . string ,
2322 specificSiteActions : PropTypes . bool ,
24- ellipsisButton : PropTypes . bool ,
2523 } ;
2624
2725 static defaultProps = {
2826 specificSiteActions : false ,
29- ellipsisButton : false ,
3027 } ;
3128
3229 state = {
@@ -64,10 +61,10 @@ class AddDomainButton extends Component {
6461 const useYourDomainUrl = domainUseMyDomain ( this . props . selectedSiteSlug ) ;
6562 return (
6663 < Fragment >
67- < PopoverMenuItem icon = "search" onClick = { this . clickAddDomain } >
64+ < PopoverMenuItem onClick = { this . clickAddDomain } >
6865 { translate ( 'Search for a domain' ) }
6966 </ PopoverMenuItem >
70- < PopoverMenuItem icon = "domains" href = { useYourDomainUrl } onClick = { this . trackMenuClick } >
67+ < PopoverMenuItem href = { useYourDomainUrl } onClick = { this . trackMenuClick } >
7168 { translate ( 'Use a domain I own' ) }
7269 </ PopoverMenuItem >
7370 </ Fragment >
@@ -76,66 +73,40 @@ class AddDomainButton extends Component {
7673
7774 return (
7875 < Fragment >
79- { ! config . isEnabled ( 'domains/management-list-redesign' ) && (
80- < PopoverMenuItem href = { domainManagementAllRoot ( ) } onClick = { this . trackMenuClick } >
81- { translate ( 'Manage all domains' ) }
82- </ PopoverMenuItem >
83- ) }
84- < PopoverMenuItem icon = "plus" href = "/new" onClick = { this . trackMenuClick } >
76+ < PopoverMenuItem href = { domainManagementAllRoot ( ) } onClick = { this . trackMenuClick } >
77+ { translate ( 'Manage all domains' ) }
78+ </ PopoverMenuItem >
79+ < PopoverMenuItem href = "/new" onClick = { this . trackMenuClick } >
8580 { translate ( 'Add a domain to a new site' ) }
8681 </ PopoverMenuItem >
87- < PopoverMenuItem icon = "create" href = "/domains/add" onClick = { this . trackMenuClick } >
82+ < PopoverMenuItem href = "/domains/add" onClick = { this . trackMenuClick } >
8883 { translate ( 'Add a domain to a different site' ) }
8984 </ PopoverMenuItem >
90- < PopoverMenuItem icon = "domains" href = "/start/domain" onClick = { this . trackMenuClick } >
85+ < PopoverMenuItem href = "/start/domain" onClick = { this . trackMenuClick } >
9186 { translate ( 'Add a domain without a site' ) }
9287 </ PopoverMenuItem >
9388 </ Fragment >
9489 ) ;
9590 } ;
9691
97- getDesktopViewLabel ( ) {
92+ render ( ) {
9893 const { translate } = this . props ;
9994
100- if ( this . props . ellipsisButton ) {
101- return < Gridicon icon = "ellipsis" className = "options-domain-button__ellipsis" /> ;
102- }
103-
104- if ( this . props . specificSiteActions ) {
105- if ( config . isEnabled ( 'domains/management-list-redesign' ) ) {
106- return translate ( 'Add a domain' ) ;
107- }
108- return translate ( 'Add a domain to this site' ) ;
109- }
110- return translate ( 'Other domain options' ) ;
111- }
112-
113- render ( ) {
114- const { specificSiteActions, ellipsisButton } = this . props ;
95+ const label = this . props . specificSiteActions
96+ ? translate ( 'Add a domain to this site' )
97+ : translate ( 'Other domain options' ) ;
11598
11699 return (
117100 < Fragment >
118101 < Button
119- primary = { specificSiteActions }
102+ primary = { this . props . specificSiteActions }
120103 compact
121104 className = "options-domain-button"
122105 onClick = { this . toggleAddMenu }
123106 ref = { this . addDomainButtonRef }
124107 >
125- { this . getDesktopViewLabel ( ) }
126- { ! ellipsisButton && < Gridicon icon = "chevron-down" /> }
127- </ Button >
128- < Button
129- primary = { specificSiteActions }
130- className = "options-domain-button options-domain-button__mobile"
131- onClick = { this . toggleAddMenu }
132- ref = { this . addDomainButtonRef }
133- borderless = { ellipsisButton }
134- >
135- { ! ellipsisButton && < Gridicon icon = "plus" /> }
136- { ellipsisButton && (
137- < Gridicon icon = "ellipsis" className = "options-domain-button__ellipsis" />
138- ) }
108+ { label }
109+ < Gridicon icon = "chevron-down" />
139110 </ Button >
140111 < PopoverMenu
141112 className = "options-domain-button__popover"
0 commit comments