From 51a730292d1837d570be9156ccb87a31dce22e78 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Thu, 5 Dec 2024 22:56:31 +0500 Subject: [PATCH] remove disqus --- components/Disqus.jsx | 21 --------------------- components/PostPageInfo.jsx | 8 +------- data/config.js | 4 ---- package-lock.json | 16 ---------------- package.json | 1 - pages/[name].js | 10 +--------- public/locales/en/common.json | 10 ---------- public/locales/ru/common.json | 10 ---------- 8 files changed, 2 insertions(+), 78 deletions(-) delete mode 100644 components/Disqus.jsx diff --git a/components/Disqus.jsx b/components/Disqus.jsx deleted file mode 100644 index 16d209ea2..000000000 --- a/components/Disqus.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { useTranslation } from 'next-i18next'; -import { DiscussionEmbed } from 'disqus-react'; - -const Disqus = ({ shortName, config }) => { - const { t } = useTranslation('common'); - - return ( -
- - - - {t('disqus.link.prefix')} {t('disqus.link.logo')} - -
- ); -}; - -export default Disqus; diff --git a/components/PostPageInfo.jsx b/components/PostPageInfo.jsx index 369c9d9be..c908b61bd 100644 --- a/components/PostPageInfo.jsx +++ b/components/PostPageInfo.jsx @@ -5,7 +5,6 @@ import { MDXRemote } from 'next-mdx-remote'; import { useTranslation } from 'next-i18next'; import Author from './Author.jsx'; -import Disqus from './Disqus.jsx'; import Banner from './Banner.jsx'; import PostPageNav from './PostPageNav.jsx'; import ExternalLink from './ExternalLink.jsx'; @@ -15,7 +14,7 @@ const components = { a: ExternalLink, }; -const PostPageInfo = ({ post, disqus }) => { +const PostPageInfo = ({ post }) => { const { t } = useTranslation('post'); const postImage = post.image ? ( @@ -44,11 +43,6 @@ const PostPageInfo = ({ post, disqus }) => { -
-
- -
-
); diff --git a/data/config.js b/data/config.js index 349e5f59d..d0f3329a3 100644 --- a/data/config.js +++ b/data/config.js @@ -13,10 +13,6 @@ const config = { logo: '/images/hexlet_logo.png', favicon: '/assets/images/favicons/favicon-128.png', author: 'Kirill Mokevnin', - disqus: { - ru: 'hexlet-guides', - en: 'hexlet-guides-en', - }, amp: { analytics: { metrikaCounterId: '65474386', diff --git a/package-lock.json b/package-lock.json index c72614afe..f5bbded56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@sentry/nextjs": "^7.17.3", "bootstrap": "^5.1.3", "date-fns": "^2.29.3", - "disqus-react": "^1.1.3", "file-loader": "^6.2.0", "gray-matter": "^4.0.3", "lodash.capitalize": "^4.2.1", @@ -2254,15 +2253,6 @@ "node": ">=8" } }, - "node_modules/disqus-react": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/disqus-react/-/disqus-react-1.1.3.tgz", - "integrity": "sha512-DwKdmbHTMPyhBECBeRYAPNcIqZNKMvsRiyVdF89BdmFCbZpWb7+xMj/lvAuckBSx1ilOHpTKYYyW11uodaJ6ig==", - "peerDependencies": { - "react": "^15.6.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^15.6.1 || ^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -11240,12 +11230,6 @@ "path-type": "^4.0.0" } }, - "disqus-react": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/disqus-react/-/disqus-react-1.1.3.tgz", - "integrity": "sha512-DwKdmbHTMPyhBECBeRYAPNcIqZNKMvsRiyVdF89BdmFCbZpWb7+xMj/lvAuckBSx1ilOHpTKYYyW11uodaJ6ig==", - "requires": {} - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", diff --git a/package.json b/package.json index c94b034c9..c1699055d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "@sentry/nextjs": "^7.17.3", "bootstrap": "^5.1.3", "date-fns": "^2.29.3", - "disqus-react": "^1.1.3", "file-loader": "^6.2.0", "gray-matter": "^4.0.3", "lodash.capitalize": "^4.2.1", diff --git a/pages/[name].js b/pages/[name].js index 91c02020f..b4e6ecce0 100644 --- a/pages/[name].js +++ b/pages/[name].js @@ -16,14 +16,6 @@ const Post = ({ post, languageMarkup }) => { return null; } - const disqus = { - short_name: cfg.disqus[locale], - config: { - language: locale, - title: post.title, - identifier: post.name, - }, - }; return ( { > - + ); }; diff --git a/public/locales/en/common.json b/public/locales/en/common.json index f8a2a4bf7..1dd6b715f 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -36,15 +36,5 @@ "title": "Privacy Policy", "url": "https://hexlet.io/pages/privacy" } - }, - "disqus": { - "noscript": { - "prefix": "Please enable JavaScript to view the", - "link": "comments powered by Disqus." - }, - "link": { - "prefix": "comments powered by", - "logo": "Disqus" - } } } diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index aed55250e..4f64f6657 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -40,15 +40,5 @@ "title": "Политика конфиденциальности", "url": "https://ru.hexlet.io/pages/privacy" } - }, - "disqus": { - "noscript": { - "prefix": "Please enable JavaScript to view the", - "link": "comments powered by Disqus." - }, - "link": { - "prefix": "comments powered by", - "logo": "Disqus" - } } }