Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add fold-code button when code is expand #5554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@ function CustomCode(props: { children: any; className?: string }) {
>
{props.children}
</code>
{showToggle && collapsed && (
{showToggle && (
<div
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>
)}
</>
Expand Down
1 change: 1 addition & 0 deletions app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ const cn = {
Title: "挑选一个面具",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
More: "查看全部",
Less: "折叠代码",
},

URLCommand: {
Expand Down
1 change: 1 addition & 0 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
Expand Down
1 change: 1 addition & 0 deletions app/locales/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ const tw = {
Title: "挑選一個角色範本",
SubTitle: "現在開始,與角色範本背後的靈魂思維碰撞",
More: "搜尋更多",
Less: "收合程式",
},
URLCommand: {
Code: "偵測到連結中已經包含存取密碼,是否自動填入?",
Expand Down
1 change: 1 addition & 0 deletions app/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading