Skip to content

Commit 3fc471a

Browse files
feat: customize RefreshIndicator to work well on Datagrid and Gallery
1 parent ea4934c commit 3fc471a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

packages/modules/data-widgets/src/themesource/datawidgets/web/_refresh-indicator.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
grid-column: 1 / -1;
33
padding: 0;
44
position: relative;
5+
6+
&-padding {
7+
padding: var(--spacing-small) 0;
8+
}
59
}
610

711
.mx-refresh-indicator {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { RefreshIndicator } from "@mendix/widget-plugin-component-kit/RefreshIndicator";
12
import { Pagination } from "@mendix/widget-plugin-grid/components/Pagination";
23
import { KeyNavProvider } from "@mendix/widget-plugin-grid/keyboard-navigation/context";
34
import { FocusTargetController } from "@mendix/widget-plugin-grid/keyboard-navigation/FocusTargetController";
@@ -86,6 +87,7 @@ export function Gallery<T extends ObjectItem>(props: GalleryProps<T>): ReactElem
8687
>
8788
<GalleryTopBar>{showTopPagination && pagination}</GalleryTopBar>
8889
{props.showHeader && <GalleryHeader aria-label={props.headerTitle}>{props.header}</GalleryHeader>}
90+
<RefreshIndicator className="mx-refresh-container-padding" />
8991
<GalleryContent
9092
hasMoreItems={props.hasMoreItems}
9193
setPage={props.setPage}

packages/shared/widget-plugin-component-kit/src/RefreshIndicator.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
import classNames from "classnames";
12
import { createElement, ReactElement } from "react";
23

3-
export function RefreshIndicator(): ReactElement {
4+
type RefreshIndicatorProps = {
5+
className?: string;
6+
};
7+
8+
export function RefreshIndicator({ className }: RefreshIndicatorProps): ReactElement {
49
return (
510
<div className="tr" role="row">
6-
<div className="th mx-refresh-container">
11+
<div className={classNames("th mx-refresh-container", className)}>
712
<progress className="mx-refresh-indicator" />
813
</div>
914
</div>

0 commit comments

Comments
 (0)