chore: delete code light theme, like chatgpt (#186)

This commit is contained in:
Danil Shishkevich
2023-03-26 15:25:58 +07:00
committed by GitHub
parent 675da9431d
commit 0f07812cc5
4 changed files with 9 additions and 20 deletions
+4 -7
View File
@@ -6,18 +6,14 @@ import { IconCheck, IconClipboard, IconDownload } from '@tabler/icons-react';
import { FC, useState } from 'react';
import { useTranslation } from 'next-i18next';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import {
oneDark,
oneLight,
} from 'react-syntax-highlighter/dist/cjs/styles/prism';
import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
interface Props {
language: string;
value: string;
lightMode: 'light' | 'dark';
}
export const CodeBlock: FC<Props> = ({ language, value, lightMode }) => {
export const CodeBlock: FC<Props> = ({ language, value }) => {
const { t } = useTranslation('markdown');
const [isCopied, setIsCopied] = useState<Boolean>(false);
@@ -65,6 +61,7 @@ export const CodeBlock: FC<Props> = ({ language, value, lightMode }) => {
<div className="codeblock relative font-sans text-[16px]">
<div className="flex items-center justify-between py-1.5 px-4">
<span className="text-xs lowercase text-white">{language}</span>
<div className="flex items-center">
<button
className="flex items-center rounded bg-none py-0.5 px-2 text-xs text-white focus:outline-none"
@@ -88,7 +85,7 @@ export const CodeBlock: FC<Props> = ({ language, value, lightMode }) => {
<SyntaxHighlighter
language={language}
style={lightMode === 'light' ? oneLight : oneDark}
style={oneDark}
customStyle={{ margin: 0 }}
>
{value}