Skip to content
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

✨ Added Giscus discussions and reactions #1579

Merged
merged 18 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ GITHUB_REPO=#{GITHUB_REPO}
GATSBY_ALGOLIA_APP_ID=#{GATSBY_ALGOLIA_APP_ID}
GATSBY_ALGOLIA_SEARCH_KEY=#{GATSBY_ALGOLIA_SEARCH_KEY}
ALGOLIA_ADMIN_KEY=#{ALGOLIA_ADMIN_KEY}
GISCUS_REPO_ID=#{GISCUS_REPO_ID}
GISCUS_CATEGORY_ID=#{GISCUS_CATEGORY_ID}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@auth0/auth0-react": "^2.2.4",
"@giscus/react": "^3.0.0",
"@microsoft/applicationinsights-web": "^3.3.3",
"@raae/gatsby-remark-oembed": "^0.3.3",
"algoliasearch": "^4.24.0",
Expand Down Expand Up @@ -116,4 +117,4 @@
"📦 gatsby-plugin-fontawesome-css": "Added to disable Font Awesomes auto CSS insertion and instead insert it at compile time. This stops the brief flicker of the icons stying being incorrect when the page is refreshed"
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion src/components/comments/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Comments = (props) => {
title: props.title,
};
return (
<div className="disqus-box">
<div className="discussion-box">
<Disqus config={disqusConfig} />
</div>
);
Expand Down
32 changes: 32 additions & 0 deletions src/components/discussion/discussion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Giscus from '@giscus/react';
import React from 'react';
import PropTypes from 'prop-types';

const Discussion = (props) => {
return (
<div className="discussion-box">
<Giscus
id="comments"
repo="SSWConsulting/SSW.Rules.Content"
repoId={process.env.GISCUS_REPO_ID}
categoryId={process.env.GISCUS_CATEGORY_ID}
mapping="specific"
strict="1"
term={props.ruleGuid}
reactionsEnabled="1"
emitMetadata="0"
inputPosition="bottom"
theme="light"
lang="en"
loading="lazy"
async
/>
</div>
);
};

export default Discussion;

Discussion.propTypes = {
ruleGuid: PropTypes.string.isRequired,
};
2 changes: 1 addition & 1 deletion src/components/dropdown-icon/dropdown-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const DropdownIcon = ({ displayActions }) => {

const drop = useRef(null);
function handleClick(e) {
if (!e.target.closest(`.${drop.current.className}`) && open) {
if (!e.target.closest(`.${drop.current?.className}`) && open) {
setOpen(false);
}
}
Expand Down
211 changes: 0 additions & 211 deletions src/components/reaction/reaction.js

This file was deleted.

Loading
Loading