enable ssr for those
This commit is contained in:
parent
bfd931f98f
commit
d47396bb9c
|
@ -1,14 +1,27 @@
|
||||||
import { PageWrap } from '../_shared/PageWrap'
|
import { PageWrap } from '../_shared/PageWrap'
|
||||||
import { AllAuthorsView } from '../Views/AllAuthors'
|
import { AllAuthorsView } from '../Views/AllAuthors'
|
||||||
import type { PageProps } from '../types'
|
import type { PageProps } from '../types'
|
||||||
import { ClientContainer } from '../_shared/ClientContainer'
|
import { createSignal, onMount, Show } from 'solid-js'
|
||||||
|
import { loadAllAuthors } from '../../stores/zine/authors'
|
||||||
|
import { Loading } from '../Loading'
|
||||||
|
|
||||||
export const AllAuthorsPage = (props: PageProps) => {
|
export const AllAuthorsPage = (props: PageProps) => {
|
||||||
|
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allAuthors))
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
if (isLoaded()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await loadAllAuthors()
|
||||||
|
setIsLoaded(true)
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrap>
|
<PageWrap>
|
||||||
<ClientContainer>
|
<Show when={isLoaded()} fallback={<Loading />}>
|
||||||
<AllAuthorsView authors={props.allAuthors} />
|
<AllAuthorsView authors={props.allAuthors} />
|
||||||
</ClientContainer>
|
</Show>
|
||||||
</PageWrap>
|
</PageWrap>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,27 @@
|
||||||
import { PageWrap } from '../_shared/PageWrap'
|
import { PageWrap } from '../_shared/PageWrap'
|
||||||
import { AllTopicsView } from '../Views/AllTopics'
|
import { AllTopicsView } from '../Views/AllTopics'
|
||||||
import type { PageProps } from '../types'
|
import type { PageProps } from '../types'
|
||||||
import { ClientContainer } from '../_shared/ClientContainer'
|
import { createSignal, onMount, Show } from 'solid-js'
|
||||||
|
import { loadAllTopics } from '../../stores/zine/topics'
|
||||||
|
import { Loading } from '../Loading'
|
||||||
|
|
||||||
export const AllTopicsPage = (props: PageProps) => {
|
export const AllTopicsPage = (props: PageProps) => {
|
||||||
|
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allTopics))
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
if (isLoaded()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await loadAllTopics()
|
||||||
|
setIsLoaded(true)
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrap>
|
<PageWrap>
|
||||||
<ClientContainer>
|
<Show when={isLoaded()} fallback={<Loading />}>
|
||||||
<AllTopicsView topics={props.allTopics} />
|
<AllTopicsView topics={props.allTopics} />
|
||||||
</ClientContainer>
|
</Show>
|
||||||
</PageWrap>
|
</PageWrap>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user