From 85227596f842e29ee6589f5fcbc92fa29e1215ae Mon Sep 17 00:00:00 2001 From: code-october <148516338+code-october@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:08:39 +0000 Subject: [PATCH] fix: add fold-code button when code is expand --- app/components/markdown.tsx | 6 ++++-- app/locales/cn.ts | 1 + app/locales/en.ts | 1 + app/locales/tw.ts | 1 + app/styles/globals.scss | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 6e340d065bc..818ee3d3bf6 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -196,11 +196,13 @@ function CustomCode(props: { children: any; className?: string }) { > {props.children} - {showToggle && collapsed && ( + {showToggle && (
- +
)} diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e5bcca0edbb..b9e84d35ac3 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -680,6 +680,7 @@ const cn = { Title: "挑选一个面具", SubTitle: "现在开始,与面具背后的灵魂思维碰撞", More: "查看全部", + Less: "折叠代码", }, URLCommand: { diff --git a/app/locales/en.ts b/app/locales/en.ts index 1204575224a..75bf28e9c69 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -688,6 +688,7 @@ const en: LocaleType = { Title: "Pick a Mask", SubTitle: "Chat with the Soul behind the Mask", More: "Find More", + Less: "Fold Code", NotShow: "Never Show Again", ConfirmNoShow: "Confirm to disable?You can enable it in settings later.", }, diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 7cb84670894..7b61dd26782 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -507,6 +507,7 @@ const tw = { Title: "挑選一個角色範本", SubTitle: "現在開始,與角色範本背後的靈魂思維碰撞", More: "搜尋更多", + Less: "收合程式", }, URLCommand: { Code: "偵測到連結中已經包含存取密碼,是否自動填入?", diff --git a/app/styles/globals.scss b/app/styles/globals.scss index e8c10de3f2d..da515200200 100644 --- a/app/styles/globals.scss +++ b/app/styles/globals.scss @@ -331,6 +331,7 @@ pre { .expanded { background-image: none; + justify-content: flex-end; } .collapsed { background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.06));