feature: display a message when user is not defined (#196)

* feature: display a message when user is not defined

* feature: display text in a fadein in case redirection is slow
This commit is contained in:
Sammy Teillet
2023-06-05 17:55:45 +02:00
committed by GitHub
parent 4cde1d68e8
commit c70bea9513
3 changed files with 45 additions and 3 deletions

View File

@ -29,11 +29,18 @@ type OwnProps = {
};
export function AppLayout({ children, user }: OwnProps) {
const userIsAuthenticated = !!user;
return (
<ThemeProvider theme={lightTheme}>
<StyledLayout>
<Navbar user={user} workspace={user?.workspaceMember?.workspace} />
<MainContainer>{children}</MainContainer>
{userIsAuthenticated ? (
<>
<Navbar user={user} workspace={user?.workspaceMember?.workspace} />
<MainContainer>{children}</MainContainer>
</>
) : (
children
)}
</StyledLayout>
</ThemeProvider>
);