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 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 >
|
||||||
|
|
Loading…
Reference in a new issue