This commit is contained in:
parent
00b8565dba
commit
8dc5ffd39f
@ -4,8 +4,6 @@ NEXT_PUBLIC_GISCUS_CATEGORY=
|
||||
NEXT_PUBLIC_GISCUS_CATEGORY_ID=
|
||||
NEXT_PUBLIC_UTTERANCES_REPO=
|
||||
NEXT_PUBLIC_DISQUS_SHORTNAME=
|
||||
NEXT_PUBLIC_CUSDIS_APPID=
|
||||
NEXT_PUBLIC_CUSDIS_HOST=
|
||||
NEXT_PUBLIC_COMMENTO_URL=
|
||||
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import siteMetadata from '@/data/siteMetadata';
|
||||
import { PostFrontMatter } from 'types/PostFrontMatter';
|
||||
import { ReactCusdis } from 'react-cusdis';
|
||||
import { useTheme } from 'next-themes';
|
||||
|
||||
interface Props {
|
||||
frontMatter: PostFrontMatter;
|
||||
}
|
||||
|
||||
const Cusdis = ({ frontMatter }: Props) => {
|
||||
const { resolvedTheme } = useTheme();
|
||||
const commentsTheme = useMemo(() => {
|
||||
switch (resolvedTheme) {
|
||||
case 'light':
|
||||
case 'dark':
|
||||
return resolvedTheme;
|
||||
default:
|
||||
return 'auto';
|
||||
}
|
||||
}, [resolvedTheme]);
|
||||
return (
|
||||
<div className="my-2">
|
||||
<ReactCusdis
|
||||
key={commentsTheme}
|
||||
lang={siteMetadata.language?.toLocaleLowerCase()}
|
||||
attrs={{
|
||||
appId: siteMetadata.comment.cusdisConfig.appId,
|
||||
host: siteMetadata.comment.cusdisConfig.host,
|
||||
pageId: frontMatter.slug,
|
||||
pageUrl: window.location.href,
|
||||
pageTitle: frontMatter.title,
|
||||
theme: commentsTheme,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Cusdis;
|
@ -26,12 +26,6 @@ const DisqusComponent = dynamic(
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
const CusdisComponent = dynamic(
|
||||
() => {
|
||||
return import('@/components/comments/Cusdis');
|
||||
},
|
||||
{ ssr: false }
|
||||
);
|
||||
const CommentoComponent = dynamic(
|
||||
() => {
|
||||
return import('@/components/comments/Commento');
|
||||
@ -67,9 +61,6 @@ const Comments = ({ frontMatter }: Props) => {
|
||||
{siteMetadata.comment && siteMetadata.comment.provider === 'disqus' && (
|
||||
<DisqusComponent frontMatter={frontMatter} />
|
||||
)}
|
||||
{siteMetadata.comment && siteMetadata.comment.provider === 'cusdis' && (
|
||||
<CusdisComponent frontMatter={frontMatter} />
|
||||
)}
|
||||
{siteMetadata.comment && siteMetadata.comment.provider === 'commento' && (
|
||||
<CommentoComponent frontMatter={frontMatter} />
|
||||
)}
|
||||
|
@ -76,10 +76,6 @@ const siteMetadata = {
|
||||
// https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||
shortname: process.env.NEXT_PUBLIC_DISQUS_SHORTNAME,
|
||||
},
|
||||
cusdisConfig: {
|
||||
appId: process.env.NEXT_PUBLIC_CUSDIS_APPID,
|
||||
host: process.env.NEXT_PUBLIC_CUSDIS_HOST,
|
||||
},
|
||||
commentoConfig: {
|
||||
url: process.env.NEXT_PUBLIC_COMMENTO_URL,
|
||||
},
|
||||
|
@ -1,7 +1,6 @@
|
||||
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
enabled: process.env.ANALYZE === 'true',
|
||||
});
|
||||
const withExportImages = require('next-export-optimize-images');
|
||||
|
||||
// You might need to insert additional domains in script-src if you are using external services
|
||||
const ContentSecurityPolicy = `
|
||||
|
@ -31,7 +31,6 @@
|
||||
"preact": "^10.15.1",
|
||||
"react": "18.2.0",
|
||||
"react-commento": "^1.0.0",
|
||||
"react-cusdis": "^2.1.3",
|
||||
"react-dom": "18.2.0",
|
||||
"reading-time": "1.3.0",
|
||||
"rehype-autolink-headings": "^6.1.1",
|
||||
|
@ -59,9 +59,6 @@ dependencies:
|
||||
react-commento:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
react-cusdis:
|
||||
specifier: ^2.1.3
|
||||
version: 2.1.3(react-dom@18.2.0)(react@18.2.0)
|
||||
react-dom:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0(react@18.2.0)
|
||||
@ -6926,16 +6923,6 @@ packages:
|
||||
react: 16.14.0
|
||||
dev: false
|
||||
|
||||
/react-cusdis@2.1.3(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-fUJOAUY7a3y21fNzlRWUSTr/ZMsejQAYWIWdsNuBPPZHbUrBvke/8Gw4OL5Mlrth7jLw8VTNssX0WBX5/prorQ==}
|
||||
peerDependencies:
|
||||
react: ^17.0.0
|
||||
react-dom: ^17.0.0
|
||||
dependencies:
|
||||
react: 18.2.0
|
||||
react-dom: 18.2.0(react@18.2.0)
|
||||
dev: false
|
||||
|
||||
/react-dom@18.2.0(react@18.2.0):
|
||||
resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
|
||||
peerDependencies:
|
||||
|
Loading…
Reference in New Issue
Block a user