webapp/src/pages/create.page.tsx

25 lines
715 B
TypeScript
Raw Normal View History

2023-03-29 08:51:27 +00:00
import { lazy, Show, Suspense } from 'solid-js'
2023-02-17 09:21:02 +00:00
import { PageLayout } from '../components/_shared/PageLayout'
import { Loading } from '../components/_shared/Loading'
2023-03-29 08:51:27 +00:00
import { useSession } from '../context/session'
2023-02-17 09:21:02 +00:00
const CreateView = lazy(() => import('../components/Views/Create'))
export const CreatePage = () => {
2023-03-29 08:51:27 +00:00
const { isAuthenticated, isSessionLoaded } = useSession()
2023-02-17 09:21:02 +00:00
return (
<PageLayout>
2023-03-29 08:51:27 +00:00
<Show when={isSessionLoaded()}>
<Show when={isAuthenticated()} fallback="Давайте авторизуемся">
<Suspense fallback={<Loading />}>
<CreateView />
</Suspense>
</Show>
</Show>
2023-02-17 09:21:02 +00:00
</PageLayout>
)
}
export const Page = CreatePage