File tree Expand file tree Collapse file tree 3 files changed +4
-22
lines changed
examples/SampleApp/src/components
package/src/components/AttachmentPicker/components Expand file tree Collapse file tree 3 files changed +4
-22
lines changed Original file line number Diff line number Diff line change 1- import React , { useCallback , useState } from 'react' ;
1+ import React , { useState } from 'react' ;
22import {
33 useAttachmentPickerState ,
44 AttachmentPickerContentProps ,
55 AttachmentPickerContent ,
66 AttachmentPickerGenericContent ,
77 useStableCallback ,
8- useTheme ,
98 useTranslationContext ,
109} from 'stream-chat-react-native' ;
1110import { ShareLocationIcon } from '../icons/ShareLocationIcon.tsx' ;
@@ -15,14 +14,6 @@ export const CustomAttachmentPickerContent = (props: AttachmentPickerContentProp
1514 const [ modalVisible , setModalVisible ] = useState ( false ) ;
1615 const { selectedPicker } = useAttachmentPickerState ( ) ;
1716 const { t } = useTranslationContext ( ) ;
18- const {
19- theme : { semantics } ,
20- } = useTheme ( ) ;
21-
22- const Icon = useCallback (
23- ( ) => < ShareLocationIcon stroke = { semantics . textTertiary } /> ,
24- [ semantics . textTertiary ] ,
25- ) ;
2617
2718 const onRequestClose = ( ) => {
2819 setModalVisible ( false ) ;
@@ -36,7 +27,7 @@ export const CustomAttachmentPickerContent = (props: AttachmentPickerContentProp
3627 return (
3728 < >
3829 < AttachmentPickerGenericContent
39- Icon = { Icon }
30+ Icon = { ShareLocationIcon }
4031 onPress = { onOpenModal }
4132 height = { props . height }
4233 buttonText = { t ( 'Share Location' ) }
Original file line number Diff line number Diff line change 1- import React , { useMemo , useState } from 'react' ;
1+ import React , { useMemo } from 'react' ;
22import { StyleSheet , View } from 'react-native' ;
33import {
44 AttachmentTypePickerButton ,
@@ -13,22 +13,15 @@ import {
1313 useTheme ,
1414} from 'stream-chat-react-native' ;
1515import { ShareLocationIcon } from '../icons/ShareLocationIcon' ;
16- import { LiveLocationCreateModal } from './LocationSharing/CreateLocationModal' ;
1716
1817export const CustomAttachmentPickerSelectionBar = ( ) => {
19- const [ modalVisible , setModalVisible ] = useState ( false ) ;
2018 const { attachmentPickerStore } = useAttachmentPickerContext ( ) ;
2119 const { selectedPicker } = useAttachmentPickerState ( ) ;
2220
2321 const styles = useStyles ( ) ;
2422
25- const onRequestClose = ( ) => {
26- setModalVisible ( false ) ;
27- } ;
28-
2923 const onOpenModal = useStableCallback ( ( ) => {
3024 attachmentPickerStore . setSelectedPicker ( 'location' ) ;
31- setModalVisible ( true ) ;
3225 } ) ;
3326
3427 return (
@@ -43,9 +36,6 @@ export const CustomAttachmentPickerSelectionBar = () => {
4336 onPress = { onOpenModal }
4437 selected = { selectedPicker === 'location' }
4538 />
46- { modalVisible ? (
47- < LiveLocationCreateModal visible = { modalVisible } onRequestClose = { onRequestClose } />
48- ) : null }
4939 </ View >
5040 ) ;
5141} ;
Original file line number Diff line number Diff line change @@ -223,6 +223,7 @@ export const AttachmentFilePicker = (props: AttachmentPickerContentProps) => {
223223} ;
224224
225225export type { AttachmentPickerContentProps } from './AttachmentPickerGenericContent' ;
226+ export { AttachmentPickerGenericContent } from './AttachmentPickerGenericContent' ;
226227
227228export const AttachmentPickerContent = ( props : AttachmentPickerContentProps ) => {
228229 const { height } = props ;
You can’t perform that action at this time.
0 commit comments