diff --git a/.eslintignore b/.eslintignore index b896d136..37584469 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,5 @@ public *.cjs src/graphql/*.gen.ts src/legacy_* +dist/ +.vercel/ diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 00000000..fd2fbae2 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,2 @@ +.vercel/ +dist/ diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index a5e83d5c..6ebfe41c 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -9,6 +9,7 @@ import { t } from '../../utils/intl' // import { createReaction, updateReaction, deleteReaction } from '../../stores/zine/reactions' import { renderMarkdown } from '@astrojs/markdown-remark' import { markdownOptions } from '../../../mdx.config' +import { deleteReaction } from '../../stores/zine/reactions' export default (props: { level?: number @@ -20,16 +21,16 @@ export default (props: { const [body, setBody] = createSignal('') onMount(() => { const b: string = props.comment?.body - if (b?.toString().startsWith('<')) setBody(b) - else { + if (b?.toString().startsWith('<')) { + setBody(b) + } else { renderMarkdown(b, markdownOptions).then(({ code }) => setBody(code)) } }) const remove = () => { if (comment()?.id) { console.log('[comment] removing', comment().id) - // FIXME - // deleteReaction(comment().id) + deleteReaction(comment().id) } } @@ -79,7 +80,7 @@ export default (props: { - {/*FIXME*/} + {/*FIXME implement edit comment modal*/} {/* showModal('editComment')}*/} @@ -93,7 +94,7 @@ export default (props: { - {/*FIXME*/} + {/*FIXME implement modals */} {/* showModal('shareComment')}*/} diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 5f3a3233..b49b6a2e 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -9,6 +9,9 @@ import { t } from '../../utils/intl' import { showModal } from '../../stores/ui' import { renderMarkdown } from '@astrojs/markdown-remark' import { markdownOptions } from '../../../mdx.config' +import { useStore } from '@nanostores/solid' +import { session } from '../../stores/auth' + const MAX_COMMENT_LEVEL = 6 const getCommentLevel = (comment: Reaction, level = 0) => { @@ -36,10 +39,14 @@ const formatDate = (date: Date) => { export const FullArticle = (props: ArticleProps) => { const [body, setBody] = createSignal('') + + const auth = useStore(session) + onMount(() => { const b: string = props.article?.body - if (b?.toString().startsWith('<')) setBody(b) - else { + if (b?.toString().startsWith('<')) { + setBody(b) + } else { renderMarkdown(b, markdownOptions).then(({ code }) => setBody(code)) } }) @@ -136,16 +143,15 @@ export const FullArticle = (props: ArticleProps) => {
{formattedDate}
- {/*FIXME*/} - {/*
*/} - {/* */} - {/* {(topic) => (*/} - {/* */} - {/* )}*/} - {/* */} - {/*
*/} +
+ + {(topic) => ( + + )} + +
1}> @@ -166,32 +172,28 @@ export const FullArticle = (props: ArticleProps) => { )} - - {/*FIXME*/} - {/**/} - {/*
*/} - {/* {t('To leave a comment you please')}*/} - {/* {*/} - {/* evt.preventDefault()*/} - {/* showModal('auth')*/} - {/* }}*/} - {/* >*/} - {/* {t('sign up or sign in')}*/} - {/* */} - {/*
*/} - {/*
*/} - {/**/} - {/*