-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Giscus comment/like React component for blog #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||||||
import Giscus from "@giscus/react"; | ||||||||
|
||||||||
export default function Comment() { | ||||||||
return ( | ||||||||
<> | ||||||||
<br /> | ||||||||
<hr /> | ||||||||
<br /> | ||||||||
{process.env.NEXT_PUBLIC_REPO && process.env.NEXT_PUBLIC_REPO_ID && process.env.NEXT_PUBLIC_CATEGORY_ID ? ( | ||||||||
<Giscus | ||||||||
repo= {process.env.NEXT_PUBLIC_REPO as `${string}/${string}`} | ||||||||
repoId= {process.env.NEXT_PUBLIC_REPO_ID} | ||||||||
category="Announcements" | ||||||||
categoryId= {process.env.NEXT_PUBLIC_CATEGORY_ID} | ||||||||
mapping="pathname" | ||||||||
reactionsEnabled="1" | ||||||||
emitMetadata="0" | ||||||||
theme="dark" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we set this dynamically? Example: watcloud-website/components/ui/sonner.tsx Line 11 in f9c283f
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have any context as to how the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, even if I load the page with light mode the variable is still showing up as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, perhaps try this approach instead? I do remember one of these approaches didn't work as expected during development, but didn't look too deeply into it. watcloud-website/components/assets.tsx Lines 202 to 203 in f9c283f
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seemed to work. I'll create a new PR once I have access to the infra-config repo. Thanks for the help! |
||||||||
/> | ||||||||
) : null} | ||||||||
</> | ||||||||
); | ||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"homepage": "https://github.com/WATonomous/infra-config#readme", | ||
"description": "A website for WATcloud", | ||
"dependencies": { | ||
"@giscus/react": "^3.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there no changes in package-lock.json? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes there was I'll add it |
||
"@hookform/resolvers": "^3.3.3", | ||
"@radix-ui/react-alert-dialog": "^1.0.5", | ||
"@radix-ui/react-checkbox": "^1.0.4", | ||
|
@@ -53,8 +54,8 @@ | |
"cmdk": "^0.2.0", | ||
"core-js": "^3.34.0", | ||
"dayjs": "^1.11.10", | ||
"js-sha256": "^0.11.0", | ||
"js-base64": "^3.7.7", | ||
"js-sha256": "^0.11.0", | ||
"lucide-react": "^0.288.0", | ||
"next": "^13.4.19", | ||
"nextjs-google-analytics": "^2.3.3", | ||
|
@@ -64,6 +65,7 @@ | |
"react-dom": "^18.2.0", | ||
"react-hook-form": "^7.49.2", | ||
"sha512crypt-node": "^1.0.2", | ||
"sharp": "^0.33.4", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the sharp library necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it was just needed for me to be able to deploy locally. I'll remove it from the dependencies. |
||
"sonner": "^1.4.41", | ||
"strip-indent": "^4.0.0", | ||
"swr": "^2.2.4", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what determines which discussion the comments are placed in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it creates a thread in the category specified based off of the path like 'blog/hello-world' for example. It might be a good idea to host and pull the comments on a separate repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, let's experiment with that in our preview environment in https://github.com/WATonomous/infra-config