Commit b71d0bf4 authored by Erica Wright's avatar Erica Wright
Browse files

Bug 1684887 - Sponsored Stories checkbox hides when appropriate. r=thecount, a=jcristau

Differential Revision: https://phabricator.services.mozilla.com/D101087
parent 50390a2d
......@@ -139,35 +139,37 @@ export class ContentSection extends React.PureComponent {
className="subtitle"
data-l10n-id="newtab-custom-pocket-subtitle"
/>
<div
className={`more-info-pocket-wrapper ${
pocketEnabled ? "" : "shrink"
}`}
>
{this.props.mayHaveSponsoredStories && (
<div
className={`more-information ${
pocketEnabled ? "expand" : "shrink"
className={`more-info-pocket-wrapper ${
pocketEnabled ? "" : "shrink"
}`}
>
<div className="check-wrapper">
<input
id="sponsored-pocket"
className="sponsored-checkbox"
disabled={!pocketEnabled}
checked={showSponsoredPocketEnabled}
type="checkbox"
onChange={this.onPreferenceSelect}
preference="showSponsored"
eventSource="POCKET_SPOCS"
/>
<label
className="sponsored"
htmlFor="sponsored-pocket"
data-l10n-id="newtab-custom-pocket-sponsored"
/>
<div
className={`more-information ${
pocketEnabled ? "expand" : "shrink"
}`}
>
<div className="check-wrapper">
<input
id="sponsored-pocket"
className="sponsored-checkbox"
disabled={!pocketEnabled}
checked={showSponsoredPocketEnabled}
type="checkbox"
onChange={this.onPreferenceSelect}
preference="showSponsored"
eventSource="POCKET_SPOCS"
/>
<label
className="sponsored"
htmlFor="sponsored-pocket"
data-l10n-id="newtab-custom-pocket-sponsored"
/>
</div>
</div>
</div>
</div>
)}
</div>
<label className="switch">
<input
......
......@@ -25,6 +25,7 @@ export class _CustomizeMenu extends React.PureComponent {
enabledSections={this.props.enabledSections}
pocketRegion={this.props.pocketRegion}
mayHaveSponsoredTopSites={this.props.mayHaveSponsoredTopSites}
mayHaveSponsoredStories={this.props.DiscoveryStream.config.show_spocs}
dispatch={this.props.dispatch}
/>
</div>
......@@ -32,6 +33,6 @@ export class _CustomizeMenu extends React.PureComponent {
}
}
export const CustomizeMenu = connect(state => state.CustomizeMenu)(
_CustomizeMenu
);
export const CustomizeMenu = connect(state => ({
DiscoveryStream: state.DiscoveryStream,
}))(_CustomizeMenu);
......@@ -14315,7 +14315,7 @@ class ContentSection_ContentSection extends external_React_default.a.PureCompone
}), external_React_default.a.createElement("p", {
className: "subtitle",
"data-l10n-id": "newtab-custom-pocket-subtitle"
}), external_React_default.a.createElement("div", {
}), this.props.mayHaveSponsoredStories && external_React_default.a.createElement("div", {
className: `more-info-pocket-wrapper ${pocketEnabled ? "" : "shrink"}`
}, external_React_default.a.createElement("div", {
className: `more-information ${pocketEnabled ? "expand" : "shrink"}`
......@@ -14420,12 +14420,15 @@ class CustomizeMenu_CustomizeMenu extends external_React_default.a.PureComponent
enabledSections: this.props.enabledSections,
pocketRegion: this.props.pocketRegion,
mayHaveSponsoredTopSites: this.props.mayHaveSponsoredTopSites,
mayHaveSponsoredStories: this.props.DiscoveryStream.config.show_spocs,
dispatch: this.props.dispatch
}));
}
 
}
const CustomizeMenu = Object(external_ReactRedux_["connect"])(state => state.CustomizeMenu)(CustomizeMenu_CustomizeMenu);
const CustomizeMenu = Object(external_ReactRedux_["connect"])(state => ({
DiscoveryStream: state.DiscoveryStream
}))(CustomizeMenu_CustomizeMenu);
 
/***/ }),
/* 72 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment