From 1700ad751f0471f0c15e1a53692ab8d213a05cd6 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 11 Apr 2024 10:45:57 +0100 Subject: [PATCH] add contentContainer styles to prop --- src/view/com/util/List.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/view/com/util/List.tsx b/src/view/com/util/List.tsx index a3067b45de..7c68db1fd9 100644 --- a/src/view/com/util/List.tsx +++ b/src/view/com/util/List.tsx @@ -32,6 +32,7 @@ function ListImpl( onRefresh, headerOffset, style, + contentContainerStyle, ...props }: ListProps, ref: React.Ref, @@ -86,6 +87,16 @@ function ListImpl( 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 ( ( 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} /> )