aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2023-09-02 16:28:04 +0100
committerLibravatar GitHub <noreply@github.com>2023-09-02 15:28:04 +0000
commitd1c623f4c3d72c859f9ad9cb985be127d6a3eb62 (patch)
treee102da856ae328c70e822d60ac53909acd4627b9 /src/components/layout
parentDowngrade 'electron' to 25.x (diff)
downloadferdium-app-d1c623f4c3d72c859f9ad9cb985be127d6a3eb62.tar.gz
ferdium-app-d1c623f4c3d72c859f9ad9cb985be127d6a3eb62.tar.zst
ferdium-app-d1c623f4c3d72c859f9ad9cb985be127d6a3eb62.zip
feat: Add Download Manager (pause, stop, delete) (#1339)
Diffstat (limited to 'src/components/layout')
-rw-r--r--src/components/layout/Sidebar.tsx27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index 6fd911a24..7904d7653 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -14,11 +14,12 @@ import {
14 mdiPlusBox, 14 mdiPlusBox,
15 mdiViewGrid, 15 mdiViewGrid,
16 mdiViewSplitVertical, 16 mdiViewSplitVertical,
17 mdiDownload,
17} from '@mdi/js'; 18} from '@mdi/js';
18
19import Tabbar from '../services/tabs/Tabbar'; 19import Tabbar from '../services/tabs/Tabbar';
20import { 20import {
21 addNewServiceShortcutKey, 21 addNewServiceShortcutKey,
22 downloadsShortcutKey,
22 lockFerdiumShortcutKey, 23 lockFerdiumShortcutKey,
23 muteFerdiumShortcutKey, 24 muteFerdiumShortcutKey,
24 settingsShortcutKey, 25 settingsShortcutKey,
@@ -91,6 +92,7 @@ interface IProps extends WrappedComponentProps {
91 toggleCollapseMenu: () => void; 92 toggleCollapseMenu: () => void;
92 toggleWorkspaceDrawer: () => void; 93 toggleWorkspaceDrawer: () => void;
93 openSettings: (args: { path: string }) => void; 94 openSettings: (args: { path: string }) => void;
95 openDownloads: (args: { path: string }) => void;
94 // eslint-disable-next-line react/no-unused-prop-types 96 // eslint-disable-next-line react/no-unused-prop-types
95 closeSettings: () => void; 97 closeSettings: () => void;
96 setActive: (args: { serviceId: string }) => void; 98 setActive: (args: { serviceId: string }) => void;
@@ -141,6 +143,7 @@ class Sidebar extends Component<IProps, IState> {
141 render() { 143 render() {
142 const { 144 const {
143 openSettings, 145 openSettings,
146 openDownloads,
144 toggleMuteApp, 147 toggleMuteApp,
145 toggleCollapseMenu, 148 toggleCollapseMenu,
146 isAppMuted, 149 isAppMuted,
@@ -156,6 +159,7 @@ class Sidebar extends Component<IProps, IState> {
156 hideWorkspacesButton, 159 hideWorkspacesButton,
157 hideNotificationsButton, 160 hideNotificationsButton,
158 hideSettingsButton, 161 hideSettingsButton,
162 hideDownloadButton,
159 hideSplitModeButton, 163 hideSplitModeButton,
160 useHorizontalStyle, 164 useHorizontalStyle,
161 splitMode, 165 splitMode,
@@ -180,6 +184,8 @@ class Sidebar extends Component<IProps, IState> {
180 184
181 const { isMenuCollapsed } = stores!.settings.all.app; 185 const { isMenuCollapsed } = stores!.settings.all.app;
182 186
187 const { isDownloading, justFinishedDownloading } = stores!.app;
188
183 return ( 189 return (
184 <div className="sidebar"> 190 <div className="sidebar">
185 <Tabbar 191 <Tabbar
@@ -340,6 +346,25 @@ class Sidebar extends Component<IProps, IState> {
340 style={{ height: 'auto', overflowY: 'unset' }} 346 style={{ height: 'auto', overflowY: 'unset' }}
341 /> 347 />
342 )} 348 )}
349
350 {!hideDownloadButton && !isMenuCollapsed ? (
351 <button
352 type="button"
353 onClick={() => openDownloads({ path: '/downloadmanager' })}
354 className={
355 'sidebar__button' +
356 `${isDownloading ? ' sidebar__button--downloading' : ''}` +
357 `${justFinishedDownloading ? ' sidebar__button--done' : ''}`
358 }
359 data-tooltip-id="tooltip-sidebar-button"
360 data-tooltip-content={`${intl.formatMessage(
361 globalMessages.downloads,
362 )} (${downloadsShortcutKey(false)})`}
363 >
364 <Icon icon={mdiDownload} size={1.8} />
365 </button>
366 ) : null}
367
343 {!hideSettingsButton && !isMenuCollapsed ? ( 368 {!hideSettingsButton && !isMenuCollapsed ? (
344 <button 369 <button
345 type="button" 370 type="button"