webapp/src/pages/allAuthors.page.tsx

32 lines
798 B
TypeScript
Raw Normal View History

2023-02-17 09:21:02 +00:00
import type { PageProps } from './types'
import { createSignal, onMount } from 'solid-js'
import { PageLayout } from '../components/_shared/PageLayout'
import { AllAuthorsView } from '../components/Views/AllAuthors'
2023-05-05 20:05:50 +00:00
import { useLocalize } from '../context/localize'
import { loadAllAuthors } from '../stores/zine/authors'
2022-09-22 09:37:49 +00:00
export const AllAuthorsPage = (props: PageProps) => {
2022-11-15 09:38:12 +00:00
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allAuthors))
2023-05-05 20:05:50 +00:00
const { t } = useLocalize()
2022-11-15 09:38:12 +00:00
onMount(async () => {
if (isLoaded()) {
return
}
2023-12-26 23:28:26 +00:00
await loadAllAuthors()
2022-11-15 09:38:12 +00:00
setIsLoaded(true)
})
2022-09-22 09:37:49 +00:00
return (
<PageLayout title={t('Authors')}>
<AllAuthorsView isLoaded={isLoaded()} authors={props.allAuthors} />
2023-02-17 09:21:02 +00:00
</PageLayout>
2022-09-22 09:37:49 +00:00
)
}
2023-02-17 09:21:02 +00:00
export const Page = AllAuthorsPage