-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathindex.jsx
More file actions
54 lines (50 loc) · 1.15 KB
/
index.jsx
File metadata and controls
54 lines (50 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from "react";
import { Drawer, Fab } from "@material-ui/core";
export default function TemporaryDrawer(props) {
const [state, setState] = React.useState({
right: false,
});
const toggleDrawer = (anchor, open) => (event) => {
if (
event.type === "keydown" &&
(event.key === "Tab" || event.key === "Shift")
) {
return;
}
setState({ ...state, [anchor]: open });
};
return (
<div>
<React.Fragment>
<Fab
style={{
position: "fixed",
right: "0.5rem",
bottom: "1rem",
}}
variant="extended"
size="small"
color="secondary"
onClick={toggleDrawer("right", true)}
>
Prop Explorer
</Fab>
<Drawer
anchor={"right"}
open={state["right"]}
onClose={toggleDrawer("right", false)}
>
<div
style={{
width: "70vw",
maxWidth: 700,
paddingLeft: "1rem",
}}
>
{props.children}
</div>
</Drawer>
</React.Fragment>
</div>
);
}