Skip to content

Commit

Permalink
Merge pull request #1740 from Automattic/fix/privacy-notice-link
Browse files Browse the repository at this point in the history
Domain Management: Add onclick back for the privacy protection compact notice
  • Loading branch information
breezyskies committed Dec 21, 2015
2 parents 5d71d05 + 0a6650f commit 42d413d
Showing 1 changed file with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import page from 'page';
import React from 'react';

/**
Expand Down Expand Up @@ -42,28 +41,41 @@ const RegisteredDomain = React.createClass( {

getPrivacyProtection() {
if ( this.props.domain.hasPrivacyProtection ) {
const path = paths.domainManagementContactsPrivacy(
this.props.selectedSite.domain,
this.props.domain.name
);

return (
<Notice
isCompact
status="is-success"
icon="lock">
{ this.translate( 'On', {
context: 'An icon label when Privacy Protection is enabled.'
} ) }
</Notice>
<a href={ path }>
<Notice
isCompact
status="is-success"
icon="lock">
{ this.translate( 'On', {
context: 'An icon label when Privacy Protection is enabled.'
} ) }
</Notice>
</a>
);
}

const path = paths.domainManagementPrivacyProtection(
this.props.selectedSite.domain,
this.props.domain.name
);

return (
<Notice
isCompact
status="is-warning"
icon="notice"
onClick={ this.goToPrivacyProtection }>
{ this.translate( 'None', {
context: 'An icon label when Privacy Protection is disabled.'
} ) }
</Notice>
<a href={ path } onClick={ this.recordEvent( 'noneClick', this.props.domain ) }>
<Notice
isCompact
status="is-warning"
icon="notice">
{ this.translate( 'None', {
context: 'An icon label when Privacy Protection is disabled.'
} ) }
</Notice>
</a>
);
},

Expand Down Expand Up @@ -189,12 +201,6 @@ const RegisteredDomain = React.createClass( {
{ this.getVerticalNav() }
</div>
);
},

goToPrivacyProtection() {
this.recordEvent( 'noneClick', this.props.domain );

page( paths.domainManagementPrivacyProtection( this.props.selectedSite.domain, this.props.domain.name ) );
}
} );

Expand Down

0 comments on commit 42d413d

Please sign in to comment.