diff --git a/src/modals/EditGroupModal.js b/src/modals/EditGroupModal.js deleted file mode 100644 index a990bd0..0000000 --- a/src/modals/EditGroupModal.js +++ /dev/null @@ -1,65 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { Box, Button, Label, Flex } from "theme-ui"; - -import Modal from "../components/Modal"; -import Select from "../components/Select"; - -function EditGroupModal({ - isOpen, - onRequestClose, - onChange, - groups, - defaultGroup, -}) { - const [value, setValue] = useState(); - const [options, setOptions] = useState([]); - - useEffect(() => { - if (defaultGroup) { - setValue({ value: defaultGroup, label: defaultGroup }); - } else { - setValue(); - } - }, [defaultGroup]); - - useEffect(() => { - setOptions(groups.map((group) => ({ value: group, label: group }))); - }, [groups]); - - function handleCreate(group) { - const newOption = { value: group, label: group }; - setValue(newOption); - setOptions((prev) => [...prev, newOption]); - } - - function handleChange() { - onChange(value ? value.value : ""); - } - - return ( - - - -