Skip to content

Commit 19723e4

Browse files
Merge pull request #8 from dimGlyn/feature/unsubscribe-from-all
#7/unsubscribe from all channels functionality
2 parents 89bab96 + 87b7e11 commit 19723e4

4 files changed

Lines changed: 58 additions & 8 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const React = require('react');
2+
const store = require('../store');
3+
const { SUPPORTED_PLATFORMS } = require('../constants');
4+
const PlatformSetting = require('./PlatformSetting');
5+
6+
const AllPlatformsSettings = React.createClass({
7+
onClickHandler() {
8+
SUPPORTED_PLATFORMS.forEach(platform => {
9+
store.disablePlatform(platform);
10+
ga('send', 'event', 'Platform Setting', 'UnCheck', platform);
11+
});
12+
this.forceUpdate();
13+
},
14+
render() {
15+
return (
16+
<div>
17+
{SUPPORTED_PLATFORMS.map(platform => (
18+
<div>
19+
<PlatformSetting platform={platform} />
20+
<hr />
21+
</div>
22+
))}
23+
<li className="platform-setting button-unsubscribe" onClick={this.onClickHandler}>
24+
<span className="unsubscribe-text">
25+
Unsubscribe from All
26+
</span>
27+
</li>
28+
<hr />
29+
</div>
30+
);
31+
},
32+
});
33+
34+
module.exports = AllPlatformsSettings;

app/components/Containers/SettingsContainer.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const React = require('react');
2-
const PlatformSetting = require('../PlatformSetting');
3-
const { SUPPORTED_PLATFORMS } = require('../../constants');
2+
const AllPlatformsSettings = require('../AllPlatformsSettings.js');
43

54
const SettingsContainer = () => (
65
<div className="settings-container">
@@ -11,12 +10,7 @@ Subscribe
1110
</h3>
1211
</div>
1312
<div className="subscribeContent">
14-
{SUPPORTED_PLATFORMS.map(platform => (
15-
<div>
16-
<PlatformSetting platform={platform} />
17-
<hr />
18-
</div>
19-
))}
13+
<AllPlatformsSettings />
2014
</div>
2115
</div>
2216
</div>

css/chrome.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@ header > h3 {
163163
.green-text {
164164
color: #4caf50;
165165
}
166+
167+
.button-unsubscribe {
168+
background-color: #f44336;
169+
cursor: pointer;
170+
}
171+
172+
.unsubscribe-text {
173+
color: #ffff;
174+
font-size: x-large;
175+
margin: 20%;
176+
}
166177
/*****************************************************/
167178

168179
.circular-border{

css/firefox.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@ header > h3 {
159159
.green-text {
160160
color: #4caf50;
161161
}
162+
163+
.button-unsubscribe {
164+
background-color: #f44336;
165+
cursor: pointer;
166+
}
167+
168+
.unsubscribe-text {
169+
color: #ffff;
170+
font-size: x-large;
171+
margin: 20%;
172+
}
162173
/*****************************************************/
163174

164175
.circular-border{

0 commit comments

Comments
 (0)