Skip to content

Commit b5f444d

Browse files
feat(gallery-web): add refreshIndicator to gallery component
1 parent 3e1f6b4 commit b5f444d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/pluggableWidgets/gallery-web/src/Gallery.editorPreview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ function Preview(props: GalleryPreviewProps): ReactElement {
104104
itemEventsController={itemEventsController}
105105
focusController={focusController}
106106
getPosition={getPositionCallback}
107+
showRefreshIndicator={false}
107108
preview
108109
/>
109110
);

packages/pluggableWidgets/gallery-web/src/components/Gallery.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export interface GalleryProps<T extends ObjectItem> {
5252
selectHelper: SelectActionHandler;
5353
getPosition: (index: number) => PositionInGrid;
5454
loadMoreButtonCaption?: string;
55+
showRefreshIndicator: boolean;
5556
}
5657

5758
export function Gallery<T extends ObjectItem>(props: GalleryProps<T>): ReactElement {
@@ -87,7 +88,7 @@ export function Gallery<T extends ObjectItem>(props: GalleryProps<T>): ReactElem
8788
>
8889
<GalleryTopBar>{showTopPagination && pagination}</GalleryTopBar>
8990
{props.showHeader && <GalleryHeader aria-label={props.headerTitle}>{props.header}</GalleryHeader>}
90-
<RefreshIndicator className="mx-refresh-container-padding" />
91+
{props.showRefreshIndicator ? <RefreshIndicator className="mx-refresh-container-padding" /> : null}
9192
<GalleryContent
9293
hasMoreItems={props.hasMoreItems}
9394
setPage={props.setPage}

packages/pluggableWidgets/gallery-web/src/utils/test-utils.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export function createMockGalleryContext(): GalleryRootScope {
7373
pageSize: 10,
7474
stateStorageType: "localStorage",
7575
storeFilters: false,
76-
storeSort: false
76+
storeSort: false,
77+
refreshIndicator: false
7778
});
7879

7980
const mockSelectHelper = new SelectActionHandler("None", undefined);
@@ -149,6 +150,7 @@ export function mockProps(params: Helpers & Mocks = {}): GalleryProps<ObjectItem
149150
header: <input />,
150151
itemEventsController,
151152
focusController,
152-
getPosition: (index: number) => getColumnAndRowBasedOnIndex(3, 3, index)
153+
getPosition: (index: number) => getColumnAndRowBasedOnIndex(3, 3, index),
154+
showRefreshIndicator: false
153155
};
154156
}

0 commit comments

Comments
 (0)