put loading spinner inside table as proposed by PF (#418)

This commit is contained in:
Erik Jan de Wit 2021-03-09 07:34:39 +01:00 committed by GitHub
parent ad1fa1340f
commit 4ba5fcc723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,6 @@ export function KeycloakDataTable<T>({
return (
<>
{!rows && <Loading />}
{rows && (rows.length > 0 || !emptyState) && isPaginated && (
<PaginatingTableToolbar
count={rows.length}
@ -263,6 +262,7 @@ export function KeycloakDataTable<T>({
searchTypeComponent={searchTypeComponent}
toolbarItem={toolbarItem}
>
{!loading && (
<DataTable
canSelectAll={canSelectAll}
onSelect={onSelect ? _onSelect : undefined}
@ -272,6 +272,7 @@ export function KeycloakDataTable<T>({
columns={columns}
ariaLabelKey={ariaLabelKey}
/>
)}
{loading && <Loading />}
</PaginatingTableToolbar>
)}
@ -286,6 +287,7 @@ export function KeycloakDataTable<T>({
toolbarItem={toolbarItem}
searchTypeComponent={searchTypeComponent}
>
{!loading && (
<DataTable
canSelectAll={canSelectAll}
onSelect={onSelect ? _onSelect : undefined}
@ -295,6 +297,8 @@ export function KeycloakDataTable<T>({
columns={columns}
ariaLabelKey={ariaLabelKey}
/>
)}
{loading && <Loading />}
</TableToolbar>
)}
<>{!loading && rows?.length === 0 && emptyState}</>