mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-17 17:35:31 -04:00
next-mdx-remote v4 (#737)
This commit is contained in:
6
components/Comments/Comments.module.css
Normal file
6
components/Comments/Comments.module.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.wrapper :global(.giscus) {
|
||||
margin-top: 2em;
|
||||
padding-top: 2em;
|
||||
border-top: 2px solid var(--light);
|
||||
min-height: 350px;
|
||||
}
|
29
components/Comments/Comments.tsx
Normal file
29
components/Comments/Comments.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { useTheme } from "next-themes";
|
||||
import { Giscus } from "@giscus/react";
|
||||
import { giscusConfig } from "../../lib/config";
|
||||
import type { GiscusProps } from "@giscus/react";
|
||||
|
||||
import styles from "./Comments.module.css";
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
};
|
||||
|
||||
const Comments = ({ title }: Props) => {
|
||||
const { resolvedTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<Giscus
|
||||
{...(giscusConfig as GiscusProps)}
|
||||
term={title}
|
||||
mapping="specific"
|
||||
reactionsEnabled="1"
|
||||
emitMetadata="0"
|
||||
theme={resolvedTheme === "dark" ? "dark" : "light"}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Comments;
|
Reference in New Issue
Block a user