Made flow panel closable

nodeDev
Klotske 2022-07-14 18:09:59 +00:00
parent 43e0cea91b
commit 6c5ae38361
2 changed files with 45 additions and 1 deletions

View File

@ -1,5 +1,27 @@
import { VscArrowLeft, VscArrowRight } from "react-icons/vsc";
import useStore from "../../lib/FlowEditor/FlowEditorStore";
const Panel = () => { const Panel = () => {
return <aside className="flow-panel"></aside>; const { panelClosed, togglePanelState } = useStore();
const PanelButton = () => {
return (
<div
className={`flow-panel-button ${panelClosed ? "rotate-180" : ""}`}
onClick={togglePanelState}
>
<VscArrowLeft size={40} />
</div>
);
};
return (
<aside
className={`flow-panel ${panelClosed ? "w-0" : "w-60"} duration-300`}
>
<PanelButton />
</aside>
);
}; };
export default Panel; export default Panel;

View File

@ -38,7 +38,29 @@
border border-gray-600 rounded-full border border-gray-600 rounded-full
mx-2; mx-2;
} }
.content { .content {
@apply ml-16; @apply ml-16;
} }
.flow-editor {
@apply flex flex-row
bg-content;
}
.flow-panel {
@apply relative flex flex-col
bg-panel
z-30;
}
.flow-panel-button {
@apply absolute flex items-center justify-center
w-10 h-10 mt-4 -right-12
bg-gray-800 text-secondary
rounded-xl cursor-pointer;
}
.flow {
}
} }