Skip to content

Commit

Permalink
fix: path styntax hightlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
Zainal21 committed Jan 22, 2024
1 parent 7f1fc6d commit f3e0f0a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ import { HomePageLayout } from "@/layouts/HomePageLayout";
import { Animate } from "@/components/design-system/utils";
import { Text } from "@/components/design-system";
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
import {
dark,
duotoneLight,
} from "react-syntax-highlighter/dist/esm/styles/prism";
// import { dark, a11yLight } from "react-syntax-highlighter/dist/cjs/styles/hljs";
import { dark, a11yLight } from "react-syntax-highlighter/dist/cjs/styles/hljs";
import { useTheme } from "@/context/ThemeContext";
import { frontMatterPost } from "@/types/posts";

interface BlogDetailProps {
frontMatter: any;
frontMatter: frontMatterPost;
mdxSource: any;
}

const BlogDetail: NextPage<BlogDetailProps> = (props) => {
console.log(props);
const [isLoading, setLoading] = useState(true);
const { theme } = useTheme();

Expand Down Expand Up @@ -74,7 +70,7 @@ const BlogDetail: NextPage<BlogDetailProps> = (props) => {
</Text>
),
blockquote: ({ children }) => (
<blockquote className="mt-4 border-l-4 border-l-teal-600 py-1 pl-2 bg-color-secondary dark:border-l-teal-500">
<blockquote className="mt-4 border-l-4 border-l-teal-600 py-1 pl-2 bg-color-secondary dark:border-l-blue-500">
{children}
</blockquote>
),
Expand All @@ -89,7 +85,7 @@ const BlogDetail: NextPage<BlogDetailProps> = (props) => {
<SyntaxHighlighter
language="javascript"
className="rounded-md border-2 w-[38.5rem]"
style={theme == "dark" ? dark : duotoneLight}
style={theme == "dark" ? dark : a11yLight}
>
{children}
</SyntaxHighlighter>
Expand Down

1 comment on commit f3e0f0a

@vercel
Copy link

@vercel vercel bot commented on f3e0f0a Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.