From 40e91e96fd1c55b2ca8a572851dfe26b6b4c2de9 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:20:46 -0400 Subject: [PATCH] Update Backup Media download progress indicator for narrow left panes Co-authored-by: Jamie Kyle --- .../BackupMediaDownloadProgress.scss | 57 +++++---------- stylesheets/components/LeftPaneDialog.scss | 1 + .../BackupMediaDownloadProgress.stories.tsx | 48 +++++++++---- ts/components/BackupMediaDownloadProgress.tsx | 69 +++++++++++++------ ts/components/LeftPane.tsx | 1 + ts/components/ProgressCircle.stories.tsx | 7 +- ts/components/ProgressCircle.tsx | 7 ++ 7 files changed, 117 insertions(+), 73 deletions(-) diff --git a/stylesheets/components/BackupMediaDownloadProgress.scss b/stylesheets/components/BackupMediaDownloadProgress.scss index 32cadb63a5..c9eb755c05 100644 --- a/stylesheets/components/BackupMediaDownloadProgress.scss +++ b/stylesheets/components/BackupMediaDownloadProgress.scss @@ -4,34 +4,17 @@ @use '../mixins'; @use '../variables'; -.BackupMediaDownloadProgress { - border-radius: 12px; +.BackupMediaDownloadProgress__content { 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; - - &__title { - @include mixins.font-body-2-bold; - } - - @include mixins.light-theme { - background-color: variables.$color-white; - border: 1px solid variables.$color-gray-20; - } - @include mixins.dark-theme { - background: variables.$color-gray-75; - border: 1px solid variables.$color-gray-60; - } + flex-direction: column; + justify-content: center; + min-height: 36px; + margin-inline-end: 20px; + gap: 2px; } -.BackupMediaDownloadProgress__icon { - margin-top: 6px; +.BackupMediaDownloadProgress__title { + @include mixins.font-body-2-bold; } .BackupMediaDownloadProgress__icon--complete { @@ -89,10 +72,12 @@ button.BackupMediaDownloadProgress__button { } button.BackupMediaDownloadProgress__button-more { - position: absolute; - inset-inline-end: 14px; - inset-block-start: 10px; @include mixins.button-reset; + & { + position: absolute; + inset-block-start: 8px; + inset-inline-end: 14px; + } &::after { content: ''; display: block; @@ -113,10 +98,12 @@ button.BackupMediaDownloadProgress__button-more { } } button.BackupMediaDownloadProgress__button-close { - position: absolute; - inset-inline-end: 14px; - inset-block-start: 10px; @include mixins.button-reset; + & { + position: absolute; + inset-block-start: 12px; + inset-inline-end: 12px; + } &::after { content: ''; display: block; @@ -137,14 +124,6 @@ button.BackupMediaDownloadProgress__button-close { } } -.BackupMediaDownloadProgress__content { - display: flex; - flex-direction: column; - justify-content: center; - gap: 2px; - min-height: 36px; -} - .BackupMediaDownloadProgress__description { @include mixins.font-subtitle; diff --git a/stylesheets/components/LeftPaneDialog.scss b/stylesheets/components/LeftPaneDialog.scss index 9c59a0ce6c..e244ce9704 100644 --- a/stylesheets/components/LeftPaneDialog.scss +++ b/stylesheets/components/LeftPaneDialog.scss @@ -30,6 +30,7 @@ padding-inline: 16px 14px; user-select: none; width: 100%; + position: relative; font-size: 13px; line-height: 18px; diff --git a/ts/components/BackupMediaDownloadProgress.stories.tsx b/ts/components/BackupMediaDownloadProgress.stories.tsx index b16f1770d2..30062859a3 100644 --- a/ts/components/BackupMediaDownloadProgress.stories.tsx +++ b/ts/components/BackupMediaDownloadProgress.stories.tsx @@ -7,11 +7,40 @@ import { action } from '@storybook/addon-actions'; import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress'; import { KIBIBYTE } from '../types/AttachmentSize'; +import { WidthBreakpoint } from './_util'; const { i18n } = window.SignalContext; type PropsType = ComponentProps; +function Template(args: PropsType): JSX.Element { + return ( + <> +
+

Wide

+ +
+
+

Medium

+ +
+
+

Narrow

+ +
+ + ); +} + export default { title: 'Components/BackupMediaDownloadProgress', args: { @@ -27,34 +56,27 @@ export default { } satisfies Meta; export function InProgress(args: PropsType): JSX.Element { - return ; + return