File tree 1 file changed +1
-31
lines changed
src/shared/components/Settings/Preferences/Email
1 file changed +1
-31
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* Email Preferences component.
3
3
*/
4
- import { debounce , isEqual , map } from 'lodash' ;
4
+ import { debounce , isEqual } from 'lodash' ;
5
5
import React from 'react' ;
6
6
import PT from 'prop-types' ;
7
7
8
8
import ConsentComponent from 'components/Settings/ConsentComponent' ;
9
- import ToggleableItem from 'components/Settings/ToggleableItem' ;
10
9
11
10
import './styles.scss' ;
12
11
13
12
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
- ] ;
21
13
22
14
export default class EmailPreferences extends ConsentComponent {
23
15
saveEmailPreferences = debounce ( ( ) => {
@@ -85,33 +77,11 @@ export default class EmailPreferences extends ConsentComponent {
85
77
}
86
78
87
79
render ( ) {
88
- const { profileState : { emailPreferences } } = this . props ;
89
80
return (
90
81
< div styleName = "EmailPreferences" >
91
82
< h1 styleName = "title" >
92
83
E-Mail Preferences
93
84
</ 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 >
115
85
</ div >
116
86
) ;
117
87
}
You can’t perform that action at this time.
0 commit comments