@droppii-org/chat-mobile 0.2.17 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/assets/images/icon_excel.png +0 -0
- package/lib/module/assets/images/icon_img.png +0 -0
- package/lib/module/assets/images/icon_pdf.png +0 -0
- package/lib/module/assets/images/icon_txt.png +0 -0
- package/lib/module/assets/images/icon_word.png +0 -0
- package/lib/module/assets/images/index.js +5 -0
- package/lib/module/assets/images/index.js.map +1 -1
- package/lib/module/components/AttachmentPreview/FilePreview.js +107 -0
- package/lib/module/components/AttachmentPreview/FilePreview.js.map +1 -0
- package/lib/module/components/AttachmentPreview/MediaPreview.js +212 -0
- package/lib/module/components/AttachmentPreview/MediaPreview.js.map +1 -0
- package/lib/module/components/AttachmentPreview/index.js +49 -0
- package/lib/module/components/AttachmentPreview/index.js.map +1 -0
- package/lib/module/components/ThreadCard/AvatarSection.js.map +1 -1
- package/lib/module/components/ThreadCard/ThreadCard.js +17 -9
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/flows/inputButtons/index.js +7 -3
- package/lib/module/components/flows/inputButtons/index.js.map +1 -1
- package/lib/module/components/messages/fileMessage/index.js +122 -12
- package/lib/module/components/messages/fileMessage/index.js.map +1 -1
- package/lib/module/context/ChatContext.js +27 -4
- package/lib/module/context/ChatContext.js.map +1 -1
- package/lib/module/context/ChatDetailContext.js.map +1 -1
- package/lib/module/core/useChatListener.js +2 -4
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/core/useUserListener.js +0 -7
- package/lib/module/core/useUserListener.js.map +1 -1
- package/lib/module/hooks/flows/useFlow.js +14 -3
- package/lib/module/hooks/flows/useFlow.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +1 -1
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useConversationList.js +3 -27
- package/lib/module/hooks/useConversationList.js.map +1 -1
- package/lib/module/hooks/useFileAttachment.js +116 -0
- package/lib/module/hooks/useFileAttachment.js.map +1 -0
- package/lib/module/hooks/useFileDownload.js +175 -0
- package/lib/module/hooks/useFileDownload.js.map +1 -0
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js +1 -1
- package/lib/module/hooks/useLinkPreview/useLinkPreview.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +44 -36
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +1 -6
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetailHeader.js +6 -6
- package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatLinkPreview.js +3 -1
- package/lib/module/screens/chat-detail/ChatLinkPreview.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +2 -2
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/conversationHeader.utils.js +9 -0
- package/lib/module/screens/chat-detail/conversationHeader.utils.js.map +1 -1
- package/lib/module/screens/chat-detail/hooks/useAttachmentMapping.js +51 -0
- package/lib/module/screens/chat-detail/hooks/useAttachmentMapping.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +39 -13
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -1
- package/lib/module/screens/inbox/Inbox.js +5 -1
- package/lib/module/screens/inbox/Inbox.js.map +1 -1
- package/lib/module/services/apis.js +0 -20
- package/lib/module/services/apis.js.map +1 -1
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js +6 -6
- package/lib/module/services/attachmentHandlers/fileAttachmentHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/index.js +1 -1
- package/lib/module/services/attachmentHandlers/index.js.map +1 -1
- package/lib/module/store/conversation.js +1 -38
- package/lib/module/store/conversation.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +9 -0
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/auth.js.map +1 -1
- package/lib/module/types/chat.js.map +1 -1
- package/lib/module/utils/conversation.js +1 -28
- package/lib/module/utils/conversation.js.map +1 -1
- package/lib/module/utils/device.js +32 -0
- package/lib/module/utils/device.js.map +1 -1
- package/lib/module/utils/imageUtils.js +44 -28
- package/lib/module/utils/imageUtils.js.map +1 -1
- package/lib/module/utils/message.js.map +1 -1
- package/lib/module/utils/messageUtils.js +5 -3
- package/lib/module/utils/messageUtils.js.map +1 -1
- package/lib/typescript/src/assets/images/index.d.ts +5 -0
- package/lib/typescript/src/assets/images/index.d.ts.map +1 -1
- package/lib/typescript/src/components/AttachmentPreview/FilePreview.d.ts +6 -0
- package/lib/typescript/src/components/AttachmentPreview/FilePreview.d.ts.map +1 -0
- package/lib/typescript/src/components/AttachmentPreview/MediaPreview.d.ts +9 -0
- package/lib/typescript/src/components/AttachmentPreview/MediaPreview.d.ts.map +1 -0
- package/lib/typescript/src/components/AttachmentPreview/index.d.ts +9 -0
- package/lib/typescript/src/components/AttachmentPreview/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts +2 -2
- package/lib/typescript/src/components/ThreadCard/AvatarSection.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/fileMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/context/ChatContext.d.ts.map +1 -1
- package/lib/typescript/src/core/useChatListener.d.ts.map +1 -1
- package/lib/typescript/src/core/useUserListener.d.ts.map +1 -1
- package/lib/typescript/src/hooks/flows/useFlow.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useConversationList.d.ts +2 -2
- package/lib/typescript/src/hooks/useConversationList.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useFileAttachment.d.ts +20 -0
- package/lib/typescript/src/hooks/useFileAttachment.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useFileDownload.d.ts +15 -0
- package/lib/typescript/src/hooks/useFileDownload.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useImageAttachment.d.ts +1 -2
- package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLinkPreview/useLinkPreview.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatLinkPreview.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts +7 -5
- package/lib/typescript/src/screens/chat-detail/conversationHeader.utils.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentMapping.d.ts +10 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentMapping.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts +4 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +6 -9
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/Inbox.d.ts.map +1 -1
- package/lib/typescript/src/services/apis.d.ts +0 -4
- package/lib/typescript/src/services/apis.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts +2 -2
- package/lib/typescript/src/services/attachmentHandlers/fileAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/index.d.ts +1 -1
- package/lib/typescript/src/services/attachmentHandlers/index.d.ts.map +1 -1
- package/lib/typescript/src/store/conversation.d.ts +5 -8
- package/lib/typescript/src/store/conversation.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/attachment.d.ts +22 -1
- package/lib/typescript/src/types/attachment.d.ts.map +1 -1
- package/lib/typescript/src/types/auth.d.ts +1 -0
- package/lib/typescript/src/types/auth.d.ts.map +1 -1
- package/lib/typescript/src/types/chat.d.ts +15 -13
- package/lib/typescript/src/types/chat.d.ts.map +1 -1
- package/lib/typescript/src/utils/conversation.d.ts +2 -5
- package/lib/typescript/src/utils/conversation.d.ts.map +1 -1
- package/lib/typescript/src/utils/device.d.ts +7 -0
- package/lib/typescript/src/utils/device.d.ts.map +1 -1
- package/lib/typescript/src/utils/imageUtils.d.ts +1 -0
- package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -1
- package/lib/typescript/src/utils/message.d.ts +3 -3
- package/lib/typescript/src/utils/message.d.ts.map +1 -1
- package/lib/typescript/src/utils/messageUtils.d.ts +2 -1
- package/lib/typescript/src/utils/messageUtils.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/assets/images/icon_excel.png +0 -0
- package/src/assets/images/icon_img.png +0 -0
- package/src/assets/images/icon_pdf.png +0 -0
- package/src/assets/images/icon_txt.png +0 -0
- package/src/assets/images/icon_word.png +0 -0
- package/src/assets/images/index.ts +5 -0
- package/src/components/AttachmentPreview/FilePreview.tsx +137 -0
- package/src/components/AttachmentPreview/MediaPreview.tsx +238 -0
- package/src/components/AttachmentPreview/index.tsx +68 -0
- package/src/components/ThreadCard/AvatarSection.tsx +2 -3
- package/src/components/ThreadCard/ThreadCard.tsx +22 -15
- package/src/components/flows/inputButtons/index.tsx +4 -1
- package/src/components/messages/fileMessage/index.tsx +156 -13
- package/src/context/ChatContext.tsx +35 -3
- package/src/context/ChatDetailContext.tsx +1 -1
- package/src/core/useChatListener.ts +2 -4
- package/src/core/useUserListener.ts +0 -8
- package/src/hooks/flows/useFlow.ts +12 -3
- package/src/hooks/message/useSendMessage.ts +1 -1
- package/src/hooks/useConversationList.ts +6 -40
- package/src/hooks/useFileAttachment.ts +163 -0
- package/src/hooks/useFileDownload.ts +200 -0
- package/src/hooks/useImageAttachment.ts +1 -1
- package/src/hooks/useLinkPreview/useLinkPreview.ts +6 -1
- package/src/screens/chat-detail/ChatComposer.tsx +61 -30
- package/src/screens/chat-detail/ChatDetail.tsx +1 -7
- package/src/screens/chat-detail/ChatDetailHeader.tsx +6 -7
- package/src/screens/chat-detail/ChatLinkPreview.tsx +16 -12
- package/src/screens/chat-detail/ChatListLegend.tsx +2 -6
- package/src/screens/chat-detail/conversationHeader.utils.ts +16 -6
- package/src/screens/chat-detail/hooks/useAttachmentMapping.ts +58 -0
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +50 -11
- package/src/screens/chat-detail/types.ts +6 -13
- package/src/screens/inbox/Inbox.tsx +5 -1
- package/src/services/apis.ts +0 -38
- package/src/services/attachmentHandlers/fileAttachmentHandler.ts +8 -7
- package/src/services/attachmentHandlers/index.ts +4 -1
- package/src/store/conversation.ts +6 -55
- package/src/translation/resources/i18n.ts +9 -0
- package/src/types/attachment.ts +23 -1
- package/src/types/auth.ts +1 -0
- package/src/types/chat.ts +16 -20
- package/src/utils/conversation.ts +2 -40
- package/src/utils/device.ts +58 -0
- package/src/utils/imageUtils.ts +50 -28
- package/src/utils/message.ts +3 -2
- package/src/utils/messageUtils.ts +11 -3
- package/lib/module/components/AttachmentPreview.js +0 -252
- package/lib/module/components/AttachmentPreview.js.map +0 -1
- package/lib/typescript/src/components/AttachmentPreview.d.ts +0 -28
- package/lib/typescript/src/components/AttachmentPreview.d.ts.map +0 -1
- package/src/components/AttachmentPreview.tsx +0 -310
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { memo } from 'react';
|
|
2
|
-
import { ScrollView, StyleSheet } from 'react-native';
|
|
3
|
-
import { KContainer, KImage, KColors, KLabel } from '@droppii/libs';
|
|
4
|
-
|
|
5
|
-
type AttachmentType = 'image' | 'video' | 'audio' | 'document' | 'file';
|
|
6
|
-
|
|
7
|
-
interface AttachmentMetadata {
|
|
8
|
-
path: string;
|
|
9
|
-
filename?: string;
|
|
10
|
-
size?: number;
|
|
11
|
-
duration?: number;
|
|
12
|
-
mimeType?: string;
|
|
13
|
-
width?: number;
|
|
14
|
-
height?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface AttachmentItem {
|
|
18
|
-
metadata: AttachmentMetadata;
|
|
19
|
-
uploadProgress: number;
|
|
20
|
-
error: string | null;
|
|
21
|
-
isUploading: boolean;
|
|
22
|
-
uploadedUrl?: string;
|
|
23
|
-
thumbnailUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface AttachmentPreviewProps {
|
|
27
|
-
visible: boolean;
|
|
28
|
-
attachments?: Array<AttachmentItem & { type: AttachmentType }>;
|
|
29
|
-
onRemove: (type: AttachmentType, index: number) => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const formatDuration = (seconds: number): string => {
|
|
33
|
-
const totalSecs = Math.floor(seconds);
|
|
34
|
-
const mins = Math.floor(totalSecs / 60);
|
|
35
|
-
const secs = totalSecs % 60;
|
|
36
|
-
return `${mins.toString().padStart(2, '0')}:${secs
|
|
37
|
-
.toString()
|
|
38
|
-
.padStart(2, '0')}`;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const getAttachmentIcon = (type: AttachmentType): string => {
|
|
42
|
-
switch (type) {
|
|
43
|
-
case 'image':
|
|
44
|
-
return 'image';
|
|
45
|
-
case 'video':
|
|
46
|
-
return 'play-circle';
|
|
47
|
-
case 'audio':
|
|
48
|
-
return 'music';
|
|
49
|
-
case 'document':
|
|
50
|
-
return 'file-document';
|
|
51
|
-
case 'file':
|
|
52
|
-
default:
|
|
53
|
-
return 'file';
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const AttachmentPreview = memo(
|
|
58
|
-
({ visible, attachments, onRemove }: AttachmentPreviewProps) => {
|
|
59
|
-
if (!visible || !attachments?.length) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<KContainer.View
|
|
65
|
-
paddingH="0.75rem"
|
|
66
|
-
// paddingV="0.75rem"
|
|
67
|
-
brW={1}
|
|
68
|
-
brC={KColors.palette.gray.w100}
|
|
69
|
-
background={KColors.white}
|
|
70
|
-
style={styles.container}
|
|
71
|
-
>
|
|
72
|
-
<KContainer.View row alignItems minH={70}>
|
|
73
|
-
<KContainer.View flex>
|
|
74
|
-
<ScrollView
|
|
75
|
-
horizontal
|
|
76
|
-
showsHorizontalScrollIndicator={false}
|
|
77
|
-
scrollEventThrottle={16}
|
|
78
|
-
contentContainerStyle={styles.scrollContent}
|
|
79
|
-
>
|
|
80
|
-
{attachments.map((item, index) => {
|
|
81
|
-
const {
|
|
82
|
-
type,
|
|
83
|
-
metadata,
|
|
84
|
-
uploadProgress,
|
|
85
|
-
error,
|
|
86
|
-
isUploading,
|
|
87
|
-
thumbnailUrl,
|
|
88
|
-
} = item;
|
|
89
|
-
|
|
90
|
-
const isImage = type === 'image';
|
|
91
|
-
const isVideo = type === 'video';
|
|
92
|
-
const hasPreview = isImage || isVideo;
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<KContainer.View key={`${type}-${index}`}>
|
|
96
|
-
<KContainer.View style={styles.thumbnail} center>
|
|
97
|
-
{/* Video thumbnail */}
|
|
98
|
-
{isVideo && thumbnailUrl && (
|
|
99
|
-
<KImage.Base
|
|
100
|
-
uri={thumbnailUrl}
|
|
101
|
-
width={48}
|
|
102
|
-
height={48}
|
|
103
|
-
resizeMode="cover"
|
|
104
|
-
/>
|
|
105
|
-
)}
|
|
106
|
-
|
|
107
|
-
{/* Video placeholder (no thumbnail yet) */}
|
|
108
|
-
{isVideo && !thumbnailUrl && (
|
|
109
|
-
<KContainer.View
|
|
110
|
-
style={[styles.videoBg, styles.videoThumbnail]}
|
|
111
|
-
/>
|
|
112
|
-
)}
|
|
113
|
-
|
|
114
|
-
{/* Image preview */}
|
|
115
|
-
{isImage && (
|
|
116
|
-
<KImage.Base
|
|
117
|
-
uri={`file://${metadata.path}`}
|
|
118
|
-
width={48}
|
|
119
|
-
height={48}
|
|
120
|
-
/>
|
|
121
|
-
)}
|
|
122
|
-
|
|
123
|
-
{/* Show icon overlay for non-media files */}
|
|
124
|
-
{!hasPreview && (
|
|
125
|
-
<KContainer.View
|
|
126
|
-
style={styles.iconOverlay}
|
|
127
|
-
center
|
|
128
|
-
background={KColors.palette.gray.w100}
|
|
129
|
-
>
|
|
130
|
-
<KImage.VectorIcons
|
|
131
|
-
name={getAttachmentIcon(type)}
|
|
132
|
-
provider="MaterialCommunityIcons"
|
|
133
|
-
size={24}
|
|
134
|
-
color={KColors.palette.primary.w400}
|
|
135
|
-
/>
|
|
136
|
-
</KContainer.View>
|
|
137
|
-
)}
|
|
138
|
-
|
|
139
|
-
{/* Video duration badge */}
|
|
140
|
-
{isVideo && !!metadata.duration && (
|
|
141
|
-
<KContainer.View style={styles.durationBadge} center>
|
|
142
|
-
<KLabel.Text
|
|
143
|
-
typo="TextXsNormal"
|
|
144
|
-
color={KColors.white}
|
|
145
|
-
style={styles.durationText}
|
|
146
|
-
>
|
|
147
|
-
{formatDuration(metadata.duration / 1000)}
|
|
148
|
-
</KLabel.Text>
|
|
149
|
-
</KContainer.View>
|
|
150
|
-
)}
|
|
151
|
-
|
|
152
|
-
{/* Type icon for non-preview items */}
|
|
153
|
-
{!hasPreview && (
|
|
154
|
-
<KContainer.View style={styles.typeIcon} center>
|
|
155
|
-
<KImage.VectorIcons
|
|
156
|
-
name={getAttachmentIcon(type)}
|
|
157
|
-
provider="MaterialCommunityIcons"
|
|
158
|
-
size={14}
|
|
159
|
-
color={KColors.white}
|
|
160
|
-
/>
|
|
161
|
-
</KContainer.View>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{/* Error state */}
|
|
165
|
-
{error && (
|
|
166
|
-
<KContainer.View style={styles.errorOverlay} center>
|
|
167
|
-
<KImage.VectorIcons
|
|
168
|
-
name="close-circle"
|
|
169
|
-
provider="MaterialCommunityIcons"
|
|
170
|
-
size={28}
|
|
171
|
-
color={KColors.white}
|
|
172
|
-
/>
|
|
173
|
-
</KContainer.View>
|
|
174
|
-
)}
|
|
175
|
-
|
|
176
|
-
{/* Progress overlay */}
|
|
177
|
-
{isUploading && (
|
|
178
|
-
<KContainer.View style={styles.progressOverlay} center>
|
|
179
|
-
<KLabel.Text
|
|
180
|
-
typo="TextSmNormal"
|
|
181
|
-
color={KColors.white}
|
|
182
|
-
>
|
|
183
|
-
{uploadProgress}%
|
|
184
|
-
</KLabel.Text>
|
|
185
|
-
</KContainer.View>
|
|
186
|
-
)}
|
|
187
|
-
</KContainer.View>
|
|
188
|
-
{/* Remove button */}
|
|
189
|
-
<KContainer.Touchable
|
|
190
|
-
style={styles.removeButton}
|
|
191
|
-
center
|
|
192
|
-
br="round"
|
|
193
|
-
background={KColors.black}
|
|
194
|
-
onPress={() => onRemove(type, index)}
|
|
195
|
-
disabled={isUploading}
|
|
196
|
-
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
197
|
-
>
|
|
198
|
-
<KImage.VectorIcons
|
|
199
|
-
name="close"
|
|
200
|
-
provider="MaterialCommunityIcons"
|
|
201
|
-
size={14}
|
|
202
|
-
color={KColors.white}
|
|
203
|
-
/>
|
|
204
|
-
</KContainer.Touchable>
|
|
205
|
-
</KContainer.View>
|
|
206
|
-
);
|
|
207
|
-
})}
|
|
208
|
-
</ScrollView>
|
|
209
|
-
</KContainer.View>
|
|
210
|
-
</KContainer.View>
|
|
211
|
-
</KContainer.View>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
AttachmentPreview.displayName = 'AttachmentPreview';
|
|
217
|
-
|
|
218
|
-
const styles = StyleSheet.create({
|
|
219
|
-
container: {
|
|
220
|
-
// minHeight: 80,
|
|
221
|
-
},
|
|
222
|
-
scrollContent: {
|
|
223
|
-
alignItems: 'center',
|
|
224
|
-
},
|
|
225
|
-
thumbnail: {
|
|
226
|
-
position: 'relative',
|
|
227
|
-
width: 48,
|
|
228
|
-
height: 48,
|
|
229
|
-
borderRadius: 4,
|
|
230
|
-
overflow: 'hidden',
|
|
231
|
-
marginRight: 8,
|
|
232
|
-
backgroundColor: KColors.palette.gray.w50,
|
|
233
|
-
},
|
|
234
|
-
durationBadge: {
|
|
235
|
-
position: 'absolute',
|
|
236
|
-
bottom: 4,
|
|
237
|
-
right: 4,
|
|
238
|
-
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
239
|
-
borderRadius: 3,
|
|
240
|
-
paddingVertical: 2,
|
|
241
|
-
paddingHorizontal: 4,
|
|
242
|
-
},
|
|
243
|
-
durationText: {
|
|
244
|
-
fontSize: 11,
|
|
245
|
-
fontWeight: '600',
|
|
246
|
-
},
|
|
247
|
-
iconOverlay: {
|
|
248
|
-
width: 48,
|
|
249
|
-
height: 48,
|
|
250
|
-
borderRadius: 4,
|
|
251
|
-
},
|
|
252
|
-
videoIcon: {
|
|
253
|
-
position: 'absolute',
|
|
254
|
-
top: 2,
|
|
255
|
-
right: 2,
|
|
256
|
-
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
257
|
-
borderRadius: 8,
|
|
258
|
-
width: 20,
|
|
259
|
-
height: 20,
|
|
260
|
-
},
|
|
261
|
-
typeIcon: {
|
|
262
|
-
position: 'absolute',
|
|
263
|
-
bottom: 2,
|
|
264
|
-
right: 2,
|
|
265
|
-
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
266
|
-
borderRadius: 6,
|
|
267
|
-
width: 16,
|
|
268
|
-
height: 16,
|
|
269
|
-
},
|
|
270
|
-
videoBg: {
|
|
271
|
-
width: 48,
|
|
272
|
-
height: 48,
|
|
273
|
-
borderRadius: 4,
|
|
274
|
-
},
|
|
275
|
-
videoThumbnail: {
|
|
276
|
-
backgroundColor: KColors.black,
|
|
277
|
-
},
|
|
278
|
-
progressOverlay: {
|
|
279
|
-
position: 'absolute',
|
|
280
|
-
top: 0,
|
|
281
|
-
left: 0,
|
|
282
|
-
right: 0,
|
|
283
|
-
bottom: 0,
|
|
284
|
-
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
285
|
-
},
|
|
286
|
-
errorOverlay: {
|
|
287
|
-
position: 'absolute',
|
|
288
|
-
top: 0,
|
|
289
|
-
left: 0,
|
|
290
|
-
right: 0,
|
|
291
|
-
bottom: 0,
|
|
292
|
-
backgroundColor: 'rgba(255, 59, 48, 0.8)',
|
|
293
|
-
},
|
|
294
|
-
removeButton: {
|
|
295
|
-
position: 'absolute',
|
|
296
|
-
top: -8,
|
|
297
|
-
right: 2,
|
|
298
|
-
width: 22,
|
|
299
|
-
height: 22,
|
|
300
|
-
shadowColor: '#000',
|
|
301
|
-
shadowOffset: { width: 0, height: 1 },
|
|
302
|
-
shadowOpacity: 0.2,
|
|
303
|
-
shadowRadius: 2,
|
|
304
|
-
elevation: 3,
|
|
305
|
-
},
|
|
306
|
-
sendButton: {
|
|
307
|
-
width: 48,
|
|
308
|
-
height: 48,
|
|
309
|
-
},
|
|
310
|
-
});
|