0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00

Merge pull request #1072 from logto-io/charles-log-2881-improve-table-error-display

refactor(console): table error display
This commit is contained in:
Charles Zhao 2022-06-07 22:43:11 +08:00 committed by GitHub
commit 2db7e6af21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 15 deletions

View file

@ -1,8 +1,10 @@
@use '@/scss/underscore' as _;
.tableEmpty {
display: flex;
flex-direction: column;
align-items: center;
padding: _.unit(4) 0;
text-align: center;
.title {
font: var(--font-subhead-2);

View file

@ -1,22 +1,21 @@
@use '@/scss/underscore' as _;
.tableError {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
.image {
text-align: center;
> *:not(:first-child) {
margin-top: _.unit(2);
}
.title {
text-align: center;
font: var(--font-subhead-2);
margin-bottom: _.unit(2);
}
.content {
text-align: center;
font: var(--font-body-medium);
color: var(--color-neutral-50);
margin-bottom: _.unit(2);
}
}

View file

@ -20,9 +20,7 @@ const TableError = ({ title, content, onRetry, columns }: Props) => {
<tr>
<td colSpan={columns}>
<div className={styles.tableError}>
<div className={styles.image}>
<img src={ErrorImage} />
</div>
<img src={ErrorImage} />
<div className={styles.title}>
{title ?? t('admin_console.errors.something_went_wrong')}
</div>

View file

@ -73,7 +73,7 @@ const ApiResources = () => {
</Modal>
</div>
<div className={classNames(styles.table, tableStyles.scrollable)}>
<table>
<table className={classNames(!data && tableStyles.empty)}>
<colgroup>
<col className={styles.apiResourceName} />
<col />

View file

@ -70,7 +70,7 @@ const Applications = () => {
</Modal>
</div>
<div className={classNames(styles.table, tableStyles.scrollable)}>
<table>
<table className={classNames(!data && tableStyles.empty)}>
<colgroup>
<col className={styles.applicationName} />
<col />

View file

@ -64,7 +64,7 @@ const AuditLogs = () => {
</div>
</div>
<div className={classNames(styles.table, tableStyles.scrollable)}>
<table>
<table className={classNames(!data && tableStyles.empty)}>
<colgroup>
<col className={styles.eventName} />
<col />

View file

@ -72,7 +72,7 @@ const Connectors = () => {
<TabNavItem href="/connectors/social">{t('connectors.tab_social')}</TabNavItem>
</TabNav>
<div className={classNames(styles.table, tableStyles.scrollable)}>
<table>
<table className={classNames(!data && tableStyles.empty)}>
<colgroup>
<col className={styles.connectorName} />
<col />

View file

@ -81,7 +81,7 @@ const Users = () => {
/>
</div>
<div className={classNames(styles.table, tableStyles.scrollable)}>
<table>
<table className={classNames(!data && tableStyles.empty)}>
<colgroup>
<col className={styles.userName} />
<col />

View file

@ -31,3 +31,7 @@ tr.clickable {
}
}
}
.empty {
height: 100%;
}