diff options
author | Muhamed <unknown> | 2023-05-27 16:33:26 +0530 |
---|---|---|
committer | muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> | 2023-07-23 22:15:29 +0530 |
commit | 792077667f19668d7a602f6a40d18517f21d240c (patch) | |
tree | e7c3ec4fe4d2d92d8d86159a4d926e29178edacc /src/components/layout/Sidebar.tsx | |
parent | 6.4.1-nightly.10 [skip ci] (diff) | |
download | ferdium-app-792077667f19668d7a602f6a40d18517f21d240c.tar.gz ferdium-app-792077667f19668d7a602f6a40d18517f21d240c.tar.zst ferdium-app-792077667f19668d7a602f6a40d18517f21d240c.zip |
update react-router-dom,react-tooltip& react-transition-group
Diffstat (limited to 'src/components/layout/Sidebar.tsx')
-rw-r--r-- | src/components/layout/Sidebar.tsx | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index fac424477..2b1e87023 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component } from 'react'; | 1 | import { Component } from 'react'; |
2 | import ReactTooltip from 'react-tooltip'; | 2 | import { Tooltip as ReactTooltip } from 'react-tooltip'; |
3 | import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; | 3 | import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; |
4 | import { inject, observer } from 'mobx-react'; | 4 | import { inject, observer } from 'mobx-react'; |
5 | import { | 5 | import { |
@@ -123,10 +123,6 @@ class Sidebar extends Component<IProps, IState> { | |||
123 | }; | 123 | }; |
124 | } | 124 | } |
125 | 125 | ||
126 | componentDidUpdate() { | ||
127 | ReactTooltip.rebuild(); | ||
128 | } | ||
129 | |||
130 | enableToolTip() { | 126 | enableToolTip() { |
131 | this.setState({ tooltipEnabled: true }); | 127 | this.setState({ tooltipEnabled: true }); |
132 | } | 128 | } |
@@ -232,7 +228,8 @@ class Sidebar extends Component<IProps, IState> { | |||
232 | type="button" | 228 | type="button" |
233 | onClick={() => openSettings({ path: 'recipes' })} | 229 | onClick={() => openSettings({ path: 'recipes' })} |
234 | className="sidebar__button sidebar__button--new-service" | 230 | className="sidebar__button sidebar__button--new-service" |
235 | data-tip={`${intl.formatMessage( | 231 | data-tooltip-id="tooltip-sidebar-button" |
232 | data-tooltip-content={`${intl.formatMessage( | ||
236 | messages.addNewService, | 233 | messages.addNewService, |
237 | )} (${addNewServiceShortcutKey(false)})`} | 234 | )} (${addNewServiceShortcutKey(false)})`} |
238 | > | 235 | > |
@@ -251,7 +248,8 @@ class Sidebar extends Component<IProps, IState> { | |||
251 | }); | 248 | }); |
252 | }} | 249 | }} |
253 | className="sidebar__button sidebar__button--split-mode-toggle" | 250 | className="sidebar__button sidebar__button--split-mode-toggle" |
254 | data-tip={`${intl.formatMessage( | 251 | data-tooltip-id="tooltip-sidebar-button" |
252 | data-tooltip-content={`${intl.formatMessage( | ||
255 | messages.splitModeToggle, | 253 | messages.splitModeToggle, |
256 | )} (${splitModeToggleShortcutKey(false)})`} | 254 | )} (${splitModeToggleShortcutKey(false)})`} |
257 | > | 255 | > |
@@ -268,7 +266,8 @@ class Sidebar extends Component<IProps, IState> { | |||
268 | className={`sidebar__button sidebar__button--workspaces ${ | 266 | className={`sidebar__button sidebar__button--workspaces ${ |
269 | isWorkspaceDrawerOpen ? 'is-active' : '' | 267 | isWorkspaceDrawerOpen ? 'is-active' : '' |
270 | }`} | 268 | }`} |
271 | data-tip={`${intl.formatMessage( | 269 | data-tooltip-id="tooltip-sidebar-button" |
270 | data-tooltip-content={`${intl.formatMessage( | ||
272 | workspaceToggleMessage, | 271 | workspaceToggleMessage, |
273 | )} (${workspaceToggleShortcutKey(false)})`} | 272 | )} (${workspaceToggleShortcutKey(false)})`} |
274 | > | 273 | > |
@@ -285,7 +284,8 @@ class Sidebar extends Component<IProps, IState> { | |||
285 | className={`sidebar__button sidebar__button--audio ${ | 284 | className={`sidebar__button sidebar__button--audio ${ |
286 | isAppMuted ? 'is-muted' : '' | 285 | isAppMuted ? 'is-muted' : '' |
287 | }`} | 286 | }`} |
288 | data-tip={`${intl.formatMessage( | 287 | data-tooltip-id="tooltip-sidebar-button" |
288 | data-tooltip-content={`${intl.formatMessage( | ||
289 | isAppMuted ? messages.unmute : messages.mute, | 289 | isAppMuted ? messages.unmute : messages.mute, |
290 | )} (${muteFerdiumShortcutKey(false)})`} | 290 | )} (${muteFerdiumShortcutKey(false)})`} |
291 | > | 291 | > |
@@ -303,7 +303,8 @@ class Sidebar extends Component<IProps, IState> { | |||
303 | className={`sidebar__button sidebar__button--todos ${ | 303 | className={`sidebar__button sidebar__button--todos ${ |
304 | todosStore.isTodosPanelVisible ? 'is-active' : '' | 304 | todosStore.isTodosPanelVisible ? 'is-active' : '' |
305 | }`} | 305 | }`} |
306 | data-tip={`${intl.formatMessage( | 306 | data-tooltip-id="tooltip-sidebar-button" |
307 | data-tooltip-content={`${intl.formatMessage( | ||
307 | todosToggleMessage, | 308 | todosToggleMessage, |
308 | )} (${todosToggleShortcutKey(false)})`} | 309 | )} (${todosToggleShortcutKey(false)})`} |
309 | > | 310 | > |
@@ -322,7 +323,8 @@ class Sidebar extends Component<IProps, IState> { | |||
322 | }, | 323 | }, |
323 | }); | 324 | }); |
324 | }} | 325 | }} |
325 | data-tip={`${intl.formatMessage( | 326 | data-tooltip-id="tooltip-sidebar-button" |
327 | data-tooltip-content={`${intl.formatMessage( | ||
326 | messages.lockFerdium, | 328 | messages.lockFerdium, |
327 | )} (${lockFerdiumShortcutKey(false)})`} | 329 | )} (${lockFerdiumShortcutKey(false)})`} |
328 | > | 330 | > |
@@ -331,14 +333,20 @@ class Sidebar extends Component<IProps, IState> { | |||
331 | ) : null} | 333 | ) : null} |
332 | </> | 334 | </> |
333 | {this.state.tooltipEnabled && ( | 335 | {this.state.tooltipEnabled && ( |
334 | <ReactTooltip place="right" type="dark" effect="solid" /> | 336 | <ReactTooltip |
337 | id="tooltip-sidebar-button" | ||
338 | place="right" | ||
339 | variant="dark" | ||
340 | style={{ height: 'auto', overflowY: 'unset' }} | ||
341 | /> | ||
335 | )} | 342 | )} |
336 | {!hideSettingsButton && !isMenuCollapsed ? ( | 343 | {!hideSettingsButton && !isMenuCollapsed ? ( |
337 | <button | 344 | <button |
338 | type="button" | 345 | type="button" |
339 | onClick={() => openSettings({ path: 'app' })} | 346 | onClick={() => openSettings({ path: 'app' })} |
340 | className="sidebar__button sidebar__button--settings" | 347 | className="sidebar__button sidebar__button--settings" |
341 | data-tip={`${intl.formatMessage( | 348 | data-tooltip-id="tooltip-sidebar-button" |
349 | data-tooltip-content={`${intl.formatMessage( | ||
342 | globalMessages.settings, | 350 | globalMessages.settings, |
343 | )} (${settingsShortcutKey(false)})`} | 351 | )} (${settingsShortcutKey(false)})`} |
344 | > | 352 | > |