Skip to content

Commit aecaa9c

Browse files
committed
fix: remove unnecessary variant prop
1 parent 5685c59 commit aecaa9c

File tree

5 files changed

+7
-28
lines changed

5 files changed

+7
-28
lines changed

src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadProgressIndicator.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ import { ProgressIndicator as DefaultProgressIndicator } from '../../Loading';
55
import { useComponentContext } from '../../../context';
66
import { LoadingIndicatorIcon } from '../icons';
77

8-
export type AttachmentUploadProgressVariant = 'inline' | 'overlay';
9-
108
export type AttachmentUploadProgressIndicatorProps = {
119
className?: string;
1210
/** Shown when `uploadProgress` is `undefined` (e.g. progress tracking disabled). */
1311
fallback?: ReactNode;
1412
uploadProgress?: number;
15-
variant: AttachmentUploadProgressVariant;
1613
};
1714

1815
export const AttachmentUploadProgressIndicator = ({
1916
className,
2017
fallback,
2118
uploadProgress,
22-
variant,
2319
}: AttachmentUploadProgressIndicatorProps) => {
2420
const { ProgressIndicator = DefaultProgressIndicator } = useComponentContext();
2521

@@ -28,13 +24,7 @@ export const AttachmentUploadProgressIndicator = ({
2824
}
2925

3026
return (
31-
<div
32-
className={clsx(
33-
'str-chat__attachment-upload-progress',
34-
`str-chat__attachment-upload-progress--${variant}`,
35-
className,
36-
)}
37-
>
27+
<div className={clsx('str-chat__attachment-upload-progress', className)}>
3828
<ProgressIndicator percent={uploadProgress} />
3929
</div>
4030
);

src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import clsx from 'clsx';
1010
import { AttachmentUploadProgressIndicator } from './AttachmentUploadProgressIndicator';
1111
import { RemoveAttachmentPreviewButton } from '../RemoveAttachmentPreviewButton';
1212
import { AttachmentPreviewRoot } from './utils/AttachmentPreviewRoot';
13-
import { FileSizeIndicator } from '../../Attachment';
1413
import { IconExclamationMark, IconExclamationTriangleFill } from '../../Icons';
1514
import { PlayButton } from '../../Button';
1615
import {
@@ -95,10 +94,7 @@ export const AudioAttachmentPreview = ({
9594
</div>
9695
<div className='str-chat__attachment-preview-file__data'>
9796
{uploadState === 'uploading' && (
98-
<AttachmentUploadProgressIndicator
99-
uploadProgress={uploadProgress}
100-
variant='inline'
101-
/>
97+
<AttachmentUploadProgressIndicator uploadProgress={uploadProgress} />
10298
)}
10399
{showProgressControls ? (
104100
<>

src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ export const FileAttachmentPreview = ({
4343
</div>
4444
<div className='str-chat__attachment-preview-file__data'>
4545
{uploadState === 'uploading' && (
46-
<AttachmentUploadProgressIndicator
47-
uploadProgress={uploadProgress}
48-
variant='inline'
49-
/>
46+
<AttachmentUploadProgressIndicator uploadProgress={uploadProgress} />
5047
)}
5148
<AttachmentUploadedSizeIndicator attachment={attachment} />
5249
{hasFatalError && (

src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const MediaAttachmentPreview = ({
100100
<AttachmentUploadProgressIndicator
101101
fallback={<LoadingIndicator />}
102102
uploadProgress={uploadProgress}
103-
variant='overlay'
104103
/>
105104
)}
106105

src/components/MessageComposer/styling/AttachmentPreview.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
}
216216

217217
.str-chat__loading-indicator,
218-
.str-chat__attachment-upload-progress.str-chat__attachment-upload-progress--overlay,
218+
.str-chat__attachment-upload-progress,
219219
.str-chat__icon--exclamation-circle {
220220
width: var(--icon-size-sm);
221221
height: var(--icon-size-sm);
@@ -241,9 +241,10 @@
241241
color: var(--badge-text-on-accent);
242242
}
243243

244-
.str-chat__attachment-upload-progress.str-chat__attachment-upload-progress--overlay {
244+
.str-chat__attachment-upload-progress {
245245
border: none;
246246
border-radius: 0;
247+
background: transparent;
247248
}
248249
}
249250

@@ -295,15 +296,11 @@
295296
line-height: var(--typography-line-height-tight);
296297

297298
.str-chat__loading-indicator,
298-
.str-chat__attachment-upload-progress.str-chat__attachment-upload-progress--inline {
299+
.str-chat__attachment-upload-progress {
299300
width: var(--icon-size-sm);
300301
height: var(--icon-size-sm);
301302
}
302303

303-
.str-chat__attachment-upload-progress.str-chat__attachment-upload-progress--inline {
304-
flex-shrink: 0;
305-
}
306-
307304
.str-chat__attachment-preview-file__upload-size-fraction {
308305
white-space: nowrap;
309306
}

0 commit comments

Comments
 (0)