Action buttons consistency and tooltips

This commit is contained in:
Daniel
2025-01-12 23:58:37 +01:00
committed by Nicolás Hatcher Andrés
parent e8c18ebc5e
commit cc72d031b5
3 changed files with 35 additions and 6 deletions

View File

@@ -84,17 +84,21 @@ function NamedRangeActive(properties: NamedRangeProperties) {
onClick={(event) => event.stopPropagation()}
/>
<IconsWrapper>
<IconButton
<StyledIconButton
onClick={() => {
const error = onSave(name, scope, formula);
if (error) {
setFormulaError(true);
}
}}
title={t("name_manager_dialog.apply")}
>
<StyledCheck size={16} />
</IconButton>
<StyledIconButton onClick={onCancel}>
</StyledIconButton>
<StyledIconButton
onClick={onCancel}
title={t("name_manager_dialog.discard")}
>
<X size={16} />
</StyledIconButton>
</IconsWrapper>
@@ -141,6 +145,10 @@ const StyledTextField = styled(TextField)(() => ({
const StyledIconButton = styled(IconButton)(({ theme }) => ({
color: theme.palette.error.main,
borderRadius: "8px",
"&:hover": {
backgroundColor: theme.palette.grey["50"],
},
"&.Mui-disabled": {
opacity: 0.6,
color: theme.palette.error.light,

View File

@@ -28,10 +28,18 @@ function NamedRangeInactive(properties: NamedRangeInactiveProperties) {
<StyledDiv>{scopeName}</StyledDiv>
<StyledDiv>{formula}</StyledDiv>
<IconsWrapper>
<StyledIconButtonBlack onClick={onEdit} disabled={!showOptions}>
<StyledIconButtonBlack
onClick={onEdit}
disabled={!showOptions}
title={t("name_manager_dialog.edit")}
>
<PencilLine size={16} />
</StyledIconButtonBlack>
<StyledIconButtonRed onClick={onDelete} disabled={!showOptions}>
<StyledIconButtonRed
onClick={onDelete}
disabled={!showOptions}
title={t("name_manager_dialog.delete")}
>
<Trash2 size={16} />
</StyledIconButtonRed>
</IconsWrapper>
@@ -43,10 +51,18 @@ function NamedRangeInactive(properties: NamedRangeInactiveProperties) {
const StyledIconButtonBlack = styled(IconButton)(({ theme }) => ({
color: theme.palette.common.black,
borderRadius: "8px",
"&:hover": {
backgroundColor: theme.palette.grey["50"],
},
}));
const StyledIconButtonRed = styled(IconButton)(({ theme }) => ({
color: theme.palette.error.main,
borderRadius: "8px",
"&:hover": {
backgroundColor: theme.palette.grey["50"],
},
"&.Mui-disabled": {
opacity: 0.6,
color: theme.palette.error.light,

View File

@@ -85,6 +85,11 @@
"help": "Learn more about Named Ranges",
"new": "Add new",
"workbook": "Workbook",
"global": "(Global)"
"global": "(Global)",
"close": "Close dialog",
"delete": "Delete Range",
"edit": "Edit Range",
"apply": "Apply changes",
"discard": "Discard changes"
}
}