Commit caf13950 by 李伟康

style(toast): 更新 toast 组件样式以改进视觉外观

- 修改 toast 容器的宽度、圆角和背景样式
- 将 toast 图标颜色统一设置为白色
- 调整消息和子元素的文本颜色和字体大小
- 移除关闭按钮并注释掉相关代码
- 在 report 组件中将默认高度从 800px 调整为 150px
- 在 question 组件中注释掉空的间距 div
- 在 init-questions 组件中调整边距从 mb-2 到 mb-4
1 parent 472df0ed
...@@ -31,7 +31,7 @@ const InitQuestions: FC = () => { ...@@ -31,7 +31,7 @@ const InitQuestions: FC = () => {
.sort(() => Math.random() - 0.5) .sort(() => Math.random() - 0.5)
.slice(0, 4) .slice(0, 4)
return ( return (
<div className={cn('mb-2 flex last:mb-0', s['suggested-questions-box'])}> <div className={cn('mb-4 flex last:mb-0', s['suggested-questions-box'])}>
{/* <div className="relative h-10 w-10 shrink-0">{<AnswerIcon />}</div> */} {/* <div className="relative h-10 w-10 shrink-0">{<AnswerIcon />}</div> */}
<img src={AI_TIPS} alt="AI Tips" className={cn(s['suggested-questions-title'])} /> <img src={AI_TIPS} alt="AI Tips" className={cn(s['suggested-questions-title'])} />
<div className={cn(s['suggested-questions-list'], 'group w-0 grow')}> <div className={cn(s['suggested-questions-list'], 'group w-0 grow')}>
......
...@@ -25,7 +25,7 @@ const Question: FC = () => { ...@@ -25,7 +25,7 @@ const Question: FC = () => {
{/* {!!message_files?.length && <FileList files={message_files} showDeleteAction={false} showDownloadAction={true} />} */} {/* {!!message_files?.length && <FileList files={message_files} showDeleteAction={false} showDownloadAction={true} />} */}
<Markdown content={content} className='!text-white' /> <Markdown content={content} className='!text-white' />
</div> </div>
<div className="mt-1 h-[8px]" /> {/* <div className="mt-1 h-[8px]" /> */}
</div> </div>
</div> </div>
) )
......
...@@ -17,7 +17,7 @@ const Report: FC<ReportProps> = ({ content }) => { ...@@ -17,7 +17,7 @@ const Report: FC<ReportProps> = ({ content }) => {
const [isExpanded, setIsExpanded] = useState(true) const [isExpanded, setIsExpanded] = useState(true)
const iframeRef = useRef<HTMLIFrameElement>(null) const iframeRef = useRef<HTMLIFrameElement>(null)
const containerRef = useRef<HTMLDivElement>(null) const containerRef = useRef<HTMLDivElement>(null)
const [containerHeight, setContainerHeight] = useState(800) const [containerHeight, setContainerHeight] = useState(150)
const handleToggleExpand = () => { const handleToggleExpand = () => {
setIsExpanded(!isExpanded) setIsExpanded(!isExpanded)
...@@ -130,7 +130,7 @@ const Report: FC<ReportProps> = ({ content }) => { ...@@ -130,7 +130,7 @@ const Report: FC<ReportProps> = ({ content }) => {
border: 'none', border: 'none',
display: 'block', display: 'block',
borderRadius: '0 0 16px 16px', borderRadius: '0 0 16px 16px',
minHeight: '300px', minHeight: '150px',
height: `${containerHeight}px`, height: `${containerHeight}px`,
}} }}
scrolling="no" scrolling="no"
......
...@@ -31,27 +31,27 @@ const Toast = ({ type = 'info', size = 'md', message, children, className, custo ...@@ -31,27 +31,27 @@ const Toast = ({ type = 'info', size = 'md', message, children, className, custo
if (typeof message !== 'string') return null if (typeof message !== 'string') return null
return ( return (
<div style={{ left: '50%', transform: 'translateX(-50%)' }} className={classNames(className, 'fixed w-[360px] rounded-xl my-4 flex-grow z-[9999] overflow-hidden', size === 'md' ? 'p-3' : 'p-2', 'border border-components-panel-border-subtle bg-components-panel-bg-blur shadow-sm', 'top-0', 'right-0')}> <div style={{ left: '50%', transform: 'translateX(-50%)', minWidth: '242px', maxWidth: 'min(343px, 91vw)', borderRadius: '54px' }} className={classNames(className, 'fixed my-4 flex-grow z-[9999] overflow-hidden', size === 'md' ? 'p-3' : 'p-2', 'top-0', 'right-0')}>
<div className={`absolute inset-0 -z-10 opacity-40 ${(type === 'success' && 'bg-toast-success-bg') || (type === 'warning' && 'bg-toast-warning-bg') || (type === 'error' && 'bg-toast-error-bg') || (type === 'info' && 'bg-toast-info-bg')}`} /> <div className="absolute inset-0 -z-10" style={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }} />
<div className={`flex ${size === 'md' ? 'gap-1' : 'gap-0.5'}`}> <div className={`flex ${size === 'md' ? 'gap-1' : 'gap-0.5'}`}>
<div className={`flex items-center justify-center ${size === 'md' ? 'p-0.5' : 'p-1'}`}> <div className={`flex items-center justify-center ${size === 'md' ? 'p-0.5' : 'p-1'}`}>
{type === 'success' && <RiCheckboxCircleFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-text-success`} aria-hidden="true" />} {type === 'success' && <RiCheckboxCircleFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-white`} aria-hidden="true" />}
{type === 'error' && <RiErrorWarningFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-text-destructive`} aria-hidden="true" />} {type === 'error' && <RiErrorWarningFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-white`} aria-hidden="true" />}
{type === 'warning' && <RiAlertFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-text-warning-secondary`} aria-hidden="true" />} {type === 'warning' && <RiAlertFill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-white`} aria-hidden="true" />}
{type === 'info' && <RiInformation2Fill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-text-accent`} aria-hidden="true" />} {type === 'info' && <RiInformation2Fill className={`${size === 'md' ? 'h-5 w-5' : 'h-4 w-4'} text-white`} aria-hidden="true" />}
</div> </div>
<div className={`flex py-1 ${size === 'md' ? 'px-1' : 'px-0.5'} grow flex-col items-start gap-1`}> <div className={`flex py-1 ${size === 'md' ? 'px-1' : 'px-0.5'} grow flex-col items-start gap-1`}>
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<div className="system-sm-semibold text-text-primary">{message}</div> <div className="system-sm-semibold" style={{ color: 'white', fontSize: '14px' }}>{message}</div>
{customComponent} {customComponent}
</div> </div>
{children && <div className="system-xs-regular text-text-secondary">{children}</div>} {children && <div className="system-xs-regular" style={{ color: 'white', fontSize: '14px' }}>{children}</div>}
</div> </div>
{close && ( {/* {close && (
<ActionButton className="z-[1000]" onClick={close}> <ActionButton className="z-[1000]" onClick={close}>
<RiCloseLine className="h-4 w-4 shrink-0 text-text-tertiary" /> <RiCloseLine className="h-4 w-4 shrink-0 text-white" />
</ActionButton> </ActionButton>
)} )} */}
</div> </div>
</div> </div>
) )
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!