diff --git a/.vscode/settings.json b/.vscode/settings.json index fada709..463b614 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,6 +10,7 @@ "micromessenger", "nextjs", "prin", + "quora", "readerpage", "rehype", "Swipeable", diff --git a/biome.json b/biome.json index 097651c..a670497 100644 --- a/biome.json +++ b/biome.json @@ -20,6 +20,7 @@ "noForEach": "off" }, "correctness": { + "noUnusedImports": "error", "useExhaustiveDependencies": "off" }, "suspicious": { diff --git a/components/mdx/H2.tsx b/components/mdx/H2.tsx index 7ae8fdc..46e022b 100644 --- a/components/mdx/H2.tsx +++ b/components/mdx/H2.tsx @@ -1,6 +1,6 @@ const H2 = (props: JSX.IntrinsicElements["h2"]) => { return ( -

+

{props.children}

); diff --git a/components/utils/SocialIcons.tsx b/components/utils/SocialIcons.tsx index 29505dd..441f847 100644 --- a/components/utils/SocialIcons.tsx +++ b/components/utils/SocialIcons.tsx @@ -1,7 +1,7 @@ import { Config } from "@/data/config"; import Link from "next/link"; +import { FaQuora, FaWeibo } from "react-icons/fa"; import { FiGithub, FiInstagram, FiMail, FiTwitter } from "react-icons/fi"; -import { FaWeibo } from "react-icons/fa"; import { TbBrandBilibili, TbBrandFacebook, @@ -95,6 +95,16 @@ export const SocialIcons = () => { )} + {Config.SocialLinks.quora && ( + + + + )} {Config.SocialLinks.linkedin && ( { const compiledSource = props.compiledSource; - const setIsTOCOpen = useDrawerTOCState((state) => state.changeDrawerTOCOpen); + // const setIsTOCOpen = useDrawerTOCState((state) => state.changeDrawerTOCOpen); // Only the TOC length reaches 3 can be displayed. // In order to avoid large blank spaces that ruin the visual perception const isTOCLongEnough = props.tocList.length > 2; - const handleRightSwipe = useSwipeable({ - onSwipedRight: () => { - isTOCLongEnough && setIsTOCOpen(true); - }, - delta: 150, - }); + // const handleLeftSwipe = useSwipeable({ + // onSwipedLeft: () => isTOCLongEnough && setIsTOCOpen(true), + // delta: 150, + // }); return ( -
-
-
- {props.frontMatter.coverURL && } -
-
+
+ {props.frontMatter.coverURL && } +
+
+ {props.frontMatter?.title} +
+ {props.frontMatter?.subtitle && ( +
+ {props.frontMatter.subtitle} +
+ )} +
{normalizeDate(props.frontMatter?.time)}
+ {props.frontMatter?.summary && ( +

- {props.frontMatter?.title} + {props.frontMatter?.summary} +

+ )} + {props.frontMatter.tags && ( +
+ {props.frontMatter.tags.map((tagName) => ( + + {tagName} + + ))}
- {props.frontMatter?.subtitle && ( -
- {props.frontMatter.subtitle} -
- )} -
{normalizeDate(props.frontMatter?.time)}
- {props.frontMatter?.summary && ( -

- {props.frontMatter?.summary} -

- )} - {props.frontMatter.tags && ( -
- {props.frontMatter.tags.map((tagName) => ( - - {tagName} - - ))} -
- )} -
-
- {compiledSource && ( - - )} -
+ )} +
+
+ {compiledSource && ( + + )}
- + {/* */} { {Config.Giscus?.enabled && }
- {isTOCLongEnough && ( -
-
- -
-
- )}
- {isTOCLongEnough && ( -
- -
- )} + {isTOCLongEnough && }