Skip to content

Commit

Permalink
Merge pull request #58 from yunu7067/develop
Browse files Browse the repository at this point in the history
comment component changed from astro to solidjs
  • Loading branch information
yunu7067 authored Dec 30, 2022
2 parents 87e0697 + 1412d5b commit ca03730
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
34 changes: 34 additions & 0 deletions src/components/blog/BlogComment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type {CommentsType, ThemeIdentifiers} from '$types';
import {Show} from 'solid-js';

export interface BlogCommentProps {
comments: CommentsType;
theme: ThemeIdentifiers;
}

export default function BlogComment(props: BlogCommentProps) {
const giscusTheme =
props.theme === 'dark' ? props.comments?.giscus?.darkTheme : props.comments?.giscus?.lightTheme;

return (
<Show when={props.comments.enabled && props.comments.provider == 'giscus'}>
<div id='blog-comment' class='giscus mt-12 mb-8' />
<script
src='https://giscus.app/client.js'
data-repo={props.comments?.giscus?.repo}
data-repo-id={props.comments?.giscus?.repoId}
data-category={props.comments?.giscus?.category}
data-category-id={props.comments?.giscus?.categoryId}
data-mapping={props.comments?.giscus?.mapping || 'pathname'}
data-reactions-enabled={props.comments.giscus?.reactionsEnabled || '1'}
data-emit-metadata={props.comments.giscus?.emitMetadata || '0'}
data-input-position={props.comments.giscus?.inputPosition || 'bottom'}
data-theme={giscusTheme}
data-lang={props.comments.giscus?.lang || 'ko'}
data-loading={props.comments.giscus?.loading || 'lazy'}
crossorigin='anonymous'
async
/>
</Show>
);
}
35 changes: 0 additions & 35 deletions src/components/blog/Comment.astro

This file was deleted.

2 changes: 1 addition & 1 deletion src/layouts/BlogLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {PostInstance} from '$types';
import {Image} from '@astrojs/image/components';
import MainLayout from './MainLayout.astro';
import BlogAuthor from '$coms/blog/Author.astro';
import BlogComment from '$coms/blog/Comment.astro';
import BlogComment from '$coms/blog/BlogComment';
import TableOfContents from '$coms/blog/TableOfContents.astro';
import BlogViews from '$coms/blog/BlogViews';
import Tags from '$coms/blog/Tags.astro';
Expand Down

0 comments on commit ca03730

Please sign in to comment.