Skip to content

Commit 655c43c

Browse files
committed
feat: add loading overlay to DataView
1 parent 6add8b3 commit 655c43c

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
.dataViewContainer {
22
width: 100%;
33
}
4+
5+
.contentWrapper {
6+
position: relative;
7+
transition: opacity 0.2s ease-in-out;
8+
}
9+
10+
.contentWrapper[data-fetching='true'] {
11+
opacity: 0.5;
12+
pointer-events: none;
13+
}

src/components/Common/DataView/DataView.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ export const DataView = <T,>({
5555
containerRef.current = ref
5656
}}
5757
>
58-
{isBreakpointsDetected && (
59-
<Component {...dataViewProps} footer={footer} variant={variant} emptyState={emptyState} />
60-
)}
58+
<div className={styles.contentWrapper} data-fetching={isFetching || undefined}>
59+
{isBreakpointsDetected && (
60+
<Component {...dataViewProps} footer={footer} variant={variant} emptyState={emptyState} />
61+
)}
62+
</div>
6163
{pagination && <PaginationControl {...pagination} isFetching={isFetching} />}
6264
</div>
6365
)

0 commit comments

Comments
 (0)