feat(brand): 聊天页 sxwz 模式下输入框左移 172px
- ChatPage 接入 useBrand,brand === 'sxwz' 时主容器和输入框 translate-x-[-172px] - 退出对话回欢迎页时同步关闭 artifacts 面板
This commit is contained in:
parent
0bd9b9bdcb
commit
9eb494b1b4
@ -28,6 +28,7 @@ import { MessageList } from "@/components/workspace/messages";
|
|||||||
import { ThreadContext } from "@/components/workspace/messages/context";
|
import { ThreadContext } from "@/components/workspace/messages/context";
|
||||||
import { Tooltip } from "@/components/workspace/tooltip";
|
import { Tooltip } from "@/components/workspace/tooltip";
|
||||||
import { useSpecificChatMode } from "@/components/workspace/use-chat-mode";
|
import { useSpecificChatMode } from "@/components/workspace/use-chat-mode";
|
||||||
|
import { useBrand } from "@/core/brand/provider";
|
||||||
import { Welcome } from "@/components/workspace/welcome";
|
import { Welcome } from "@/components/workspace/welcome";
|
||||||
import { getAPIClient } from "@/core/api";
|
import { getAPIClient } from "@/core/api";
|
||||||
import { sanitizeArtifactPaths } from "@/core/artifacts/utils";
|
import { sanitizeArtifactPaths } from "@/core/artifacts/utils";
|
||||||
@ -48,6 +49,7 @@ import motivationSlogans from "./motivation-slogans.json";
|
|||||||
|
|
||||||
export default function ChatPage() {
|
export default function ChatPage() {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { brand } = useBrand();
|
||||||
useSpecificChatMode();
|
useSpecificChatMode();
|
||||||
const [sloganIndex, setSloganIndex] = useState(0);
|
const [sloganIndex, setSloganIndex] = useState(0);
|
||||||
const [settings, setSettings] = useLocalSettings();
|
const [settings, setSettings] = useLocalSettings();
|
||||||
@ -345,6 +347,7 @@ 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]">
|
||||||
@ -374,6 +377,7 @@ export default function ChatPage() {
|
|||||||
isChatting: false,
|
isChatting: false,
|
||||||
});
|
});
|
||||||
router.replace(`/workspace/chats/${threadId}?is_chatting=false`)
|
router.replace(`/workspace/chats/${threadId}?is_chatting=false`)
|
||||||
|
setArtifactsOpen(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -575,6 +579,7 @@ export default function ChatPage() {
|
|||||||
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" && "-translate-x-[172px]"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{!(showWelcomeStyle && thread.isThreadLoading) ? (
|
{!(showWelcomeStyle && thread.isThreadLoading) ? (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user