add contentContainer styles to prop
This commit is contained in:
+12
-11
@@ -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}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user