Skip to content

Commit 7ab3c4a

Browse files
committed
fix: add theming
1 parent b50efc9 commit 7ab3c4a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { primitives } from '../../../../theme';
4141

4242
const END_ANCHOR_THRESHOLD = 16;
4343
const END_SHRINK_COMPENSATION_DURATION = 200;
44+
const MAX_AUDIO_ATTACHMENTS_CONTAINER_WIDTH = 560;
4445

4546
export type AttachmentUploadListPreviewPropsWithContext = Pick<
4647
MessageInputContextValue,
@@ -110,7 +111,7 @@ const UnMemoizedAttachmentUploadPreviewList = (
110111
const {
111112
theme: {
112113
messageInput: {
113-
attachmentUploadPreviewList: { flatList },
114+
attachmentUploadPreviewList: { audioAttachmentsContainer, flatList },
114115
},
115116
},
116117
} = useTheme();
@@ -271,7 +272,7 @@ const UnMemoizedAttachmentUploadPreviewList = (
271272
entering={ZoomIn.duration(200)}
272273
exiting={ZoomOut.duration(200)}
273274
layout={LinearTransition.duration(200)}
274-
style={styles.audioAttachmentsContainer}
275+
style={[styles.audioAttachmentsContainer, audioAttachmentsContainer]}
275276
>
276277
{audioAttachments.map((attachment) => (
277278
<AttachmentPreviewCell key={attachment.localMetadata.id}>
@@ -341,6 +342,7 @@ export const AttachmentUploadPreviewList = (props: AttachmentUploadPreviewListPr
341342

342343
const styles = StyleSheet.create({
343344
audioAttachmentsContainer: {
345+
maxWidth: MAX_AUDIO_ATTACHMENTS_CONTAINER_WIDTH,
344346
width: '100%',
345347
},
346348
flatList: {

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export type Theme = {
325325
attachButtonContainer: ViewStyle;
326326
attachmentSelectionBar: ViewStyle;
327327
attachmentUploadPreviewList: {
328+
audioAttachmentsContainer: ViewStyle;
328329
flatList: ViewStyle;
329330
itemSeparator: ViewStyle;
330331
};
@@ -1253,6 +1254,7 @@ export const defaultTheme: Theme = {
12531254
attachButtonContainer: {},
12541255
attachmentSelectionBar: {},
12551256
attachmentUploadPreviewList: {
1257+
audioAttachmentsContainer: {},
12561258
flatList: {},
12571259
itemSeparator: {},
12581260
},

0 commit comments

Comments
 (0)