Skip to content

Instantly share code, notes, and snippets.

@antonkalik
Last active September 4, 2022 17:37
Show Gist options
  • Save antonkalik/c1230b904571bfe993905a515cf52cfc to your computer and use it in GitHub Desktop.
Save antonkalik/c1230b904571bfe993905a515cf52cfc to your computer and use it in GitHub Desktop.
The wrapper for routes
const MainLayout = ({ navigate }) => {
const session = useSession();
return (
<StyledMainLayout>
{!session.loading ? (
<div>
<Navigation session={session} navigate={navigate} />
<StyledContainer isLoggedIn={!!session.data}>
<Outlet context={session} />
</StyledContainer>
</div>
) : (
<Loading />
)}
<Footer />
</StyledMainLayout>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment