From cc400da44edb3374eb2afb1d71f0e4b7326a5412 Mon Sep 17 00:00:00 2001 From: boojack Date: Sat, 5 Aug 2023 20:01:32 +0800 Subject: [PATCH] fix: remove translate hook in code block (#2080) --- web/src/labs/marked/parser/CodeBlock.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/src/labs/marked/parser/CodeBlock.tsx b/web/src/labs/marked/parser/CodeBlock.tsx index b9efc3c4..789ec5c7 100644 --- a/web/src/labs/marked/parser/CodeBlock.tsx +++ b/web/src/labs/marked/parser/CodeBlock.tsx @@ -1,13 +1,11 @@ import copy from "copy-to-clipboard"; import hljs from "highlight.js"; import { toast } from "react-hot-toast"; -import { useTranslate } from "@/utils/i18n"; import { matcher } from "../matcher"; export const CODE_BLOCK_REG = /^```(\S*?)\s([\s\S]*?)```/; const renderer = (rawStr: string) => { - const t = useTranslate(); const matchResult = matcher(rawStr, CODE_BLOCK_REG); if (!matchResult) { return <>{rawStr}; @@ -27,7 +25,7 @@ const renderer = (rawStr: string) => { const handleCopyButtonClick = () => { copy(matchResult[2]); - toast.success(t("message.succeed-copy-code")); + toast.success("Copied to clipboard!"); }; return (