Remove loading for /new

This commit is contained in:
Max Leiter 2022-03-06 19:20:38 -08:00
parent 92a16b5a05
commit 171946a38e
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA

View file

@ -5,10 +5,14 @@ import { Loading, Page } from '@geist-ui/core'
import useSignedIn from '../lib/hooks/use-signed-in'
import Header from '../components/header'
import { ThemeProps } from './_app'
import { useRouter } from 'next/router'
const Home = ({ theme, changeTheme }: ThemeProps) => {
const router = useRouter()
const { isSignedIn, isLoading } = useSignedIn({ redirectIfNotAuthed: true })
if (!isSignedIn && !isLoading) {
router.push("/signin")
}
return (
<Page className={styles.container}>
<Head>
@ -22,7 +26,6 @@ const Home = ({ theme, changeTheme }: ThemeProps) => {
</Page.Header>
<Page.Content width={"var(--main-content-width)"} margin="0 auto" className={styles.main}>
{isLoading && <Loading />}
{isSignedIn && <HomeComponent />}
</Page.Content>
</Page >