mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
dialog close button
This commit is contained in:
parent
9ee4acb1c1
commit
cfe4731ded
3 changed files with 55 additions and 6 deletions
|
@ -10,12 +10,14 @@ interface IProps {
|
|||
buttons?: JSX.Element;
|
||||
size?: "medium" | "big";
|
||||
width?: number;
|
||||
onOverlayClick?: MouseEventHandler<HTMLDivElement>;
|
||||
onRefCapture?: (ref: any) => void;
|
||||
error?: string;
|
||||
|
||||
top_sticky?: ReactChild;
|
||||
top_sticky_offset?: number;
|
||||
|
||||
onOverlayClick?: MouseEventHandler<HTMLDivElement>;
|
||||
onRefCapture?: (ref: any) => void;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
const ScrollDialog: FC<IProps> = ({
|
||||
|
@ -27,7 +29,8 @@ const ScrollDialog: FC<IProps> = ({
|
|||
top_sticky_offset,
|
||||
error,
|
||||
onOverlayClick,
|
||||
onRefCapture
|
||||
onRefCapture,
|
||||
onClose,
|
||||
}) => {
|
||||
const [height, setHeight] = useState(window.innerHeight - 120);
|
||||
const [show_top_sticky, setShowTopSticky] = useState(false);
|
||||
|
@ -74,6 +77,8 @@ const ScrollDialog: FC<IProps> = ({
|
|||
{!!title && (
|
||||
<div className={styles.top}>
|
||||
<div className={styles.wrap} style={{ flexBasis: width }}>
|
||||
{ onClose && <div className={styles.close} onClick={onClose}/> }
|
||||
|
||||
<div className={styles.pan}>
|
||||
{title}
|
||||
{show_top_sticky && top_sticky && (
|
||||
|
@ -87,6 +92,8 @@ const ScrollDialog: FC<IProps> = ({
|
|||
{!title && (
|
||||
<div className={styles.top}>
|
||||
<div className={styles.wrap} style={{ flexBasis: width }}>
|
||||
{ onClose && <div className={styles.close} onClick={onClose}/> }
|
||||
|
||||
<div className={styles.top_cap} />
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue