chore: delete code light theme, like chatgpt (#186)
This commit is contained in:
committed by
GitHub
parent
675da9431d
commit
0f07812cc5
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user