diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-10-29 14:32:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-29 12:32:10 +0000 |
commit | 80c5f23da274adb9270a024e7f0e84e09b8f575e (patch) | |
tree | 4906deca8217827539b4f40d8e1fae9a2e5c87d3 /src/components/Dialog | |
parent | 2502c91dee7cad7c990e412b9acda8f54e2df14b (diff) | |
download | voidsky-80c5f23da274adb9270a024e7f0e84e09b8f575e.tar.zst |
Fix double padding in `Dialog.InnerFlatList` on web (#5986)
* remove extra padding on web * pass prop
Diffstat (limited to 'src/components/Dialog')
-rw-r--r-- | src/components/Dialog/index.tsx | 5 | ||||
-rw-r--r-- | src/components/Dialog/index.web.tsx | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 8b43a85e4..c860c4dcf 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -267,7 +267,10 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>( export const InnerFlatList = React.forwardRef< ListMethods, - ListProps<any> & {webInnerStyle?: StyleProp<ViewStyle>} + ListProps<any> & { + webInnerStyle?: StyleProp<ViewStyle> + webInnerContentContainerStyle?: StyleProp<ViewStyle> + } >(function InnerFlatList({style, ...props}, ref) { const insets = useSafeAreaInsets() const {nativeSnapPoint, disableDrag, setDisableDrag} = useDialogContext() diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 43cb95b03..41a39ffda 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -210,21 +210,26 @@ export const ScrollableInner = Inner export const InnerFlatList = React.forwardRef< FlatList, - FlatListProps<any> & {label: string} & {webInnerStyle?: StyleProp<ViewStyle>} ->(function InnerFlatList({label, style, webInnerStyle, ...props}, ref) { + FlatListProps<any> & {label: string} & { + webInnerStyle?: StyleProp<ViewStyle> + webInnerContentContainerStyle?: StyleProp<ViewStyle> + } +>(function InnerFlatList( + {label, style, webInnerStyle, webInnerContentContainerStyle, ...props}, + ref, +) { const {gtMobile} = useBreakpoints() return ( <Inner label={label} style={[ + a.overflow_hidden, + a.px_0, // @ts-ignore web only -sfn - { - paddingHorizontal: 0, - maxHeight: 'calc(-36px + 100vh)', - overflow: 'hidden', - }, + {maxHeight: 'calc(-36px + 100vh)'}, webInnerStyle, - ]}> + ]} + contentContainerStyle={[a.px_0, webInnerContentContainerStyle]}> <FlatList ref={ref} style={[gtMobile ? a.px_2xl : a.px_xl, flatten(style)]} |