From 72efe406e7456072a792072fdd8336a8510dc22d Mon Sep 17 00:00:00 2001 From: David Abernathy Date: Mon, 11 Mar 2024 15:05:08 -0700 Subject: [PATCH] Add boolean property to deternine the gallery's scroll indicator visibility --- packages/pluggableWidgets/gallery-native/src/Gallery.tsx | 1 + packages/pluggableWidgets/gallery-native/src/Gallery.xml | 4 ++++ .../gallery-native/src/components/Gallery.tsx | 3 +++ .../pluggableWidgets/gallery-native/typings/GalleryProps.d.ts | 2 ++ 4 files changed, 10 insertions(+) diff --git a/packages/pluggableWidgets/gallery-native/src/Gallery.tsx b/packages/pluggableWidgets/gallery-native/src/Gallery.tsx index a32886d77..686ec0f86 100644 --- a/packages/pluggableWidgets/gallery-native/src/Gallery.tsx +++ b/packages/pluggableWidgets/gallery-native/src/Gallery.tsx @@ -118,6 +118,7 @@ export const Gallery = (props: GalleryProps): ReactElement => { pullDown={props.pullDown && pullDown} pullDownIsExecuting={props.pullDown?.isExecuting ?? false} scrollDirection={props.scrollDirection} + showScrollIndicator={props.showScrollIndicator} style={styles} tabletColumns={props.tabletColumns} /> diff --git a/packages/pluggableWidgets/gallery-native/src/Gallery.xml b/packages/pluggableWidgets/gallery-native/src/Gallery.xml index 2f149df77..6a00acf43 100644 --- a/packages/pluggableWidgets/gallery-native/src/Gallery.xml +++ b/packages/pluggableWidgets/gallery-native/src/Gallery.xml @@ -24,6 +24,10 @@ Horizontal + + Show scroll indicator + + diff --git a/packages/pluggableWidgets/gallery-native/src/components/Gallery.tsx b/packages/pluggableWidgets/gallery-native/src/components/Gallery.tsx index 1b27d7313..44c65620e 100644 --- a/packages/pluggableWidgets/gallery-native/src/components/Gallery.tsx +++ b/packages/pluggableWidgets/gallery-native/src/components/Gallery.tsx @@ -23,6 +23,7 @@ export interface GalleryProps { pullDown?: () => void; pullDownIsExecuting?: boolean; scrollDirection: ScrollDirectionEnum; + showScrollIndicator: boolean; style: GalleryStyle; tabletColumns: number; } @@ -130,6 +131,8 @@ export const Gallery = (props: GalleryProps): ReactElem renderItem={renderItem} style={props.style.list} testID={`${props.name}-list`} + showsHorizontalScrollIndicator={!isScrollDirectionVertical && props.showScrollIndicator} + showsVerticalScrollIndicator={isScrollDirectionVertical && props.showScrollIndicator} /> ); diff --git a/packages/pluggableWidgets/gallery-native/typings/GalleryProps.d.ts b/packages/pluggableWidgets/gallery-native/typings/GalleryProps.d.ts index 29e4221cf..5446fa03e 100644 --- a/packages/pluggableWidgets/gallery-native/typings/GalleryProps.d.ts +++ b/packages/pluggableWidgets/gallery-native/typings/GalleryProps.d.ts @@ -25,6 +25,7 @@ export interface GalleryProps