refactor(chat): 品牌化聊天页面布局和图标,移除 sxwz 硬编码偏移
将 SVG 图标 stroke 从硬编码 #150033 改为 currentColor,移除聊天面板 sxwz 专属 translate-x 偏移,为代码编辑器添加组件级 CSS 类名。
This commit is contained in:
parent
6958efb2ad
commit
8e6c8c7424
@ -347,7 +347,6 @@ export default function ChatPage() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
"m-auto flex h-screen min-h-svh overflow-hidden rounded-t-[20px] transition-[width] duration-300 ease-in-out",
|
"m-auto flex h-screen min-h-svh overflow-hidden rounded-t-[20px] transition-[width] duration-300 ease-in-out",
|
||||||
artifactsOpen ? "w-full" : "w-[70%]",
|
artifactsOpen ? "w-full" : "w-[70%]",
|
||||||
brand === "sxwz" && artifactsOpen === false && "translate-x-[-172px]",
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="relative flex size-full min-h-0 justify-between rounded-t-[20px]">
|
<div className="relative flex size-full min-h-0 justify-between rounded-t-[20px]">
|
||||||
@ -443,9 +442,15 @@ export default function ChatPage() {
|
|||||||
disabled={isStreaming}
|
disabled={isStreaming}
|
||||||
onClick={() => setShowExitDialog(true)}
|
onClick={() => setShowExitDialog(true)}
|
||||||
>
|
>
|
||||||
|
{brand === "sxwz" ? (
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||||
<path d="M2 4H6M16 4H12M6 4H12M6 4C6 2.89543 6.89543 2 8 2H10C11.1046 2 12 2.89543 12 4M4 6V14C4 15.1046 4.89543 16 6 16H12C13.1046 16 14 15.1046 14 14V6M7 8V13M11 8V13" stroke="#150033" strokeLinecap="round" />
|
<path d="M4.39045 13.6025V14.0846C4.39045 14.4462 4.04284 14.8078 3.69523 14.8078C3.34761 14.8078 3 14.5668 3 14.0846V10.8302C3 10.4686 3.34761 10.2276 3.69523 10.2276C4.04284 10.2276 4.27458 10.4686 4.39045 10.8302C4.50632 11.1918 4.73806 11.674 4.96981 12.0356C6.12851 13.9641 7.86658 14.8078 9.95225 14.6873C12.2697 14.4462 13.776 13.1204 14.5871 10.9508C14.703 10.4686 14.9347 10.2276 15.2823 10.2276C15.7458 10.2276 16.0934 10.5892 15.9775 11.0713C15.7458 12.0356 15.2823 12.7588 14.703 13.482C12.0379 16.7363 7.51897 16.8569 4.62219 13.723C4.50632 13.723 4.50632 13.723 4.39045 13.6025ZM14.4712 4.2009V3.59824C14.4712 3.11611 14.8188 2.87504 15.1664 2.87504C15.5141 2.87504 15.8617 3.11611 15.8617 3.59824V6.7321C15.8617 7.0937 15.6299 7.33476 15.3982 7.4553C15.0506 7.57583 14.703 7.33476 14.5871 7.0937C14.4712 6.85263 14.3554 6.49103 14.2395 6.24997C13.0808 4.2009 11.3427 3.23664 9.02529 3.35717C6.82374 3.59824 5.31742 4.9241 4.50632 6.97317C4.39045 7.21423 4.27458 7.4553 3.92697 7.57583C3.34761 7.57583 3 7.0937 3.23174 6.61157C3.69523 5.16517 4.50632 4.08037 5.66503 3.23664C8.44593 1.30811 11.9221 1.66971 14.2395 4.08037C14.3554 4.2009 14.3553 4.32144 14.4712 4.2009C14.4712 4.32144 14.4712 4.32144 14.4712 4.2009Z" fill="currentColor" />
|
||||||
</svg>
|
</svg>
|
||||||
|
) : (
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||||
|
<path d="M2 4H6M16 4H12M6 4H12M6 4C6 2.89543 6.89543 2 8 2H10C11.1046 2 12 2.89543 12 4M4 6V14C4 15.1046 4.89543 16 6 16H12C13.1046 16 14 15.1046 14 14V6M7 8V13M11 8V13" stroke="currentColor" strokeLinecap="round" />
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
{t.common.resetThread}
|
{t.common.resetThread}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@ -454,7 +459,7 @@ export default function ChatPage() {
|
|||||||
<Tooltip content={t.chatPage.viewArtifactsTooltip}>
|
<Tooltip content={t.chatPage.viewArtifactsTooltip}>
|
||||||
<Button
|
<Button
|
||||||
data-testid="artifacts-open-button"
|
data-testid="artifacts-open-button"
|
||||||
className="text-ws-base-1 hover:text-ws-base-1/80"
|
className="h-full px-[10px] py-[5px] text-sm font-medium text-ws-base-1 hover:text-ws-base-1"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setArtifactsOpen(true);
|
setArtifactsOpen(true);
|
||||||
@ -462,10 +467,10 @@ export default function ChatPage() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
||||||
<path d="M16 7V4C16 2.89543 15.1046 2 14 2H4C2.89543 2 2 2.89543 2 4V14C2 15.1046 2.89543 16 4 16H9" stroke="#150033" strokeLinecap="round" />
|
<path d="M16 7V4C16 2.89543 15.1046 2 14 2H4C2.89543 2 2 2.89543 2 4V14C2 15.1046 2.89543 16 4 16H9" stroke="currentColor" strokeLinecap="round" />
|
||||||
<path d="M5 5H9M5 8H7" stroke="#150033" strokeLinecap="round" strokeLinejoin="round" />
|
<path d="M5 5H9M5 8H7" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
<circle cx="11.5" cy="10.5" r="3" stroke="#150033" />
|
<circle cx="11.5" cy="10.5" r="3" stroke="currentColor" />
|
||||||
<path d="M15.5 14.5L14 13" stroke="#150033" strokeLinecap="round" strokeLinejoin="round" />
|
<path d="M15.5 14.5L14 13" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
</svg>
|
</svg>
|
||||||
{t.common.artifacts}
|
{t.common.artifacts}
|
||||||
</Button>
|
</Button>
|
||||||
@ -573,13 +578,13 @@ export default function ChatPage() {
|
|||||||
"pointer-events-none fixed right-0 bottom-3 left-0 z-30 flex justify-center px-4",
|
"pointer-events-none fixed right-0 bottom-3 left-0 z-30 flex justify-center px-4",
|
||||||
"transition-all duration-300 ease-in-out",
|
"transition-all duration-300 ease-in-out",
|
||||||
fullscreen ? "hidden" : "",
|
fullscreen ? "hidden" : "",
|
||||||
|
brand === "sxwz" && artifactsOpen === false && "-translate-x-[30px]"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"pointer-events-auto relative w-full max-w-[720px]",
|
"pointer-events-auto relative w-full max-w-[720px]",
|
||||||
showWelcomeStyle && "-translate-y-[calc(50vh-96px)]",
|
showWelcomeStyle && "-translate-y-[calc(50vh-96px)]",
|
||||||
brand === "sxwz"&& artifactsOpen ===false && "-translate-x-[172px]"
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{!(showWelcomeStyle && thread.isThreadLoading) ? (
|
{!(showWelcomeStyle && thread.isThreadLoading) ? (
|
||||||
|
|||||||
@ -76,7 +76,7 @@ export function CodeEditor({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex cursor-text flex-col overflow-hidden rounded-md",
|
"workspace-code-editor flex cursor-text flex-col overflow-hidden rounded-md",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
style={{ "--zoom-scale": zoomScale } as React.CSSProperties}
|
style={{ "--zoom-scale": zoomScale } as React.CSSProperties}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user