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

M20-51: New Opt-in for Ghostery #444

Merged

M20-51: just for eslint phase 1

  • Loading branch information
Aleksandr Panin
Aleksandr Panin committed Aug 30, 2019
commit 8e3c4b3dfeeb92a5246c5fe46d65df9015ab9926
@@ -37,45 +37,45 @@ class Notification extends Component {
}
}

renderOptoutImage() {
return (
<div className="rewards-notification-optout-image-wrapper">
<img
src={chrome.extension.getURL('app/images/rewards/ghostery_O.png')}
/>
</div>
);
}
renderOptoutImage() {
return (
<div className="rewards-notification-optout-image-wrapper">
<img
src={chrome.extension.getURL('app/images/rewards/ghostery_O.png')}
/>
</div>
);
}

renderOptoutLink() {
return (
<a
href={this.props.data.textLink.href}
target="_blank"
rel="noopener noreferrer"
onClick={() => this.props.data.textLink.callback()}
>
{this.props.data.textLink.text}
</a>
);
}
renderOptoutLink() {
return (
<a
href={this.props.data.textLink.href}
target="_blank"
rel="noopener noreferrer"
onClick={() => this.props.data.textLink.callback()}
>
{this.props.data.textLink.text}
</a>
);
}

renderHeadline() {
return (
<div className="first-prompt-headline">New Reward Discovered!</div>
);
}
renderHeadline() {
return (
<div className="first-prompt-headline">New Reward Discovered!</div>
);
}

renderLabels() {
return (
<div className="first-prompt-labels">
<img src={chrome.extension.getURL('app/images/rewards/exclusive.svg')} />
<span className="first-prompt-label">exclusive</span>
<img src={chrome.extension.getURL('app/images/rewards/best-offer.svg')} />
<span className="first-prompt-label">top angebot</span>
</div>
);
}
renderLabels() {
return (
<div className="first-prompt-labels">
<img src={chrome.extension.getURL('app/images/rewards/exclusive.svg')} />
<span className="first-prompt-label">exclusive</span>
<img src={chrome.extension.getURL('app/images/rewards/best-offer.svg')} />
<span className="first-prompt-label">top angebot</span>
</div>
);
}

render() {
return (
@@ -85,22 +85,22 @@ class Notification extends Component {
<div className="rewards-notification-overlay" />
<div className="rewards-popup-container">
<div className={`rewards-notification ${this.props.data.type}`}>
{this.props.data.type === 'first-prompt' && this.renderOptoutImage()}
{this.props.data.type === 'first-prompt' && this.renderOptoutImage()}
{this.props.data.type !== 'first-prompt'
&& (
<div
className="close"
onClick={() => { this.closeNotification(); }}
style={{ backgroundImage: this.closeIcon }}
/>
<div
className="close"
onClick={() => { this.closeNotification(); }}
style={{ backgroundImage: this.closeIcon }}
/>
)
}
}
<div className={`notification-text ${this.props.data.type}`}>
{this.props.data.type === 'first-prompt' && this.renderLabels()}
{this.props.data.type === 'first-prompt' && this.renderHeadline()}
{this.props.data.type === 'first-prompt' && this.renderLabels()}
{this.props.data.type === 'first-prompt' && this.renderHeadline()}
{this.props.data.message}
{' '}
{this.props.data.type === 'first-prompt' && this.renderOptoutLink()}
{' '}
{this.props.data.type === 'first-prompt' && this.renderOptoutLink()}
</div>
{this.props.data.buttons && (
<div className={`notification-buttons ${this.props.data.type}`}>
@@ -169,23 +169,23 @@ class OfferCard extends Component {
}

handlePrompt(promptNumber, option) {
const reject = () => {
this.props.actions.sendSignal('offer_first_optout');
sendMessage('ping', 'rewards_first_reject_optout');
this.disableRewards();
this.closeOfferCard();
};
const reject = () => {
this.props.actions.sendSignal('offer_first_optout');
sendMessage('ping', 'rewards_first_reject_optout');
this.disableRewards();
this.closeOfferCard();
};
if (promptNumber === 1) {
if (!option) {
reject();
return;
reject();
return;
}
this.props.actions.messageBackground('rewardsPromptOptedIn');
this.props.actions.sendSignal('offer_first_optin');
sendMessage('ping', 'rewards_first_accept');
} else if (promptNumber === 2) {
if (option) {
reject();
reject();
return;
}
this.props.actions.sendSignal('offer_first_optlater');
@@ -317,22 +317,22 @@ class OfferCard extends Component {
<div className="reward-footer">
<div className="reward-feedback">
<div className="reward-smile" />
{this.props.conf.rewardsPromptAccepted &&
<a onClick={this.disableRewardsNotification}>{t('rewards_disable')}</a>
}
{this.props.conf.rewardsPromptAccepted &&
<a onClick={this.disableRewardsNotification}>{t('rewards_disable')}</a>
}
<div className="reward-arrow" />
</div>
<a
className="reward-powered-by-myoffrz"
target="_blank"
rel="noopener noreferrer"
href="https://myoffrz.com/en/fuer-nutzer/"
>
<div
className="reward-ghosty"
style={{ backgroundImage: this.poweredByMyoffrz }}
/>
</a>
<a
className="reward-powered-by-myoffrz"
target="_blank"
rel="noopener noreferrer"
href="https://myoffrz.com/en/fuer-nutzer/"
>
<div
className="reward-ghosty"
style={{ backgroundImage: this.poweredByMyoffrz }}
/>
</a>
</div>
</div>
{ this.state.showPrompt === 1 &&
ProTip! Use n and p to navigate between commits in a pull request.