Remove loading for /new
This commit is contained in:
parent
92a16b5a05
commit
171946a38e
1 changed files with 5 additions and 2 deletions
|
@ -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 >
|
||||
|
|
Loading…
Reference in a new issue