Skip to content

Commit 422b324

Browse files
committed
client/note color picker menu item: add tooltips
1 parent fb16336 commit 422b324

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

apps/client/src/menus/custom-items/NoteColorPickerMenuItem.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "./NoteColorPickerMenuItem.css";
2+
import { t } from "../../services/i18n";
23
import { useCallback, useEffect, useRef, useState} from "preact/hooks";
34
import {ComponentChildren} from "preact";
45
import attributes from "../../services/attributes";
@@ -76,6 +77,7 @@ export default function NoteColorPickerMenuItem(props: NoteColorPickerMenuItemPr
7677
onClick={(e) => {e.stopPropagation()}}>
7778

7879
<ColorCell className="color-cell-reset"
80+
tooltip={t("note-color.clear-color")}
7981
color={null}
8082
isSelected={(currentColor === null)}
8183
isDisabled={(note === null)}
@@ -84,13 +86,15 @@ export default function NoteColorPickerMenuItem(props: NoteColorPickerMenuItemPr
8486

8587
{COLORS.map((color) => (
8688
<ColorCell key={color}
89+
tooltip={t("note-color.set-color")}
8790
color={color}
8891
isSelected={(color === currentColor)}
8992
isDisabled={(note === null)}
9093
onSelect={onColorCellClicked} />
9194
))}
9295

93-
<CustomColorCell color={currentColor}
96+
<CustomColorCell tooltip={t("note-color.set-custom-color")}
97+
color={currentColor}
9498
isSelected={isCustomColor}
9599
isDisabled={(note === null)}
96100
onSelect={onColorCellClicked} />
@@ -99,7 +103,8 @@ export default function NoteColorPickerMenuItem(props: NoteColorPickerMenuItemPr
99103

100104
interface ColorCellProps {
101105
children?: ComponentChildren,
102-
className?: string;
106+
className?: string,
107+
tooltip?: string,
103108
color: string | null,
104109
isSelected: boolean,
105110
isDisabled?: boolean,
@@ -109,6 +114,7 @@ interface ColorCellProps {
109114
function ColorCell(props: ColorCellProps) {
110115
return <div class={`color-cell ${props.isSelected ? "selected" : ""} ${props.isDisabled ? "disabled-color-cell" : ""} ${props.className ?? ""}`}
111116
style={`${(props.color !== null) ? `--color: ${props.color}` : ""}`}
117+
title={props.tooltip}
112118
onClick={() => props.onSelect?.(props.color)}>
113119
{props.children}
114120
</div>;

apps/client/src/translations/en/translation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,5 +2093,10 @@
20932093
},
20942094
"collections": {
20952095
"rendering_error": "Unable to show content due to an error."
2096+
},
2097+
"note-color": {
2098+
"clear-color": "Clear note color",
2099+
"set-color": "Set note color",
2100+
"set-custom-color": "Set custom note color"
20962101
}
20972102
}

apps/client/src/translations/ro/translation.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,5 +2095,10 @@
20952095
},
20962096
"calendar_view": {
20972097
"delete_note": "Șterge notița..."
2098+
},
2099+
"note-color": {
2100+
"clear-color": "Înlăturați culoarea notiței",
2101+
"set-color": "Setați culoarea notiței",
2102+
"set-custom-color": "Setați culoare personalizată pentru notiță"
20982103
}
20992104
}

0 commit comments

Comments
 (0)