webamp/modern/src/Sidebar.js
Jordan Eldredge de8c147f6a Allow dragging files into Modern demo and allow Debugger to live on the same page
Note that the debugger is not yet actually connected to the maki code running in the skin
2019-08-14 19:55:47 -07:00

21 lines
479 B
JavaScript

import React from "react";
export default function Sidebar({ children }) {
const [open, setOpen] = React.useState(false);
return (
<div
style={{
height: "100%",
width: open ? "50%" : 0,
borderLeft: open ? "2px solid grey" : "20px solid grey",
padding: 0,
position: "fixed",
right: 0,
transition: "0.25s ease-out",
}}
onClick={() => setOpen(true)}
>
{open && children}
</div>
);
}