diff options
author | 2021-08-11 22:32:58 +0530 | |
---|---|---|
committer | 2021-08-11 22:32:58 +0530 | |
commit | 3405e22bf2bcddef2de0d59453c978fd1ea03836 (patch) | |
tree | 4e74b051ce53000d88960484a7d9112a662a26af /src/components/services/tabs | |
parent | refactor: removed legacy properties from recipes (diff) | |
download | ferdium-app-3405e22bf2bcddef2de0d59453c978fd1ea03836.tar.gz ferdium-app-3405e22bf2bcddef2de0d59453c978fd1ea03836.tar.zst ferdium-app-3405e22bf2bcddef2de0d59453c978fd1ea03836.zip |
feat: allow the user to enable/disable dark mode
(from the sidebar context menu)
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabBarSortableList.js | 3 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.js | 16 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 3 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/components/services/tabs/TabBarSortableList.js b/src/components/services/tabs/TabBarSortableList.js index 117d799d7..1a389991d 100644 --- a/src/components/services/tabs/TabBarSortableList.js +++ b/src/components/services/tabs/TabBarSortableList.js | |||
@@ -14,6 +14,7 @@ class TabBarSortableList extends Component { | |||
14 | reload: PropTypes.func.isRequired, | 14 | reload: PropTypes.func.isRequired, |
15 | toggleNotifications: PropTypes.func.isRequired, | 15 | toggleNotifications: PropTypes.func.isRequired, |
16 | toggleAudio: PropTypes.func.isRequired, | 16 | toggleAudio: PropTypes.func.isRequired, |
17 | toggleDarkMode: PropTypes.func.isRequired, | ||
17 | deleteService: PropTypes.func.isRequired, | 18 | deleteService: PropTypes.func.isRequired, |
18 | disableService: PropTypes.func.isRequired, | 19 | disableService: PropTypes.func.isRequired, |
19 | enableService: PropTypes.func.isRequired, | 20 | enableService: PropTypes.func.isRequired, |
@@ -30,6 +31,7 @@ class TabBarSortableList extends Component { | |||
30 | reload, | 31 | reload, |
31 | toggleNotifications, | 32 | toggleNotifications, |
32 | toggleAudio, | 33 | toggleAudio, |
34 | toggleDarkMode, | ||
33 | deleteService, | 35 | deleteService, |
34 | disableService, | 36 | disableService, |
35 | enableService, | 37 | enableService, |
@@ -54,6 +56,7 @@ class TabBarSortableList extends Component { | |||
54 | reload={() => reload({ serviceId: service.id })} | 56 | reload={() => reload({ serviceId: service.id })} |
55 | toggleNotifications={() => toggleNotifications({ serviceId: service.id })} | 57 | toggleNotifications={() => toggleNotifications({ serviceId: service.id })} |
56 | toggleAudio={() => toggleAudio({ serviceId: service.id })} | 58 | toggleAudio={() => toggleAudio({ serviceId: service.id })} |
59 | toggleDarkMode={() => toggleDarkMode({ serviceId: service.id })} | ||
57 | deleteService={() => deleteService({ serviceId: service.id })} | 60 | deleteService={() => deleteService({ serviceId: service.id })} |
58 | disableService={() => disableService({ serviceId: service.id })} | 61 | disableService={() => disableService({ serviceId: service.id })} |
59 | enableService={() => enableService({ serviceId: service.id })} | 62 | enableService={() => enableService({ serviceId: service.id })} |
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index d4a4048eb..3c27cca73 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -41,6 +41,14 @@ const messages = defineMessages({ | |||
41 | id: 'tabs.item.enableAudio', | 41 | id: 'tabs.item.enableAudio', |
42 | defaultMessage: '!!!Enable audio', | 42 | defaultMessage: '!!!Enable audio', |
43 | }, | 43 | }, |
44 | enableDarkMode: { | ||
45 | id: 'tabs.item.enableDarkMode', | ||
46 | defaultMessage: '!!!Enable Dark mode', | ||
47 | }, | ||
48 | disableDarkMode: { | ||
49 | id: 'tabs.item.disableDarkMode', | ||
50 | defaultMessage: '!!!Disable Dark mode', | ||
51 | }, | ||
44 | disableService: { | 52 | disableService: { |
45 | id: 'tabs.item.disableService', | 53 | id: 'tabs.item.disableService', |
46 | defaultMessage: '!!!Disable Service', | 54 | defaultMessage: '!!!Disable Service', |
@@ -118,6 +126,7 @@ class TabItem extends Component { | |||
118 | reload: PropTypes.func.isRequired, | 126 | reload: PropTypes.func.isRequired, |
119 | toggleNotifications: PropTypes.func.isRequired, | 127 | toggleNotifications: PropTypes.func.isRequired, |
120 | toggleAudio: PropTypes.func.isRequired, | 128 | toggleAudio: PropTypes.func.isRequired, |
129 | toggleDarkMode: PropTypes.func.isRequired, | ||
121 | openSettings: PropTypes.func.isRequired, | 130 | openSettings: PropTypes.func.isRequired, |
122 | deleteService: PropTypes.func.isRequired, | 131 | deleteService: PropTypes.func.isRequired, |
123 | disableService: PropTypes.func.isRequired, | 132 | disableService: PropTypes.func.isRequired, |
@@ -169,6 +178,7 @@ class TabItem extends Component { | |||
169 | reload, | 178 | reload, |
170 | toggleNotifications, | 179 | toggleNotifications, |
171 | toggleAudio, | 180 | toggleAudio, |
181 | toggleDarkMode, | ||
172 | deleteService, | 182 | deleteService, |
173 | disableService, | 183 | disableService, |
174 | enableService, | 184 | enableService, |
@@ -216,6 +226,12 @@ class TabItem extends Component { | |||
216 | click: () => toggleAudio(), | 226 | click: () => toggleAudio(), |
217 | }, | 227 | }, |
218 | { | 228 | { |
229 | label: service.isDarkModeEnabled | ||
230 | ? intl.formatMessage(messages.enableDarkMode) | ||
231 | : intl.formatMessage(messages.disableDarkMode), | ||
232 | click: () => toggleDarkMode(), | ||
233 | }, | ||
234 | { | ||
219 | label: intl.formatMessage( | 235 | label: intl.formatMessage( |
220 | service.isEnabled ? messages.disableService : messages.enableService, | 236 | service.isEnabled ? messages.disableService : messages.enableService, |
221 | ), | 237 | ), |
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index 0f608c415..ab1e46c9f 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -15,6 +15,7 @@ export default @observer class TabBar extends Component { | |||
15 | reload: PropTypes.func.isRequired, | 15 | reload: PropTypes.func.isRequired, |
16 | toggleNotifications: PropTypes.func.isRequired, | 16 | toggleNotifications: PropTypes.func.isRequired, |
17 | toggleAudio: PropTypes.func.isRequired, | 17 | toggleAudio: PropTypes.func.isRequired, |
18 | toggleDarkMode: PropTypes.func.isRequired, | ||
18 | deleteService: PropTypes.func.isRequired, | 19 | deleteService: PropTypes.func.isRequired, |
19 | updateService: PropTypes.func.isRequired, | 20 | updateService: PropTypes.func.isRequired, |
20 | hibernateService: PropTypes.func.isRequired, | 21 | hibernateService: PropTypes.func.isRequired, |
@@ -78,6 +79,7 @@ export default @observer class TabBar extends Component { | |||
78 | reload, | 79 | reload, |
79 | toggleNotifications, | 80 | toggleNotifications, |
80 | toggleAudio, | 81 | toggleAudio, |
82 | toggleDarkMode, | ||
81 | deleteService, | 83 | deleteService, |
82 | showMessageBadgeWhenMutedSetting, | 84 | showMessageBadgeWhenMutedSetting, |
83 | showMessageBadgesEvenWhenMuted, | 85 | showMessageBadgesEvenWhenMuted, |
@@ -94,6 +96,7 @@ export default @observer class TabBar extends Component { | |||
94 | reload={reload} | 96 | reload={reload} |
95 | toggleNotifications={toggleNotifications} | 97 | toggleNotifications={toggleNotifications} |
96 | toggleAudio={toggleAudio} | 98 | toggleAudio={toggleAudio} |
99 | toggleDarkMode={toggleDarkMode} | ||
97 | deleteService={deleteService} | 100 | deleteService={deleteService} |
98 | disableService={(args) => this.disableService(args)} | 101 | disableService={(args) => this.disableService(args)} |
99 | enableService={(args) => this.enableService(args)} | 102 | enableService={(args) => this.enableService(args)} |