Skip to content

Commit 938e4d6

Browse files
chore: improve bottom sheet scrollables
1 parent b27e33d commit 938e4d6

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/design-system/bottomSheets/BottomSheet.web.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Modal } from '@baca/components/Modal'
2-
import { useBoolean, useWeb } from '@baca/hooks'
2+
import { useBoolean } from '@baca/hooks'
33
import { useCallback, useImperativeHandle } from 'react'
44
import { ScrollView } from 'react-native'
55

@@ -18,7 +18,6 @@ export const BottomSheet = ({
1818
bottomSheetRef,
1919
}: BottomSheetProps) => {
2020
const [isOpen, setIsOpen] = useBoolean(false)
21-
const { webContentWidth } = useWeb()
2221

2322
useImperativeHandle(bottomSheetRef, () => ({
2423
snapToPosition: (index: string | number) => {
@@ -46,11 +45,13 @@ export const BottomSheet = ({
4645
<Modal transparent visible={isOpen} onRequestClose={closeModalHandler}>
4746
<Box
4847
mx="auto"
48+
my={8}
4949
bg="bg.primary"
5050
borderRadius={8}
5151
borderColor={'border.primary'}
5252
borderWidth={1}
53-
maxW={webContentWidth}
53+
width="90%"
54+
maxWidth={500}
5455
>
5556
<BottomSheetHeader
5657
title={title}

src/design-system/bottomSheets/BottomSheetFlashList.tsx

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/design-system/bottomSheets/BottomSheetFlashList.web.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/design-system/bottomSheets/BottomSheetScrollables.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
// Could be connected to this: https://github.com/gorhom/react-native-bottom-sheet/issues/1760
44
// After upgrading bottom sheet library try changing the imports, maybe it will work as expected
55
// import { BottomSheetScrollView as ScrollView, BottomSheetFlashList as FlashList, BottomSheetSectionList as SectionList } from "@gorhom/bottom-sheet";
6-
import { FlashList } from '@shopify/flash-list'
7-
import { SectionList } from 'react-native'
8-
import { ScrollView } from 'react-native-gesture-handler'
6+
import { FlatList as RNFlatList, Platform, SectionList } from 'react-native'
7+
import { ScrollView, FlatList } from 'react-native-gesture-handler'
98

109
export const BottomSheetScrollView = ScrollView
11-
export const BottomSheetFlashList = FlashList
10+
export const BottomSheetFlatList = Platform.OS === 'web' ? RNFlatList : FlatList
1211
export const BottomSheetSectionList = SectionList

0 commit comments

Comments
 (0)