|
1 | | -import React, { useCallback, useEffect, useMemo, useState } from 'react'; |
| 1 | +import React, { useCallback, useEffect, useState } from 'react'; |
2 | 2 | import { Modal, SafeAreaView, StyleSheet, View } from 'react-native'; |
3 | 3 |
|
4 | 4 | import { |
@@ -62,11 +62,7 @@ import { |
62 | 62 | NativeHandlers, |
63 | 63 | } from '../../native'; |
64 | 64 | import { AIStates, useAIState } from '../AITypingIndicatorView'; |
65 | | -import { AttachmentPicker, AttachmentPickerProps } from '../AttachmentPicker/AttachmentPicker'; |
66 | | -import { AttachmentPickerError as DefaultAttachmentPickerError } from '../AttachmentPicker/components/AttachmentPickerError'; |
67 | | -import { AttachmentPickerErrorImage as DefaultAttachmentPickerErrorImage } from '../AttachmentPicker/components/AttachmentPickerErrorImage'; |
68 | | -import { AttachmentPickerIOSSelectMorePhotos as DefaultAttachmentPickerIOSSelectMorePhotos } from '../AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos'; |
69 | | -import { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent } from '../AttachmentPicker/components/ImageOverlaySelectedComponent'; |
| 65 | +import { AttachmentPickerProps } from '../AttachmentPicker/AttachmentPicker'; |
70 | 66 | import { AutoCompleteInput } from '../AutoCompleteInput/AutoCompleteInput'; |
71 | 67 | import { CreatePoll } from '../Poll/CreatePollContent'; |
72 | 68 |
|
@@ -196,21 +192,10 @@ const messageComposerStateStoreSelector = (state: MessageComposerState) => ({ |
196 | 192 |
|
197 | 193 | const MessageInputWithContext = (props: MessageInputPropsWithContext) => { |
198 | 194 | const { |
199 | | - AttachmentPickerBottomSheetHandle, |
200 | | - AttachmentPickerError = DefaultAttachmentPickerError, |
201 | | - AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage, |
202 | | - AttachmentPickerIOSSelectMorePhotos = DefaultAttachmentPickerIOSSelectMorePhotos, |
203 | 195 | AttachmentPickerSelectionBar, |
204 | | - ImageOverlaySelectedComponent = DefaultImageOverlaySelectedComponent, |
205 | 196 | attachmentPickerBottomSheetHeight, |
206 | | - attachmentPickerBottomSheetHandleHeight, |
207 | | - attachmentPickerErrorButtonText, |
208 | | - attachmentPickerErrorText, |
209 | 197 | attachmentSelectionBarHeight, |
210 | | - numberOfAttachmentImagesToLoadPerCall = 60, |
211 | | - numberOfAttachmentPickerImageColumns = 3, |
212 | 198 | bottomInset, |
213 | | - bottomSheetRef, |
214 | 199 | selectedPicker, |
215 | 200 |
|
216 | 201 | additionalTextInputProps, |
@@ -289,37 +274,6 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => { |
289 | 274 | }, |
290 | 275 | } = useTheme(); |
291 | 276 |
|
292 | | - const attachmentPickerProps = useMemo( |
293 | | - () => ({ |
294 | | - AttachmentPickerBottomSheetHandle, |
295 | | - attachmentPickerBottomSheetHandleHeight, |
296 | | - attachmentPickerBottomSheetHeight, |
297 | | - AttachmentPickerError, |
298 | | - attachmentPickerErrorButtonText, |
299 | | - AttachmentPickerErrorImage, |
300 | | - attachmentPickerErrorText, |
301 | | - AttachmentPickerIOSSelectMorePhotos, |
302 | | - attachmentSelectionBarHeight, |
303 | | - ImageOverlaySelectedComponent, |
304 | | - numberOfAttachmentImagesToLoadPerCall, |
305 | | - numberOfAttachmentPickerImageColumns, |
306 | | - }), |
307 | | - [ |
308 | | - AttachmentPickerBottomSheetHandle, |
309 | | - attachmentPickerBottomSheetHandleHeight, |
310 | | - attachmentPickerBottomSheetHeight, |
311 | | - AttachmentPickerError, |
312 | | - attachmentPickerErrorButtonText, |
313 | | - AttachmentPickerErrorImage, |
314 | | - attachmentPickerErrorText, |
315 | | - AttachmentPickerIOSSelectMorePhotos, |
316 | | - attachmentSelectionBarHeight, |
317 | | - ImageOverlaySelectedComponent, |
318 | | - numberOfAttachmentImagesToLoadPerCall, |
319 | | - numberOfAttachmentPickerImageColumns, |
320 | | - ], |
321 | | - ); |
322 | | - |
323 | 277 | const { seconds: cooldownRemainingSeconds } = useCountdown(cooldownEndsAt); |
324 | 278 |
|
325 | 279 | /** |
@@ -670,24 +624,19 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => { |
670 | 624 | <View style={[styles.suggestionsListContainer, { bottom: height }, suggestionListContainer]}> |
671 | 625 | <AutoCompleteSuggestionList /> |
672 | 626 | </View> |
673 | | - {isImageMediaLibraryAvailable() ? ( |
674 | | - <> |
675 | | - {selectedPicker ? ( |
676 | | - <View |
677 | | - style={[ |
678 | | - { |
679 | | - backgroundColor: white_smoke, |
680 | | - height: |
681 | | - attachmentPickerBottomSheetHeight + attachmentSelectionBarHeight - bottomInset, |
682 | | - }, |
683 | | - attachmentSelectionBar, |
684 | | - ]} |
685 | | - > |
686 | | - <AttachmentPickerSelectionBar /> |
687 | | - </View> |
688 | | - ) : null} |
689 | | - {/* <AttachmentPicker ref={bottomSheetRef} {...attachmentPickerProps} /> */} |
690 | | - </> |
| 627 | + {isImageMediaLibraryAvailable() && selectedPicker ? ( |
| 628 | + <View |
| 629 | + style={[ |
| 630 | + { |
| 631 | + backgroundColor: white_smoke, |
| 632 | + height: |
| 633 | + attachmentPickerBottomSheetHeight + attachmentSelectionBarHeight - bottomInset, |
| 634 | + }, |
| 635 | + attachmentSelectionBar, |
| 636 | + ]} |
| 637 | + > |
| 638 | + <AttachmentPickerSelectionBar /> |
| 639 | + </View> |
691 | 640 | ) : null} |
692 | 641 |
|
693 | 642 | {showPollCreationDialog ? ( |
|
0 commit comments