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 Management: Add onclick back for the privacy protection compact notice #1740

Merged
merged 3 commits into from
Dec 21, 2015
Merged
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,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