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