优化样式

This commit is contained in:
Azmat@qq.com
2026-08-21 18:41:40 +08:00
parent 409d1c2969
commit 368586d33e
3 changed files with 87 additions and 80 deletions
+2 -2
View File
@@ -181,7 +181,7 @@ export function SuccessModal({ open, title, detail, actions, close }: {
);
}
export function Drawer({ title, open, close, children }: { title: string; open: boolean; close: () => void; children: ReactNode }) {
export function Drawer({ title, open, close, children, className }: { title: string; open: boolean; close: () => void; children: ReactNode; className?: string }) {
useBodyScrollLock(open);
const { mounted, show } = useOverlayTransition(open, close);
if (!mounted) return null;
@@ -189,7 +189,7 @@ export function Drawer({ title, open, close, children }: { title: string; open:
return createPortal(
<>
<div className={`drawer-bg${show ? " show" : ""}`} onClick={close} />
<aside className={`drawer${show ? " show" : ""}`}>
<aside className={`drawer${className ? ` ${className}` : ""}${show ? " show" : ""}`}>
<div className="drawer-h"><h3>{title}</h3><button className="x" type="button" onClick={close} aria-label="关闭"><X size={14} /></button></div>
<div className="drawer-b">{children}</div>
</aside>