From dfc797fe58cc7b8a125c64fff83a5c169d2aba81 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 13 Sep 2022 21:09:58 +0800 Subject: [PATCH] chore: add loading spin --- web/src/pages/Home.tsx | 29 +++++++++++--------- web/src/pages/WorkspaceDetail.tsx | 45 +++++++++++++++++-------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index 1168123..5d91142 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -20,20 +20,25 @@ const Home: React.FC = () => { return (
- {loadingState.isLoading ? null : ( -
-
- Workspace List -
showCreateWorkspaceDialog()} - > - Create Workspace -
+
+
+ Workspace List +
showCreateWorkspaceDialog()} + > + Create Workspace
-
- )} + {loadingState.isLoading ? ( +
+ + loading +
+ ) : ( + + )} +
); }; diff --git a/web/src/pages/WorkspaceDetail.tsx b/web/src/pages/WorkspaceDetail.tsx index 9c3b949..3b065a2 100644 --- a/web/src/pages/WorkspaceDetail.tsx +++ b/web/src/pages/WorkspaceDetail.tsx @@ -46,27 +46,32 @@ const WorkspaceDetail: React.FC = () => { return (
- {loadingState.isLoading ? null : ( -
-
- handleBackToHome()}> - Home - - / - Workspace: {state?.workspace.name} -
-
- Shortcut List -
showCreateShortcutDialog(state.workspace.id)} - > - Create Shortcut -
-
- +
+
+ handleBackToHome()}> + Home + + / + Workspace: {state?.workspace.name}
- )} +
+ Shortcut List +
showCreateShortcutDialog(state.workspace.id)} + > + Create Shortcut +
+
+ {loadingState.isLoading ? ( +
+ + loading +
+ ) : ( + + )} +
); };