add contentContainer styles to prop

This commit is contained in:
Samuel Newman
2024-04-11 10:45:57 +01:00
parent 776e0c5a9f
commit 1700ad751f
+12 -11
View File
@@ -32,6 +32,7 @@ function ListImpl<ItemT>(
onRefresh, onRefresh,
headerOffset, headerOffset,
style, style,
contentContainerStyle,
...props ...props
}: ListProps<ItemT>, }: ListProps<ItemT>,
ref: React.Ref<ListMethods>, ref: React.Ref<ListMethods>,
@@ -86,6 +87,16 @@ function ListImpl<ItemT>(
contentOffset = {x: 0, y: headerOffset * -1} contentOffset = {x: 0, y: headerOffset * -1}
} }
if (isNativeTablet && width > 677) {
contentContainerStyle = addStyle(contentContainerStyle, {
marginLeft: (width - 600) / 2 - 77,
marginRight: (width - 600) / 2,
borderLeftWidth: 1,
borderRightWidth: 1,
...pal.border,
})
}
return ( return (
<FlatList_INTERNAL <FlatList_INTERNAL
{...props} {...props}
@@ -94,18 +105,8 @@ function ListImpl<ItemT>(
refreshControl={refreshControl} refreshControl={refreshControl}
onScroll={scrollHandler} onScroll={scrollHandler}
scrollEventThrottle={1} scrollEventThrottle={1}
contentContainerStyle={
isNativeTablet && [
{
marginLeft: (width - 600) / 2 - 77,
marginRight: (width - 600) / 2,
borderLeftWidth: 1,
borderRightWidth: 1,
},
pal.border,
]
}
style={style} style={style}
contentContainerStyle={contentContainerStyle}
ref={ref} ref={ref}
/> />
) )