Skip to content

Commit

Permalink
new settings
Browse files Browse the repository at this point in the history
  • Loading branch information
shakhzodkudratov committed Oct 24, 2024
1 parent af6200b commit 181e93e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion components/article-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IconEye, IconThumbDown, IconThumbUp } from '@tabler/icons-react';
import { useLocalStorage } from '@uidotdev/usehooks';
import axios from 'axios';
import { useRouter } from 'next/router';
import { useTheme } from 'nextra-theme-docs';
import React from 'react';

import { useMutation, useQuery, useQueryClient } from 'react-query';
Expand Down Expand Up @@ -34,6 +35,11 @@ const ArticleFooter = () => {
const path = encodeURI(pathname);
const qk = useQueryClient();

// eslint-disable-next-line react-hooks/rules-of-hooks
const { theme } = useTheme();

console.log(theme);

const [localStatus, setLocalStatus] = useLocalStorage<
'liked' | 'disliked' | null
>(path, null);
Expand Down Expand Up @@ -109,6 +115,7 @@ const ArticleFooter = () => {
</div>
</div>
<Giscus
key={theme}
id="comments"
repo="ismoilovdevml/devops-journey"
repoId="R_kgDOKEbY2g"
Expand All @@ -119,7 +126,9 @@ const ArticleFooter = () => {
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="preferred_color_scheme"
theme={
(theme as any) == 'light' ? 'light_high_contrast' : 'noborder_dark'
}
lang="uz"
loading="lazy"
/>
Expand Down
3 changes: 3 additions & 0 deletions pages/guides/overview.en-UZ.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
showFooter: false
---
import { Tab, Tabs } from 'nextra-theme-docs';
import Card, { Cards } from '@components/core/Card';
import cicdGuides from './ci-cd/_meta.en-UZ.json';
Expand Down
1 change: 1 addition & 0 deletions pages/index.en-UZ.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 'Asosiy'
showFooter: false
---

import Link from '@components/core/Link';
Expand Down
1 change: 1 addition & 0 deletions pages/tutorials/all.en-UZ.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: "Barcha Dokumentatsiyalar"
showFooter: false
---

import Card, { Cards } from '@components/core/Tutorial/Card';
Expand Down
5 changes: 4 additions & 1 deletion theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,12 @@ const config: DocsThemeConfig = {
img: props => <Zoom><img {...props} /></Zoom>
},
main({ children }) {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { frontMatter: { showFooter } } = useConfig();

return <>
{children}
<ArticleFooter />
{showFooter != false && <ArticleFooter />}
</>
}
};
Expand Down

0 comments on commit 181e93e

Please sign in to comment.