diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index be68377ca9..72f203e086 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -5352,9 +5352,7 @@ button.module-calling-participants-list__contact { } .module-left-pane__dialogs { - &:first-child { - margin-top: 8px; - } + margin-bottom: 8px; } .module-left-pane__header { diff --git a/stylesheets/components/BackupMediaDownloadProgress.scss b/stylesheets/components/BackupMediaDownloadProgress.scss index bfc991e0c8..0f01550456 100644 --- a/stylesheets/components/BackupMediaDownloadProgress.scss +++ b/stylesheets/components/BackupMediaDownloadProgress.scss @@ -2,12 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only .BackupMediaDownloadProgress { - border-radius: 10px; + border-radius: 12px; display: flex; gap: 10px; padding: 11px; padding-inline-end: 16px; margin-inline: 10px; + margin-block-end: 6px; + margin-block-start: 2px; user-select: none; position: relative; diff --git a/ts/components/BackupMediaDownloadProgress.tsx b/ts/components/BackupMediaDownloadProgress.tsx index c74640c024..82889dc658 100644 --- a/ts/components/BackupMediaDownloadProgress.tsx +++ b/ts/components/BackupMediaDownloadProgress.tsx @@ -35,7 +35,8 @@ export function BackupMediaDownloadProgress({ }: PropsType): JSX.Element | null { const [isShowingCancelConfirmation, setIsShowingCancelConfirmation] = useState(false); - if (totalBytes === 0) { + + if (totalBytes <= 0) { return null; } diff --git a/ts/components/LeftPane.stories.tsx b/ts/components/LeftPane.stories.tsx index f84e84bc15..f4b6eaca6f 100644 --- a/ts/components/LeftPane.stories.tsx +++ b/ts/components/LeftPane.stories.tsx @@ -80,6 +80,13 @@ const defaultGroups: Array = [ }), ]; +const backupMediaDownloadProgress = { + downloadedBytes: 1024, + totalBytes: 4098, + downloadBannerDismissed: false, + isIdle: false, + isPaused: false, +}; const defaultArchivedConversations: Array = [ getDefaultConversation({ id: 'michelle-archive-convo', @@ -342,6 +349,45 @@ export function InboxNoConversations(): JSX.Element { ); } +export function InboxBackupMediaDownload(): JSX.Element { + return ( + + ); +} + +export function InboxBackupMediaDownloadWithDialogs(): JSX.Element { + return ( + + ); +} +export function InboxBackupMediaDownloadWithDialogsAndUnpinnedConversations(): JSX.Element { + return ( + + ); +} + export function InboxUsernameCorrupted(): JSX.Element { return ( + ); +} + export function InboxPinnedNonPinnedAndArchivedConversations(): JSX.Element { return ; } diff --git a/ts/components/LeftPane.tsx b/ts/components/LeftPane.tsx index e7860c3877..97548170b1 100644 --- a/ts/components/LeftPane.tsx +++ b/ts/components/LeftPane.tsx @@ -651,27 +651,6 @@ export function LeftPane({ dialogs.push({ key: 'banner', dialog: maybeBanner }); } - const hasMediaBeenQueuedForBackup = - backupMediaDownloadProgress?.totalBytes > 0; - if ( - hasMediaBeenQueuedForBackup && - !backupMediaDownloadProgress.downloadBannerDismissed - ) { - dialogs.push({ - key: 'backupMediaDownload', - dialog: ( - - ), - }); - } - const hideHeader = modeSpecificProps.mode === LeftPaneMode.Archive || modeSpecificProps.mode === LeftPaneMode.Compose || @@ -680,6 +659,9 @@ export function LeftPane({ modeSpecificProps.mode === LeftPaneMode.ChooseGroupMembers || modeSpecificProps.mode === LeftPaneMode.SetGroupMetadata; + const showBackupMediaDownloadProgress = + !hideHeader && !backupMediaDownloadProgress.downloadBannerDismissed; + return ( )} -
- {!hideHeader && - dialogs.map(({ key, dialog }) => ( + + {dialogs.length && !hideHeader ? ( +
+ {dialogs.map(({ key, dialog }) => ( {dialog} ))} -
+
+ ) : null} + {showBackupMediaDownloadProgress ? ( + + ) : null} {preRowsNode && {preRowsNode}}