2022-11-26 16:51:08 +00:00
|
|
|
import { createEffect, createMemo, createSignal, onMount, Show, Suspense } from 'solid-js'
|
2022-09-09 11:53:35 +00:00
|
|
|
import { FullArticle } from '../Article/FullArticle'
|
|
|
|
import { t } from '../../utils/intl'
|
2022-11-16 06:33:58 +00:00
|
|
|
import type { Shout, Reaction } from '../../graphql/types.gen'
|
|
|
|
import { useReactionsStore } from '../../stores/zine/reactions'
|
2022-09-09 11:53:35 +00:00
|
|
|
|
|
|
|
interface ArticlePageProps {
|
|
|
|
article: Shout
|
2022-11-16 06:33:58 +00:00
|
|
|
reactions?: Reaction[]
|
2022-09-09 11:53:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-22 09:37:49 +00:00
|
|
|
export const ArticleView = (props: ArticlePageProps) => {
|
2022-11-26 16:51:08 +00:00
|
|
|
onMount(() => {
|
|
|
|
const script = document.createElement('script')
|
|
|
|
script.async = true
|
|
|
|
script.src = 'https://ackee.discours.io/increment.js'
|
|
|
|
script.dataset.ackeeServer = 'https://ackee.discours.io'
|
|
|
|
script.dataset.ackeeDomainId = '1004abeb-89b2-4e85-ad97-74f8d2c8ed2d'
|
|
|
|
document.body.appendChild(script)
|
2022-09-09 11:53:35 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
2022-11-23 19:14:59 +00:00
|
|
|
<Show fallback={<div class="center">{t('Loading')}</div>} when={props.article}>
|
|
|
|
<Suspense>
|
2022-11-26 16:51:08 +00:00
|
|
|
<FullArticle article={props.article} />
|
2022-11-23 19:14:59 +00:00
|
|
|
</Suspense>
|
|
|
|
</Show>
|
2022-09-09 11:53:35 +00:00
|
|
|
)
|
|
|
|
}
|