init
This commit is contained in:
28
src/component/xpopup/index.tsx
Normal file
28
src/component/xpopup/index.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Divider, Popup } from "antd-mobile";
|
||||
import { CloseOutline } from "antd-mobile-icons";
|
||||
import "./index.less";
|
||||
|
||||
interface DefinedProps {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
children: React.ReactNode;
|
||||
onClose: () => void;
|
||||
}
|
||||
function XPopup(props: DefinedProps) {
|
||||
const { visible, title, children, onClose } = props;
|
||||
|
||||
return (
|
||||
<Popup visible={visible} closeOnMaskClick={true} className="xpopup">
|
||||
<div className="header">
|
||||
<h3 className="title">{title}</h3>
|
||||
<span className="closeIcon" onClick={onClose}>
|
||||
<CloseOutline style={{ fontSize: "16px" }} />
|
||||
</span>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="content">{children}</div>
|
||||
</Popup>
|
||||
);
|
||||
}
|
||||
|
||||
export default XPopup;
|
||||
Reference in New Issue
Block a user