优化样式
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user