调整聊天框宽度限制,调整 header 按钮位置
This commit is contained in:
@@ -87,8 +87,8 @@ export const AgentHeader = ({
|
|||||||
boxShadow: `0 1px 0 ${alpha("#fff", 0.6)} inset`,
|
boxShadow: `0 1px 0 ${alpha("#fff", 0.6)} inset`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack direction="row" alignItems="center" spacing={2}>
|
<Stack direction="row" alignItems="center" spacing={2} sx={{ minWidth: 0, flex: 1, mr: 2 }}>
|
||||||
<motion.div whileHover={{ rotate: 10, scale: 1.05 }} whileTap={{ scale: 0.95 }} style={{ display: "flex" }}>
|
<motion.div whileHover={{ rotate: 10, scale: 1.05 }} whileTap={{ scale: 0.95 }} style={{ display: "flex", flexShrink: 0 }}>
|
||||||
<Box sx={{ position: "relative" }}>
|
<Box sx={{ position: "relative" }}>
|
||||||
<Avatar
|
<Avatar
|
||||||
sx={{
|
sx={{
|
||||||
@@ -129,9 +129,9 @@ export const AgentHeader = ({
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<Box sx={{ minWidth: 0 }}>
|
<Box sx={{ minWidth: 0, flex: 1 }}>
|
||||||
{isEditingTitle ? (
|
{isEditingTitle ? (
|
||||||
<Stack direction="row" spacing={0.75} alignItems="center" sx={{ width: { xs: "calc(100vw - 256px)", sm: 280 } }}>
|
<Stack direction="row" spacing={0.75} alignItems="center" sx={{ width: "100%" }}>
|
||||||
<TextField
|
<TextField
|
||||||
value={draftTitle}
|
value={draftTitle}
|
||||||
onChange={(event) => setDraftTitle(event.target.value)}
|
onChange={(event) => setDraftTitle(event.target.value)}
|
||||||
@@ -226,7 +226,6 @@ export const AgentHeader = ({
|
|||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
maxWidth: { xs: "calc(100vw - 256px)", sm: 284 },
|
|
||||||
px: "8px",
|
px: "8px",
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.2,
|
||||||
}}
|
}}
|
||||||
@@ -262,7 +261,7 @@ export const AgentHeader = ({
|
|||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Stack direction="row" spacing={1.25} alignItems="center">
|
<Stack direction="row" spacing={1.25} alignItems="center" sx={{ flexShrink: 0 }}>
|
||||||
<Tooltip title="新建对话">
|
<Tooltip title="新建对话">
|
||||||
<motion.div whileHover={{ scale: 1.08 }} whileTap={{ scale: 0.92 }} style={{ display: "flex" }}>
|
<motion.div whileHover={{ scale: 1.08 }} whileTap={{ scale: 0.92 }} style={{ display: "flex" }}>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export const GlobalChatbox: React.FC<Props> = ({ open, onClose }) => {
|
|||||||
const handleMouseMove = (event: MouseEvent) => {
|
const handleMouseMove = (event: MouseEvent) => {
|
||||||
if (!isResizing) return;
|
if (!isResizing) return;
|
||||||
const newWidth = window.innerWidth - event.clientX;
|
const newWidth = window.innerWidth - event.clientX;
|
||||||
if (newWidth > 360 && newWidth < 1240) {
|
if (newWidth > 360 && newWidth < 800) {
|
||||||
setWidth(newWidth);
|
setWidth(newWidth);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user