diff --git a/README.md b/README.md
index e8935c2b1..0d86108fc 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# [giscus][giscus]
-A comments widget built on [GitHub Discussions][discussions]. Let visitors sign in with GitHub and leave comments on your website! Heavily inspired by [utterances][utterances].
+A comments system powered by [GitHub Discussions][discussions]. Let visitors leave comments and reactions on your website via GitHub! Heavily inspired by [utterances][utterances].
- [Open source][repo]. 🌏
- No tracking, no ads, always free. 📡 🚫
@@ -15,7 +15,7 @@ A comments widget built on [GitHub Discussions][discussions]. Let visitors sign
## how it works
-When giscus loads, the [GitHub Discussions search API][search-api] is used to find the Discussion associated with the page based on a chosen mapping (URL, `pathname`, `
`, etc.). If a matching discussion cannot be found, the giscus bot will automatically create a discussion the first time someone comments.
+When giscus loads, the [GitHub Discussions search API][search-api] is used to find the Discussion associated with the page based on a chosen mapping (URL, `pathname`, ``, etc.). If a matching discussion cannot be found, the giscus bot will automatically create a discussion the first time someone leaves a comment or reaction.
To comment, visitors must authorize the [giscus app][giscus-app] to [post on their behalf][authorization] using the GitHub OAuth flow. Alternatively, visitors can comment on the GitHub Discussion directly. You can moderate the comments on GitHub.
diff --git a/client.ts b/client.ts
index f8da35a01..f6aa0ea2f 100644
--- a/client.ts
+++ b/client.ts
@@ -42,6 +42,7 @@ const ogDescriptionMeta = document.querySelector(
params.origin = location.href;
params.session = session;
params.theme = attributes.theme;
+params.reactionsEnabled = attributes.reactionsEnabled || '1';
params.repo = attributes.repo;
params.repoId = attributes.repoId;
params.categoryId = attributes.categoryId;
diff --git a/components/CommentBox.tsx b/components/CommentBox.tsx
index b9fd5e625..a5c2f0227 100644
--- a/components/CommentBox.tsx
+++ b/components/CommentBox.tsx
@@ -62,7 +62,7 @@ export default function CommentBox({
}, []);
const handleClick = useCallback(async () => {
- if (isSubmitting) return;
+ if (isSubmitting || (!discussionId && !onDiscussionCreateRequest)) return;
setIsSubmitting(true);
const id = discussionId ? discussionId : await onDiscussionCreateRequest();
diff --git a/components/Configuration.tsx b/components/Configuration.tsx
index 7732b1a53..e0a6dceaa 100644
--- a/components/Configuration.tsx
+++ b/components/Configuration.tsx
@@ -1,7 +1,6 @@
import { CheckIcon, ClippyIcon, SyncIcon, XIcon } from '@primer/octicons-react';
-import { useContext, useEffect, useState } from 'react';
+import { useEffect, useState } from 'react';
import { handleClipboardCopy } from '../lib/adapter';
-import { ThemeContext } from '../lib/context';
import { useDebounce } from '../lib/hooks';
import { ICategory } from '../lib/types/adapter';
import { themeOptions } from '../lib/variables';
@@ -93,7 +92,17 @@ function ClipboardCopy() {
);
}
-export default function Configuration() {
+interface DirectConfig {
+ theme: string;
+ reactionsEnabled: boolean;
+}
+
+interface ConfigurationProps {
+ directConfig: DirectConfig;
+ onDirectConfigChange: (key: keyof DirectConfig, value: DirectConfig[keyof DirectConfig]) => void;
+}
+
+export default function Configuration({ directConfig, onDirectConfigChange }: ConfigurationProps) {
const [repository, setRepository] = useState('');
const [repositoryId, setRepositoryId] = useState('');
const [categoryId, setCategoryId] = useState('');
@@ -101,13 +110,7 @@ export default function Configuration() {
const [categories, setCategories] = useState([]);
const [mapping, setMapping] = useState('pathname');
const [term, setTerm] = useState('');
- const [theme, setTheme] = useState('light');
const dRepository = useDebounce(repository);
- const { setTheme: setGlobalTheme } = useContext(ThemeContext);
-
- useEffect(() => {
- setGlobalTheme(theme);
- }, [setGlobalTheme, theme]);
useEffect(() => {
setError(false);
@@ -154,47 +157,45 @@ export default function Configuration() {
settings tab of the repository.
-
Discussion Category
@@ -221,9 +222,9 @@ export default function Configuration() {
Page ↔️ Discussions Mapping
Choose the mapping between the embedding page and the embedded discussion.