fix: main page issue

This commit is contained in:
Aidar Shaikhutdin @makeweb.space 2023-05-21 09:32:44 +06:00
parent 944d7210f7
commit cda646259f
5 changed files with 16 additions and 6 deletions

View File

@ -20,9 +20,7 @@ function App(): JSX.Element {
return (
<Routes>
<Route element={<Layout />}>
<Route path={routes.client.root()} element={
<Navigate to={routes.client.birthday()} />
} />
<Route path={routes.client.root()} element={<MainPage />} />
<Route path={routes.client.birthday()} element={<BirthdayPage />} />
<Route path={routes.client.birthtime()} element={<BirthtimePage />} />
<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 />
}
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

View File

@ -3,7 +3,7 @@
font-size: 14px;
font-weight: 400;
line-height: 2;
padding: 10px 0;
padding-bottom: 25px;
color: #8e8e93;
text-align: center;
}

View File

@ -27,7 +27,9 @@ function Navbar({ isOpen, closeMenu }: NavbarProps): JSX.Element {
</div>
<nav className='navbar__nav'>
{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={logout}>Log Out</a>

View File

@ -20,7 +20,7 @@ function StaticPage(): JSX.Element {
return (
<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 />}
</section>
)

View File

@ -12,3 +12,7 @@
margin-top: 10px;
margin-bottom: 10px;
}
.page-static__content {
width: 100%;
}