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,
headerOffset,
style,
contentContainerStyle,
...props
}: ListProps<ItemT>,
ref: React.Ref<ListMethods>,
@@ -86,6 +87,16 @@ function ListImpl<ItemT>(
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 (
<FlatList_INTERNAL
{...props}
@@ -94,18 +105,8 @@ function ListImpl<ItemT>(
refreshControl={refreshControl}
onScroll={scrollHandler}
scrollEventThrottle={1}
contentContainerStyle={
isNativeTablet && [
{
marginLeft: (width - 600) / 2 - 77,
marginRight: (width - 600) / 2,
borderLeftWidth: 1,
borderRightWidth: 1,
},
pal.border,
]
}
style={style}
contentContainerStyle={contentContainerStyle}
ref={ref}
/>
)