diff --git a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx index bc0fcc8e8..b873e07fc 100644 --- a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx @@ -10,12 +10,11 @@ import Container from "layouts/container"; import AppHeader from "layouts/app-layout/app-header"; import AppSidebar from "layouts/app-layout/app-sidebar"; import SettingsNavbar from "layouts/settings-navbar"; -import { WorkspaceAuthorizationLayout } from "./workspace-authorization-wrapper"; // components import { NotAuthorizedView, JoinProject } from "components/auth-screens"; import { CommandPalette } from "components/command-palette"; // ui -import { PrimaryButton } from "components/ui"; +import { PrimaryButton, Spinner } from "components/ui"; // icons import { LayerDiagonalIcon } from "components/icons"; @@ -63,82 +62,79 @@ const ProjectAuthorizationWrapped: React.FC = ({ const settingsLayout = router.pathname.includes("/settings"); return ( - - - -
- - {loading ? ( -
-

Loading...

+ + +
+ + {loading ? ( +
+
+

Setting up your project...

+
- ) : error?.status === 401 || error?.status === 403 ? ( - - ) : error?.status === 404 ? ( -
-
-

No such project exist. Create one?

- { - const e = new KeyboardEvent("keydown", { key: "p" }); - document.dispatchEvent(e); - }} - > - Create project - -
-
- ) : settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? ( - - - - Go to issues - - - - } - type="project" - /> - ) : ( -
- {!noHeader && ( - - )} -
+ ) : error?.status === 401 || error?.status === 403 ? ( + + ) : error?.status === 404 ? ( +
+
+

No such project exist. Create one?

+ { + const e = new KeyboardEvent("keydown", { key: "p" }); + document.dispatchEvent(e); + }} > - {settingsLayout && ( -
-
-

Project Settings

-

- This information will be displayed to every member of the project. -

-
- + Create project + +
+
+ ) : settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? ( + + + + Go to issues + + + + } + type="project" + /> + ) : ( +
+ {!noHeader && ( + + )} +
+ {settingsLayout && ( +
+
+

Project Settings

+

+ This information will be displayed to every member of the project. +

- )} - {children} -
-
- )} -
- - + +
+ )} + {children} +
+ + )} +
+
); }; diff --git a/apps/app/layouts/auth-layout/user-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/user-authorization-wrapper.tsx index 98375c1e0..533689008 100644 --- a/apps/app/layouts/auth-layout/user-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/user-authorization-wrapper.tsx @@ -1,8 +1,13 @@ +import { useRouter } from "next/router"; + import useSWR from "swr"; -import { CURRENT_USER } from "constants/fetch-keys"; +// services import userService from "services/user.service"; -import { useRouter } from "next/router"; +// ui +import { Spinner } from "components/ui"; +// fetch-keys +import { CURRENT_USER } from "constants/fetch-keys"; type Props = { children: React.ReactNode; @@ -14,7 +19,14 @@ export const UserAuthorizationLayout: React.FC = ({ children }) => { const { data: currentUser, error } = useSWR(CURRENT_USER, () => userService.currentUser()); if (!currentUser && !error) { - return
Loading...
; + return ( +
+
+

Loading your profile...

+ +
+
+ ); } if (error?.status === 401) { diff --git a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx index f9af96a2c..8803653e5 100644 --- a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx @@ -12,15 +12,15 @@ import Container from "layouts/container"; import AppSidebar from "layouts/app-layout/app-sidebar"; import AppHeader from "layouts/app-layout/app-header"; import SettingsNavbar from "layouts/settings-navbar"; +import { UserAuthorizationLayout } from "./user-authorization-wrapper"; // components import { NotAuthorizedView, NotAWorkspaceMember } from "components/auth-screens"; import { CommandPalette } from "components/command-palette"; // icons -import { PrimaryButton } from "components/ui"; +import { PrimaryButton, Spinner } from "components/ui"; import { LayerDiagonalIcon } from "components/icons"; // fetch-keys import { WORKSPACE_MEMBERS_ME } from "constants/fetch-keys"; -import { UserAuthorizationLayout } from "./user-authorization-wrapper"; type Meta = { title?: string | null; @@ -69,10 +69,12 @@ export const WorkspaceAuthorizationLayout: React.FC = ({ ); if (!workspaceMemberMe && !error) - // TODO: show good loading UI return ( -
-

Loading...

+
+
+

Setting up your workspace...

+ +
); diff --git a/apps/app/pages/signin.tsx b/apps/app/pages/signin.tsx index 323e3142e..b9244c1ac 100644 --- a/apps/app/pages/signin.tsx +++ b/apps/app/pages/signin.tsx @@ -99,7 +99,7 @@ const SignInPage: NextPage = () => { > {isLoading && (
-

Signing in. Please wait...

+

Signing in. Please wait...

)}