fix: add fold-code button when code is expand

This commit is contained in:
code-october 2024-09-27 12:08:39 +00:00
parent 870ad913cc
commit 85227596f8
5 changed files with 8 additions and 2 deletions

View File

@ -196,11 +196,13 @@ function CustomCode(props: { children: any; className?: string }) {
> >
{props.children} {props.children}
</code> </code>
{showToggle && collapsed && ( {showToggle && (
<div <div
className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`} className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`}
> >
<button onClick={toggleCollapsed}>{Locale.NewChat.More}</button> <button onClick={toggleCollapsed}>
{collapsed ? Locale.NewChat.More : Locale.NewChat.Less}
</button>
</div> </div>
)} )}
</> </>

View File

@ -680,6 +680,7 @@ const cn = {
Title: "挑选一个面具", Title: "挑选一个面具",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞", SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
More: "查看全部", More: "查看全部",
Less: "折叠代码",
}, },
URLCommand: { URLCommand: {

View File

@ -688,6 +688,7 @@ const en: LocaleType = {
Title: "Pick a Mask", Title: "Pick a Mask",
SubTitle: "Chat with the Soul behind the Mask", SubTitle: "Chat with the Soul behind the Mask",
More: "Find More", More: "Find More",
Less: "Fold Code",
NotShow: "Never Show Again", NotShow: "Never Show Again",
ConfirmNoShow: "Confirm to disableYou can enable it in settings later.", ConfirmNoShow: "Confirm to disableYou can enable it in settings later.",
}, },

View File

@ -507,6 +507,7 @@ const tw = {
Title: "挑選一個角色範本", Title: "挑選一個角色範本",
SubTitle: "現在開始,與角色範本背後的靈魂思維碰撞", SubTitle: "現在開始,與角色範本背後的靈魂思維碰撞",
More: "搜尋更多", More: "搜尋更多",
Less: "收合程式",
}, },
URLCommand: { URLCommand: {
Code: "偵測到連結中已經包含存取密碼,是否自動填入?", Code: "偵測到連結中已經包含存取密碼,是否自動填入?",

View File

@ -331,6 +331,7 @@ pre {
.expanded { .expanded {
background-image: none; background-image: none;
justify-content: flex-end;
} }
.collapsed { .collapsed {
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.06)); background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.06));