Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand table loader overlay and add bg animation #199

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/common/components/Table.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,24 @@ $header-height: 2em;
}
}

@keyframes table-loading {
from {background-color: use-color("base-light");}
to {background-color: use-color("base");}
}

.table-wrapper .loader {
align-items: center;
background-color: use-rgba-color("grey", 0.8);
animation-direction: alternate;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-name: table-loading;
animation-timing-function: linear;
bottom: 0;
color: use-color("white");
display: flex;
justify-content: center;
left: 0;
opacity: 0.5;
padding: 1rem;
pointer-events: none;
position: absolute;
right: 0;
Expand All @@ -75,6 +85,7 @@ $header-height: 2em;
border-collapse: separate;
border-spacing: 0;
height: 100%;
position: relative;
width: 100%;

thead {
Expand Down
16 changes: 8 additions & 8 deletions src/common/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ export const Table = <Datum,>({
{table.getRowModel().rows.length < 1 ? <tr /> : <></>}
</tbody>
{shouldRenderFooter ? <TableFooter table={table} /> : <></>}
<Loader
loading={isLoading}
render={
<div className={classes['loader']} data-testid="table-loader">
<FAIcon icon={faSpinner} spin size={'2x'} />
</div>
}
/>
</table>
<Loader
loading={isLoading}
render={
<div className={classes['loader']} data-testid="table-loader">
<FAIcon icon={faSpinner} spin size={'2x'} />
</div>
}
/>
</div>
</div>
);
Expand Down
Loading