forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import React, {type ReactNode} from 'react'
2import {FlatList, Modal, ScrollView, TextInput, View} from 'react-native'
3
4const BottomSheetModalContext = React.createContext(null)
5BottomSheetModalContext.displayName = 'BottomSheetModalContext'
6
7const BottomSheetModalProvider = (props: any) => {
8 return <BottomSheetModalContext.Provider {...props} value={{}} />
9}
10class BottomSheet extends React.Component<{
11 onClose?: () => void
12 children?: ReactNode
13}> {
14 snapToIndex() {}
15 snapToPosition() {}
16 expand() {}
17 collapse() {}
18 close() {
19 this.props.onClose?.()
20 }
21 forceClose() {}
22
23 render() {
24 return <View>{this.props.children}</View>
25 }
26}
27const BottomSheetModal = (props: any) => <Modal {...props} />
28
29const BottomSheetBackdrop = (props: any) => <View {...props} />
30const BottomSheetHandle = (props: any) => <View {...props} />
31const BottomSheetFooter = (props: any) => <View {...props} />
32const BottomSheetScrollView = (props: any) => <ScrollView {...props} />
33const BottomSheetFlatList = (props: any) => <FlatList {...props} />
34const BottomSheetTextInput = (props: any) => <TextInput {...props} />
35
36const useBottomSheet = jest.fn()
37const useBottomSheetModal = jest.fn()
38const useBottomSheetSpringConfigs = jest.fn()
39const useBottomSheetTimingConfigs = jest.fn()
40const useBottomSheetInternal = jest.fn()
41const useBottomSheetDynamicSnapPoints = jest.fn()
42
43export {useBottomSheet}
44export {useBottomSheetModal}
45export {useBottomSheetSpringConfigs}
46export {useBottomSheetTimingConfigs}
47export {useBottomSheetInternal}
48export {useBottomSheetDynamicSnapPoints}
49
50export {
51 BottomSheetBackdrop,
52 BottomSheetFlatList,
53 BottomSheetFooter,
54 BottomSheetHandle,
55 BottomSheetModal,
56 BottomSheetModalProvider,
57 BottomSheetScrollView,
58 BottomSheetTextInput,
59}
60
61export default BottomSheet