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: hidding cross button when show first-prompt

  • Loading branch information
Aleksandr Panin
Aleksandr Panin committed Aug 30, 2019
commit 226647bd15f418ae30752750d8d9b52f1c2d9a29
@@ -41,6 +41,7 @@ class OfferCard extends Component {
showPrompt: this.props.conf.rewardsPromptAccepted ? false : 1,
showSettings: false,
rewardUI: templateData,
shouldShowCross: this.props.conf.rewardsPromptAccepted,
};

this.iframeEl = window.parent.document.getElementById('ghostery-iframe-container');
@@ -193,7 +194,8 @@ class OfferCard extends Component {
this.closeOfferCard();
}
this.setState({
showPrompt: false
showPrompt: false,
shouldShowCross: true,
});
this.props.actions.messageBackground('rewardsPromptAccepted');
}
@@ -235,6 +237,16 @@ class OfferCard extends Component {
return t(`rewards_expires_in_${type}`, [count]);
}

renderCross() {
return (
<div
className="reward-card-close"
onClick={() => { this.props.actions.sendSignal('offer_closed_card'); this.closeOfferCard(); }}
style={{ backgroundImage: this.closeIcon }}
/>
);
}

render() {
return (
// @TODO condition for hide class
@@ -244,11 +256,7 @@ class OfferCard extends Component {
<div className="ghostery-reward-card">
<div className="reward-card-header">
<div className="rewards-logo-beta" style={{ backgroundImage: this.betaLogo }} />
<div
className="reward-card-close"
onClick={() => { this.props.actions.sendSignal('offer_closed_card'); this.closeOfferCard(); }}
style={{ backgroundImage: this.closeIcon }}
/>
{this.state.shouldShowCross && this.renderCross()}
</div>
<div className="reward-content">
<div className="reward-content-header">
@@ -39,7 +39,6 @@
.ghostery-rewards-component {
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.hide {
@@ -525,11 +524,11 @@
}
}
&:nth-child(2) {
border: 2px solid $dark-purple;
border: 1px solid $dark-purple;
background-color: transparent;
color: $dark-purple;
&:hover {
border: 2px solid $dark-purple;
border: 1px solid $dark-purple;
background-color: transparent;
color: $dark-purple;
}
ProTip! Use n and p to navigate between commits in a pull request.