Skip to content

Commit b904d12

Browse files
authored
Merge pull request #4388 from topcoder-platform/feature-contentful
Feature contentful
2 parents 4556736 + 13bc261 commit b904d12

File tree

1 file changed

+1
-31
lines changed
  • src/shared/components/Settings/Preferences/Email

1 file changed

+1
-31
lines changed

src/shared/components/Settings/Preferences/Email/index.jsx

+1-31
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
/**
22
* Email Preferences component.
33
*/
4-
import { debounce, isEqual, map } from 'lodash';
4+
import { debounce, isEqual } from 'lodash';
55
import React from 'react';
66
import PT from 'prop-types';
77

88
import ConsentComponent from 'components/Settings/ConsentComponent';
9-
import ToggleableItem from 'components/Settings/ToggleableItem';
109

1110
import './styles.scss';
1211

1312
const SAVE_DELAY = 1000;
14-
const newsletters = [
15-
{
16-
id: 'TOPCODER_NL_GEN',
17-
name: 'General Newsletter',
18-
desc: 'News summary from Topcoder',
19-
},
20-
];
2113

2214
export default class EmailPreferences extends ConsentComponent {
2315
saveEmailPreferences = debounce(() => {
@@ -85,33 +77,11 @@ export default class EmailPreferences extends ConsentComponent {
8577
}
8678

8779
render() {
88-
const { profileState: { emailPreferences } } = this.props;
8980
return (
9081
<div styleName="EmailPreferences">
9182
<h1 styleName="title">
9283
E-Mail Preferences
9384
</h1>
94-
<div styleName="preferences-container">
95-
{
96-
this.shouldRenderConsent() && this.renderConsent()
97-
}
98-
{
99-
map(newsletters, (newsletter) => {
100-
const checked = emailPreferences ? emailPreferences[newsletter.id] : false;
101-
return (
102-
<ToggleableItem
103-
key={newsletter.id}
104-
id={newsletter.id}
105-
value={newsletter.id}
106-
checked={checked}
107-
primaryText={newsletter.name}
108-
secondaryText={newsletter.desc}
109-
onToggle={e => this.onHandleChange(newsletter.id, e.target.checked)}
110-
/>
111-
);
112-
})
113-
}
114-
</div>
11585
</div>
11686
);
11787
}

0 commit comments

Comments
 (0)