cleaned up options styles

This commit is contained in:
ari committed 2022-06-29 16:34:59 -04:00
1 parent 4d9afbe26b
commit 0088dd8448
11 files changed
+106 -104

No files matched your search

+4 -3
View File
@@ -1,16 +1,17 @@
import "./index.css";
import { FC, ReactNode, useState } from "react";
import { FC, ReactNode, useRef, useState } from "react";
import ClickAwayListener from "@mui/material/ClickAwayListener";
export type SpeedDialProps = {
icon: ReactNode;
className?: string;
children: ReactNode;
direction?: "row" | "column";
direction?: "left" | "right";
};
export const SpeedDial: FC<SpeedDialProps> = (props) => {
const [open, setOpen] = useState(false);
const direction = props.direction ?? "right";
return (
<ClickAwayListener onClickAway={() => setOpen(false)}>
<div
@@ -26,7 +27,7 @@ export const SpeedDial: FC<SpeedDialProps> = (props) => {
className={[
"speed-dial--list",
open ? "open" : "close",
props.direction ?? "row",
direction,
].join(" ")}
>
{props.children}