fix: main page issue
This commit is contained in:
parent
944d7210f7
commit
cda646259f
@ -20,9 +20,7 @@ function App(): JSX.Element {
|
|||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route element={<Layout />}>
|
<Route element={<Layout />}>
|
||||||
<Route path={routes.client.root()} element={
|
<Route path={routes.client.root()} element={<MainPage />} />
|
||||||
<Navigate to={routes.client.birthday()} />
|
|
||||||
} />
|
|
||||||
<Route path={routes.client.birthday()} element={<BirthdayPage />} />
|
<Route path={routes.client.birthday()} element={<BirthdayPage />} />
|
||||||
<Route path={routes.client.birthtime()} element={<BirthtimePage />} />
|
<Route path={routes.client.birthtime()} element={<BirthtimePage />} />
|
||||||
<Route path={routes.client.createProfile()} element={<SkipStep />} />
|
<Route path={routes.client.createProfile()} element={<SkipStep />} />
|
||||||
@ -63,4 +61,10 @@ function SkipStep(): JSX.Element {
|
|||||||
return user ? <Navigate to={routes.client.emailEnter()} replace={true} /> : <CreateProfilePage />
|
return user ? <Navigate to={routes.client.emailEnter()} replace={true} /> : <CreateProfilePage />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function MainPage(): JSX.Element {
|
||||||
|
const { user } = useAuth()
|
||||||
|
const page = user ? routes.client.wallpaper() : routes.client.birthday()
|
||||||
|
return <Navigate to={page} replace={true} />
|
||||||
|
}
|
||||||
|
|
||||||
export default App
|
export default App
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 2;
|
line-height: 2;
|
||||||
padding: 10px 0;
|
padding-bottom: 25px;
|
||||||
color: #8e8e93;
|
color: #8e8e93;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,9 @@ function Navbar({ isOpen, closeMenu }: NavbarProps): JSX.Element {
|
|||||||
</div>
|
</div>
|
||||||
<nav className='navbar__nav'>
|
<nav className='navbar__nav'>
|
||||||
{legal?.map((item) => (
|
{legal?.map((item) => (
|
||||||
<Link key={item.type} to={routes.client.legal(item.type)}>{capitalize(item.title)}</Link>
|
<Link key={item.type} to={routes.client.legal(item.type)} onClick={closeMenu}>
|
||||||
|
{capitalize(item.title)}
|
||||||
|
</Link>
|
||||||
))}
|
))}
|
||||||
<a href='#' onClick={closeMenu}>Contact us</a>
|
<a href='#' onClick={closeMenu}>Contact us</a>
|
||||||
<a href='#' onClick={logout}>Log Out</a>
|
<a href='#' onClick={logout}>Log Out</a>
|
||||||
|
|||||||
@ -20,7 +20,7 @@ function StaticPage(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section className='page page-static'>
|
<section className='page page-static'>
|
||||||
{isPending ? <Loader /> : <div dangerouslySetInnerHTML={{ __html: data?.body }} />}
|
{isPending ? <Loader /> : <div className='page-static__content' dangerouslySetInnerHTML={{ __html: data?.body }} />}
|
||||||
{error && <NotFoundPage />}
|
{error && <NotFoundPage />}
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -12,3 +12,7 @@
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-static__content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user