diff options
author | 2021-10-26 20:37:56 +0530 | |
---|---|---|
committer | 2021-10-26 20:37:56 +0530 | |
commit | 955f2abeb2c093515e6dd0026b4072145a2be6b6 (patch) | |
tree | 265497cf116ccf1d11fb869a95fcabcf0baacf18 /src/components/services/tabs | |
parent | docs: add Vishnu017 as a contributor for code (#2142) [skip ci] (diff) | |
download | ferdium-app-955f2abeb2c093515e6dd0026b4072145a2be6b6.tar.gz ferdium-app-955f2abeb2c093515e6dd0026b4072145a2be6b6.tar.zst ferdium-app-955f2abeb2c093515e6dd0026b4072145a2be6b6.zip |
Add feature to display service name under service icon when the toggle for it is enabled in the settings (#2136)
Co-authored-by: AnjithPaul <anjithpaul.mec@gmail.com>
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 | 11 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 3 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/components/services/tabs/TabBarSortableList.js b/src/components/services/tabs/TabBarSortableList.js index 69a12e982..3049b6efa 100644 --- a/src/components/services/tabs/TabBarSortableList.js +++ b/src/components/services/tabs/TabBarSortableList.js | |||
@@ -21,6 +21,7 @@ class TabBarSortableList extends Component { | |||
21 | hibernateService: PropTypes.func.isRequired, | 21 | hibernateService: PropTypes.func.isRequired, |
22 | wakeUpService: PropTypes.func.isRequired, | 22 | wakeUpService: PropTypes.func.isRequired, |
23 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, | 23 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, |
24 | showServiceNameSetting: PropTypes.bool.isRequired, | ||
24 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 25 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
25 | }; | 26 | }; |
26 | 27 | ||
@@ -39,6 +40,7 @@ class TabBarSortableList extends Component { | |||
39 | wakeUpService, | 40 | wakeUpService, |
40 | openSettings, | 41 | openSettings, |
41 | showMessageBadgeWhenMutedSetting, | 42 | showMessageBadgeWhenMutedSetting, |
43 | showServiceNameSetting, | ||
42 | showMessageBadgesEvenWhenMuted, | 44 | showMessageBadgesEvenWhenMuted, |
43 | } = this.props; | 45 | } = this.props; |
44 | 46 | ||
@@ -65,6 +67,7 @@ class TabBarSortableList extends Component { | |||
65 | openSettings={openSettings} | 67 | openSettings={openSettings} |
66 | showMessageBadgeWhenMutedSetting={showMessageBadgeWhenMutedSetting} | 68 | showMessageBadgeWhenMutedSetting={showMessageBadgeWhenMutedSetting} |
67 | showMessageBadgesEvenWhenMuted={showMessageBadgesEvenWhenMuted} | 69 | showMessageBadgesEvenWhenMuted={showMessageBadgesEvenWhenMuted} |
70 | showServiceNameSetting={showServiceNameSetting} | ||
68 | /> | 71 | /> |
69 | ))} | 72 | ))} |
70 | </ul> | 73 | </ul> |
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 455d2549a..3ea6c5da2 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -132,6 +132,7 @@ class TabItem extends Component { | |||
132 | hibernateService: PropTypes.func.isRequired, | 132 | hibernateService: PropTypes.func.isRequired, |
133 | wakeUpService: PropTypes.func.isRequired, | 133 | wakeUpService: PropTypes.func.isRequired, |
134 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, | 134 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, |
135 | showServiceNameSetting: PropTypes.bool.isRequired, | ||
135 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 136 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
136 | stores: PropTypes.shape({ | 137 | stores: PropTypes.shape({ |
137 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | 138 | settings: PropTypes.instanceOf(SettingsStore).isRequired, |
@@ -219,6 +220,7 @@ class TabItem extends Component { | |||
219 | wakeUpService, | 220 | wakeUpService, |
220 | openSettings, | 221 | openSettings, |
221 | showMessageBadgeWhenMutedSetting, | 222 | showMessageBadgeWhenMutedSetting, |
223 | showServiceNameSetting, | ||
222 | showMessageBadgesEvenWhenMuted, | 224 | showMessageBadgesEvenWhenMuted, |
223 | } = this.props; | 225 | } = this.props; |
224 | const { intl } = this.props; | 226 | const { intl } = this.props; |
@@ -347,6 +349,7 @@ class TabItem extends Component { | |||
347 | 'is-active': service.isActive, | 349 | 'is-active': service.isActive, |
348 | 'has-custom-icon': service.hasCustomIcon, | 350 | 'has-custom-icon': service.hasCustomIcon, |
349 | 'is-disabled': !service.isEnabled, | 351 | 'is-disabled': !service.isEnabled, |
352 | 'is-label-enabled': showServiceNameSetting, | ||
350 | })} | 353 | })} |
351 | onClick={clickHandler} | 354 | onClick={clickHandler} |
352 | onContextMenu={() => menu.popup()} | 355 | onContextMenu={() => menu.popup()} |
@@ -356,8 +359,12 @@ class TabItem extends Component { | |||
356 | : '' | 359 | : '' |
357 | }`} | 360 | }`} |
358 | > | 361 | > |
359 | 362 | ||
360 | <img src={service.icon} className="tab-item__icon" alt="" /> | 363 | {showServiceNameSetting? <div> |
364 | <img src={service.icon} className="tab-item__icon" alt="" /> | ||
365 | <span className="tab-item__label">{service.name}</span> | ||
366 | </div> : <img src={service.icon} className="tab-item__icon" alt="" />} | ||
367 | |||
361 | {notificationBadge} | 368 | {notificationBadge} |
362 | {errorBadge} | 369 | {errorBadge} |
363 | {IS_SERVICE_DEBUGGING_ENABLED && ( | 370 | {IS_SERVICE_DEBUGGING_ENABLED && ( |
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index 4ab0e8611..94d6f33c1 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -23,6 +23,7 @@ class TabBar extends Component { | |||
23 | wakeUpService: PropTypes.func.isRequired, | 23 | wakeUpService: PropTypes.func.isRequired, |
24 | useVerticalStyle: PropTypes.bool.isRequired, | 24 | useVerticalStyle: PropTypes.bool.isRequired, |
25 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, | 25 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, |
26 | showServiceNameSetting: PropTypes.bool.isRequired, | ||
26 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 27 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
27 | }; | 28 | }; |
28 | 29 | ||
@@ -82,6 +83,7 @@ class TabBar extends Component { | |||
82 | deleteService, | 83 | deleteService, |
83 | useVerticalStyle, | 84 | useVerticalStyle, |
84 | showMessageBadgeWhenMutedSetting, | 85 | showMessageBadgeWhenMutedSetting, |
86 | showServiceNameSetting, | ||
85 | showMessageBadgesEvenWhenMuted, | 87 | showMessageBadgesEvenWhenMuted, |
86 | } = this.props; | 88 | } = this.props; |
87 | 89 | ||
@@ -110,6 +112,7 @@ class TabBar extends Component { | |||
110 | lockAxis={axis} | 112 | lockAxis={axis} |
111 | helperClass="is-reordering" | 113 | helperClass="is-reordering" |
112 | showMessageBadgeWhenMutedSetting={showMessageBadgeWhenMutedSetting} | 114 | showMessageBadgeWhenMutedSetting={showMessageBadgeWhenMutedSetting} |
115 | showServiceNameSetting={showServiceNameSetting} | ||
113 | showMessageBadgesEvenWhenMuted={showMessageBadgesEvenWhenMuted} | 116 | showMessageBadgesEvenWhenMuted={showMessageBadgesEvenWhenMuted} |
114 | /> | 117 | /> |
115 | </div> | 118 | </div> |