visuddhinanda 3 tahun lalu
induk
melakukan
24fa0a1567
1 mengubah file dengan 38 tambahan dan 0 penghapusan
  1. 38 0
      dashboard/src/components/nut/InnerDrawer.tsx

+ 38 - 0
dashboard/src/components/nut/InnerDrawer.tsx

@@ -0,0 +1,38 @@
+import { Button, Drawer } from "antd";
+import React, { useState } from "react";
+
+const Widget = () => {
+	const [open, setOpen] = useState(false);
+
+	const showDrawer = () => {
+		setOpen(true);
+	};
+
+	const onClose = () => {
+		setOpen(false);
+	};
+
+	return (
+		<div className="site-drawer-render-in-current-wrapper">
+			Render in this
+			<div style={{ marginTop: 16 }}>
+				<Button type="primary" onClick={showDrawer}>
+					Open
+				</Button>
+			</div>
+			<Drawer
+				title="Basic Drawer"
+				placement="right"
+				closable={false}
+				onClose={onClose}
+				open={open}
+				getContainer={false}
+				style={{ position: "absolute" }}
+			>
+				<p>Some contents...</p>
+			</Drawer>
+		</div>
+	);
+};
+
+export default Widget;