add sideborders prop (#3920)

zio/stable
Samuel Newman 2024-05-08 21:44:49 +01:00 committed by GitHub
parent 750a5c899b
commit 701e508a1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -250,6 +250,7 @@ export function MessagesList() {
ListHeaderComponent={ ListHeaderComponent={
<MaybeLoader isLoading={convo.isFetchingHistory} /> <MaybeLoader isLoading={convo.isFetchingHistory} />
} }
sideBorders={false}
/> />
</ScrollProvider> </ScrollProvider>
<MessageInput onSendMessage={onSendMessage} scrollToEnd={scrollToEnd} /> <MessageInput onSendMessage={onSendMessage} scrollToEnd={scrollToEnd} />

View File

@ -25,6 +25,7 @@ export type ListProps<ItemT> = Omit<
onRefresh?: () => void onRefresh?: () => void
onItemSeen?: (item: ItemT) => void onItemSeen?: (item: ItemT) => void
containWeb?: boolean containWeb?: boolean
sideBorders?: boolean
} }
export type ListRef = React.MutableRefObject<FlatList_INTERNAL | null> export type ListRef = React.MutableRefObject<FlatList_INTERNAL | null>

View File

@ -23,6 +23,7 @@ export type ListProps<ItemT> = Omit<
onItemSeen?: (item: ItemT) => void onItemSeen?: (item: ItemT) => void
desktopFixedHeight: any // TODO: Better types. desktopFixedHeight: any // TODO: Better types.
containWeb?: boolean containWeb?: boolean
sideBorders?: boolean
} }
export type ListRef = React.MutableRefObject<any | null> // TODO: Better types. export type ListRef = React.MutableRefObject<any | null> // TODO: Better types.
@ -53,6 +54,7 @@ function ListImpl<ItemT>(
renderItem, renderItem,
extraData, extraData,
style, style,
sideBorders = true,
...props ...props
}: ListProps<ItemT>, }: ListProps<ItemT>,
ref: React.Ref<ListMethods>, ref: React.Ref<ListMethods>,
@ -308,7 +310,7 @@ function ListImpl<ItemT>(
<View <View
ref={containerRef} ref={containerRef}
style={[ style={[
!isMobile && styles.sideBorders, !isMobile && sideBorders && styles.sideBorders,
contentContainerStyle, contentContainerStyle,
desktopFixedHeight ? styles.minHeightViewport : null, desktopFixedHeight ? styles.minHeightViewport : null,
pal.border, pal.border,