From 912fcae0a3208654f11bb5f057c95130f2b3e83d Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 13 Jan 2025 00:15:42 +0100 Subject: [PATCH] Footer and header are now consistent with other dialogs --- .../NameManagerDialog/NameManagerDialog.tsx | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/webapp/src/components/NameManagerDialog/NameManagerDialog.tsx b/webapp/src/components/NameManagerDialog/NameManagerDialog.tsx index 0dfb7cc..cc6d87f 100644 --- a/webapp/src/components/NameManagerDialog/NameManagerDialog.tsx +++ b/webapp/src/components/NameManagerDialog/NameManagerDialog.tsx @@ -6,13 +6,13 @@ import { DialogActions, DialogContent, DialogTitle, - IconButton, Stack, styled, } from "@mui/material"; import { t } from "i18next"; import { BookOpen, Plus, X } from "lucide-react"; import { useEffect, useState } from "react"; +import { theme } from "../../theme"; import NamedRangeActive from "./NamedRangeActive"; import NamedRangeInactive from "./NamedRangeInactive"; @@ -61,16 +61,24 @@ function NameManagerDialog(properties: NameManagerDialogProperties) { setEditingNameIndex(-2); } }, [open]); + const handleClose = () => { + properties.onClose(); + }; return ( {t("name_manager_dialog.title")} - - - + event.key === "Enter" && properties.onClose()} + > + + - + {t("name_manager_dialog.name")} {t("name_manager_dialog.range")} @@ -185,13 +193,33 @@ const StyledDialog = styled(Dialog)(() => ({ })); const StyledDialogTitle = styled(DialogTitle)` - padding: 12px 20px; - height: 20px; - font-size: 14px; - font-weight: 600; display: flex; align-items: center; + height: 44px; + font-size: 14px; + font-weight: 500; + font-family: Inter; + padding: 0px 12px; justify-content: space-between; + border-bottom: 1px solid ${theme.palette.grey["300"]}; +`; + +const Cross = styled("div")` + &:hover { + background-color: ${theme.palette.grey["50"]}; + } + display: flex; + border-radius: 4px; + height: 24px; + width: 24px; + cursor: pointer; + align-items: center; + justify-content: center; + svg { + width: 16px; + height: 16px; + stroke-width: 1.5; + } `; const NameListWrapper = styled(Stack)` @@ -226,7 +254,7 @@ const StyledRangesHeader = styled(Stack)(({ theme }) => ({ })); const StyledDialogActions = styled(DialogActions)` - padding: 12px 20px; + padding: 12px; height: 40px; display: flex; align-items: center;