diff options
author | 2017-11-09 12:11:16 +0100 | |
---|---|---|
committer | 2017-11-09 12:15:36 +0100 | |
commit | 1839eff4fcad186871672499b6c3cc68e9539ce2 (patch) | |
tree | 207f0c0cf694309f6d84afeee220cacdc9b56242 /src/components/services/tabs/Tabbar.js | |
parent | Merge branch 'develop' of github.com:meetfranz/franz into develop (diff) | |
download | ferdium-app-1839eff4fcad186871672499b6c3cc68e9539ce2.tar.gz ferdium-app-1839eff4fcad186871672499b6c3cc68e9539ce2.tar.zst ferdium-app-1839eff4fcad186871672499b6c3cc68e9539ce2.zip |
feat(Service): Add option to display disabled services in tabs
Diffstat (limited to 'src/components/services/tabs/Tabbar.js')
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index fdb2c0a59..5f63aed16 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -29,20 +29,28 @@ export default class TabBar extends Component { | |||
29 | reorder({ oldIndex, newIndex }); | 29 | reorder({ oldIndex, newIndex }); |
30 | }; | 30 | }; |
31 | 31 | ||
32 | disableService = ({ serviceId }) => { | 32 | toggleService = ({ serviceId, isEnabled }) => { |
33 | const { updateService } = this.props; | 33 | const { updateService } = this.props; |
34 | 34 | ||
35 | if (serviceId) { | 35 | if (serviceId) { |
36 | updateService({ | 36 | updateService({ |
37 | serviceId, | 37 | serviceId, |
38 | serviceData: { | 38 | serviceData: { |
39 | isEnabled: false, | 39 | isEnabled, |
40 | }, | 40 | }, |
41 | redirect: false, | 41 | redirect: false, |
42 | }); | 42 | }); |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | disableService({ serviceId }) { | ||
47 | this.toggleService({ serviceId, isEnabled: false }); | ||
48 | } | ||
49 | |||
50 | enableService({ serviceId }) { | ||
51 | this.toggleService({ serviceId, isEnabled: true }); | ||
52 | } | ||
53 | |||
46 | render() { | 54 | render() { |
47 | const { | 55 | const { |
48 | services, | 56 | services, |
@@ -64,7 +72,8 @@ export default class TabBar extends Component { | |||
64 | reload={reload} | 72 | reload={reload} |
65 | toggleNotifications={toggleNotifications} | 73 | toggleNotifications={toggleNotifications} |
66 | deleteService={deleteService} | 74 | deleteService={deleteService} |
67 | disableService={this.disableService} | 75 | disableService={args => this.disableService(args)} |
76 | enableService={args => this.enableService(args)} | ||
68 | openSettings={openSettings} | 77 | openSettings={openSettings} |
69 | distance={20} | 78 | distance={20} |
70 | axis="y" | 79 | axis="y" |