mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): improve org settings page
This commit is contained in:
parent
c4826556d9
commit
929f2d6c37
4 changed files with 44 additions and 33 deletions
|
@ -20,7 +20,7 @@
|
|||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
gap: _.unit(2);
|
||||
padding: _.unit(2) _.unit(3);
|
||||
padding: _.unit(1.5) _.unit(3);
|
||||
cursor: text;
|
||||
|
||||
.tag {
|
||||
|
|
|
@ -110,7 +110,7 @@ function RoleModal({ isOpen, editData, onClose }: Props) {
|
|||
</FormField>
|
||||
<FormField title="general.description">
|
||||
<TextInput
|
||||
placeholder="organizations.create_role_placeholder"
|
||||
placeholder={t('organizations.create_role_placeholder')}
|
||||
error={Boolean(errors.description)}
|
||||
{...register('description')}
|
||||
/>
|
||||
|
|
|
@ -7,3 +7,7 @@
|
|||
.table {
|
||||
margin-top: _.unit(3);
|
||||
}
|
||||
|
||||
.spinner {
|
||||
margin: _.unit(2) 0;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import CirclePlus from '@/assets/icons/circle-plus.svg';
|
|||
import Plus from '@/assets/icons/plus.svg';
|
||||
import EmptyDataPlaceholder from '@/components/EmptyDataPlaceholder';
|
||||
import Button from '@/ds-components/Button';
|
||||
import { Ring as Spinner } from '@/ds-components/Spinner';
|
||||
import Table from '@/ds-components/Table';
|
||||
import { type Column } from '@/ds-components/Table/types';
|
||||
|
||||
|
@ -39,10 +40,15 @@ function TemplateTable<
|
|||
isLoading,
|
||||
onPageChange,
|
||||
}: Props<TFieldValues, TName>) {
|
||||
const hasData = data.length > 0;
|
||||
const hasData = !isLoading && data.length > 0;
|
||||
|
||||
if (isLoading) {
|
||||
<Spinner className={styles.spinner} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{hasData && (
|
||||
<Table
|
||||
hasBorder
|
||||
placeholder={<EmptyDataPlaceholder />}
|
||||
|
@ -73,6 +79,7 @@ function TemplateTable<
|
|||
/>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{onAdd && !hasData && (
|
||||
<Button
|
||||
className={styles.addButton}
|
||||
|
|
Loading…
Reference in a new issue