Skip to content

Commit

Permalink
Add loading schema spinner to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Apr 26, 2024
1 parent 69abc0c commit 24bc7de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions shared/studio/tabs/dashboard/databaseDashboard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
}
}

.dashboard {
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
justify-content: center;
color: #555;

@include darkTheme {
color: #aaa;
}
}

.dashboardLayout,
.firstDashboardLayout {
display: flex;
Expand Down
8 changes: 7 additions & 1 deletion shared/studio/tabs/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {

import Button from "@edgedb/common/ui/button";
import {CustomScrollbars} from "@edgedb/common/ui/customScrollbar";
import Spinner from "@edgedb/common/ui/spinner";

import {
HeaderDatabaseIcon,
Expand All @@ -41,7 +42,12 @@ export const DatabaseDashboard = observer(function DatabaseDashboard() {
}, [dbState.schemaId]);

if (dbState.schemaId == null) {
return <div className={styles.dashboard} />;
return (
<div className={styles.dashboard}>
<Spinner size={20} />
Loading schema...
</div>
);
}

if (dbState.schemaId.endsWith("__empty")) {
Expand Down

0 comments on commit 24bc7de

Please sign in to comment.