diff options
author | 2021-09-13 14:45:46 +0200 | |
---|---|---|
committer | 2021-09-13 14:45:46 +0200 | |
commit | 537697a6e9757f118d09d9e76362ba1ff617e2c6 (patch) | |
tree | bc55447115e385137684e84697a8c15d2199b8d5 /src/components/services/tabs | |
parent | Bumped up version to: 5.6.3-nightly.0 [skip ci] (diff) | |
download | ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.gz ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.tar.zst ferdium-app-537697a6e9757f118d09d9e76362ba1ff617e2c6.zip |
chore: upgrade intl dependencies (#1920)
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabItem.js | 46 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 20 |
2 files changed, 33 insertions, 33 deletions
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index e5892be5d..b1a3ffbbb 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Menu, dialog, app, getCurrentWindow } from '@electron/remote'; | 1 | import { Menu, dialog, app, getCurrentWindow } from '@electron/remote'; |
2 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
3 | import { defineMessages, intlShape } from 'react-intl'; | 3 | import { defineMessages, injectIntl } from 'react-intl'; |
4 | import PropTypes from 'prop-types'; | 4 | import PropTypes from 'prop-types'; |
5 | import { observer } from 'mobx-react'; | 5 | import { observer } from 'mobx-react'; |
6 | import classnames from 'classnames'; | 6 | import classnames from 'classnames'; |
@@ -20,56 +20,55 @@ const IS_SERVICE_DEBUGGING_ENABLED = ( | |||
20 | const messages = defineMessages({ | 20 | const messages = defineMessages({ |
21 | reload: { | 21 | reload: { |
22 | id: 'tabs.item.reload', | 22 | id: 'tabs.item.reload', |
23 | defaultMessage: '!!!Reload', | 23 | defaultMessage: 'Reload', |
24 | }, | 24 | }, |
25 | disableNotifications: { | 25 | disableNotifications: { |
26 | id: 'tabs.item.disableNotifications', | 26 | id: 'tabs.item.disableNotifications', |
27 | defaultMessage: '!!!Disable notifications', | 27 | defaultMessage: 'Disable notifications', |
28 | }, | 28 | }, |
29 | enableNotifications: { | 29 | enableNotifications: { |
30 | id: 'tabs.item.enableNotification', | 30 | id: 'tabs.item.enableNotification', |
31 | defaultMessage: '!!!Enable notifications', | 31 | defaultMessage: 'Enable notifications', |
32 | }, | 32 | }, |
33 | disableAudio: { | 33 | disableAudio: { |
34 | id: 'tabs.item.disableAudio', | 34 | id: 'tabs.item.disableAudio', |
35 | defaultMessage: '!!!Disable audio', | 35 | defaultMessage: 'Disable audio', |
36 | }, | 36 | }, |
37 | enableAudio: { | 37 | enableAudio: { |
38 | id: 'tabs.item.enableAudio', | 38 | id: 'tabs.item.enableAudio', |
39 | defaultMessage: '!!!Enable audio', | 39 | defaultMessage: 'Enable audio', |
40 | }, | 40 | }, |
41 | enableDarkMode: { | 41 | enableDarkMode: { |
42 | id: 'tabs.item.enableDarkMode', | 42 | id: 'tabs.item.enableDarkMode', |
43 | defaultMessage: '!!!Enable Dark mode', | 43 | defaultMessage: 'Enable Dark mode', |
44 | }, | 44 | }, |
45 | disableDarkMode: { | 45 | disableDarkMode: { |
46 | id: 'tabs.item.disableDarkMode', | 46 | id: 'tabs.item.disableDarkMode', |
47 | defaultMessage: '!!!Disable Dark mode', | 47 | defaultMessage: 'Disable Dark mode', |
48 | }, | 48 | }, |
49 | disableService: { | 49 | disableService: { |
50 | id: 'tabs.item.disableService', | 50 | id: 'tabs.item.disableService', |
51 | defaultMessage: '!!!Disable Service', | 51 | defaultMessage: 'Disable Service', |
52 | }, | 52 | }, |
53 | enableService: { | 53 | enableService: { |
54 | id: 'tabs.item.enableService', | 54 | id: 'tabs.item.enableService', |
55 | defaultMessage: '!!!Enable Service', | 55 | defaultMessage: 'Enable Service', |
56 | }, | 56 | }, |
57 | hibernateService: { | 57 | hibernateService: { |
58 | id: 'tabs.item.hibernateService', | 58 | id: 'tabs.item.hibernateService', |
59 | defaultMessage: '!!!Hibernate Service', | 59 | defaultMessage: 'Hibernate Service', |
60 | }, | 60 | }, |
61 | wakeUpService: { | 61 | wakeUpService: { |
62 | id: 'tabs.item.wakeUpService', | 62 | id: 'tabs.item.wakeUpService', |
63 | defaultMessage: '!!!Wake Up Service', | 63 | defaultMessage: 'Wake Up Service', |
64 | }, | 64 | }, |
65 | deleteService: { | 65 | deleteService: { |
66 | id: 'tabs.item.deleteService', | 66 | id: 'tabs.item.deleteService', |
67 | defaultMessage: '!!!Delete Service', | 67 | defaultMessage: 'Delete Service', |
68 | }, | 68 | }, |
69 | confirmDeleteService: { | 69 | confirmDeleteService: { |
70 | id: 'tabs.item.confirmDeleteService', | 70 | id: 'tabs.item.confirmDeleteService', |
71 | defaultMessage: | 71 | defaultMessage: 'Do you really want to delete the {serviceName} service?', |
72 | '!!!Do you really want to delete the {serviceName} service?', | ||
73 | }, | 72 | }, |
74 | }); | 73 | }); |
75 | 74 | ||
@@ -134,10 +133,6 @@ class TabItem extends Component { | |||
134 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 133 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
135 | }; | 134 | }; |
136 | 135 | ||
137 | static contextTypes = { | ||
138 | intl: intlShape, | ||
139 | }; | ||
140 | |||
141 | @observable isPolled = false; | 136 | @observable isPolled = false; |
142 | 137 | ||
143 | @observable isPollAnswered = false; | 138 | @observable isPollAnswered = false; |
@@ -185,7 +180,7 @@ class TabItem extends Component { | |||
185 | showMessageBadgeWhenMutedSetting, | 180 | showMessageBadgeWhenMutedSetting, |
186 | showMessageBadgesEvenWhenMuted, | 181 | showMessageBadgesEvenWhenMuted, |
187 | } = this.props; | 182 | } = this.props; |
188 | const { intl } = this.context; | 183 | const { intl } = this.props; |
189 | 184 | ||
190 | const menuTemplate = [ | 185 | const menuTemplate = [ |
191 | { | 186 | { |
@@ -256,7 +251,10 @@ class TabItem extends Component { | |||
256 | detail: intl.formatMessage(messages.confirmDeleteService, { | 251 | detail: intl.formatMessage(messages.confirmDeleteService, { |
257 | serviceName: service.name || service.recipe.name, | 252 | serviceName: service.name || service.recipe.name, |
258 | }), | 253 | }), |
259 | buttons: [intl.formatMessage(globalMessages.yes), intl.formatMessage(globalMessages.no)], | 254 | buttons: [ |
255 | intl.formatMessage(globalMessages.yes), | ||
256 | intl.formatMessage(globalMessages.no), | ||
257 | ], | ||
260 | }); | 258 | }); |
261 | if (selection === 0) { | 259 | if (selection === 0) { |
262 | deleteService(); | 260 | deleteService(); |
@@ -304,7 +302,9 @@ class TabItem extends Component { | |||
304 | onClick={clickHandler} | 302 | onClick={clickHandler} |
305 | onContextMenu={() => menu.popup(getCurrentWindow())} | 303 | onContextMenu={() => menu.popup(getCurrentWindow())} |
306 | data-tip={`${service.name} ${ | 304 | data-tip={`${service.name} ${ |
307 | shortcutIndex <= 9 ? `(${cmdOrCtrlShortcutKey(false)}+${shortcutIndex})` : '' | 305 | shortcutIndex <= 9 |
306 | ? `(${cmdOrCtrlShortcutKey(false)}+${shortcutIndex})` | ||
307 | : '' | ||
308 | }`} | 308 | }`} |
309 | > | 309 | > |
310 | <img src={service.icon} className="tab-item__icon" alt="" /> | 310 | <img src={service.icon} className="tab-item__icon" alt="" /> |
@@ -332,4 +332,4 @@ class TabItem extends Component { | |||
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | export default SortableElement(TabItem); | 335 | export default injectIntl(SortableElement(TabItem)); |
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index c1421a2b1..a77799819 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -4,7 +4,8 @@ import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | |||
4 | 4 | ||
5 | import TabBarSortableList from './TabBarSortableList'; | 5 | import TabBarSortableList from './TabBarSortableList'; |
6 | 6 | ||
7 | export default @observer class TabBar extends Component { | 7 | @observer |
8 | class TabBar extends Component { | ||
8 | static propTypes = { | 9 | static propTypes = { |
9 | services: MobxPropTypes.arrayOrObservableArray.isRequired, | 10 | services: MobxPropTypes.arrayOrObservableArray.isRequired, |
10 | setActive: PropTypes.func.isRequired, | 11 | setActive: PropTypes.func.isRequired, |
@@ -26,16 +27,13 @@ export default @observer class TabBar extends Component { | |||
26 | }; | 27 | }; |
27 | 28 | ||
28 | onSortEnd = ({ oldIndex, newIndex }) => { | 29 | onSortEnd = ({ oldIndex, newIndex }) => { |
29 | const { | 30 | const { enableToolTip, reorder } = this.props; |
30 | enableToolTip, | ||
31 | reorder, | ||
32 | } = this.props; | ||
33 | 31 | ||
34 | enableToolTip(); | 32 | enableToolTip(); |
35 | reorder({ oldIndex, newIndex }); | 33 | reorder({ oldIndex, newIndex }); |
36 | }; | 34 | }; |
37 | 35 | ||
38 | shouldPreventSorting = (event) => event.target.tagName !== 'LI'; | 36 | shouldPreventSorting = event => event.target.tagName !== 'LI'; |
39 | 37 | ||
40 | toggleService = ({ serviceId, isEnabled }) => { | 38 | toggleService = ({ serviceId, isEnabled }) => { |
41 | const { updateService } = this.props; | 39 | const { updateService } = this.props; |
@@ -102,10 +100,10 @@ export default @observer class TabBar extends Component { | |||
102 | toggleAudio={toggleAudio} | 100 | toggleAudio={toggleAudio} |
103 | toggleDarkMode={toggleDarkMode} | 101 | toggleDarkMode={toggleDarkMode} |
104 | deleteService={deleteService} | 102 | deleteService={deleteService} |
105 | disableService={(args) => this.disableService(args)} | 103 | disableService={args => this.disableService(args)} |
106 | enableService={(args) => this.enableService(args)} | 104 | enableService={args => this.enableService(args)} |
107 | hibernateService={(args) => this.hibernateService(args)} | 105 | hibernateService={args => this.hibernateService(args)} |
108 | wakeUpService={(args) => this.wakeUpService(args)} | 106 | wakeUpService={args => this.wakeUpService(args)} |
109 | openSettings={openSettings} | 107 | openSettings={openSettings} |
110 | distance={20} | 108 | distance={20} |
111 | axis={axis} | 109 | axis={axis} |
@@ -118,3 +116,5 @@ export default @observer class TabBar extends Component { | |||
118 | ); | 116 | ); |
119 | } | 117 | } |
120 | } | 118 | } |
119 | |||
120 | export default TabBar; | ||