From 41f92ce31ad51636163b70c0a249be5c0e7a7019 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 1 Jan 2023 04:34:22 +0100 Subject: [PATCH] Created the DomainDialog.jsx --- .../components/DomainDialog/DomainDialog.jsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 admin/src/pages/Home/components/DomainDialog/DomainDialog.jsx diff --git a/admin/src/pages/Home/components/DomainDialog/DomainDialog.jsx b/admin/src/pages/Home/components/DomainDialog/DomainDialog.jsx new file mode 100644 index 0000000..69cd2af --- /dev/null +++ b/admin/src/pages/Home/components/DomainDialog/DomainDialog.jsx @@ -0,0 +1,36 @@ +import {DialogProvider} from "@/common/contexts/Dialog"; +import DomainHeader from "@/pages/Home/components/DomainDialog/components/DomainHeader"; +import DomainItem from "@/pages/Home/components/DomainDialog/components/DomainItem"; +import {useContext, useState} from "react"; +import DomainContext from "@/common/contexts/Domain"; +import Button from "@/common/components/Button"; +import AddDomainDialog from "@/pages/Home/components/DomainDialog/components/AddDomainDialog"; +import "./styles.sass"; + +export const DomainDialog = (props) => { + const [currentDomain, setCurrentDomain, domains] = useContext(DomainContext); + const [dialogOpen, setDialogOpen] = useState(false); + + const openAddDialog = () => { + props.close(); + setDialogOpen(true); + } + + return ( + <> + {dialogOpen && setDialogOpen(false)}>} + {props.isOpen && +
+ +
+ {domains.map((domain) => setCurrentDomain(domain)}/>)} + {domains.length === 0 &&

Keine Domains erstellt

} +
+
+
+
+
} + + ); +} \ No newline at end of file