Skip to content

Commit b0476c7

Browse files
committed
client/note color picker: refactor
1 parent 1de9f71 commit b0476c7

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

apps/client/src/menus/custom-items/NoteColorPickerMenuItem.tsx renamed to apps/client/src/menus/custom-items/NoteColorPicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "./NoteColorPickerMenuItem.css";
1+
import "./NoteColorPicker.css";
22
import { t } from "../../services/i18n";
33
import { useCallback, useEffect, useRef, useState} from "preact/hooks";
44
import {ComponentChildren} from "preact";

apps/client/src/menus/tree_context_menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import NoteColorPickerMenuItem from "./custom-items/NoteColorPickerMenuItem.jsx";
1+
import NoteColorPicker from "./custom-items/NoteColorPicker.jsx";
22
import treeService from "../services/tree.js";
33
import froca from "../services/froca.js";
44
import clipboard from "../services/clipboard.js";
@@ -264,7 +264,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree
264264
kind: "custom",
265265
componentFn: () => {
266266
if (notOptionsOrHelp && selectedNotes.length === 1) {
267-
return NoteColorPickerMenuItem({note});
267+
return NoteColorPicker({note});
268268
} else {
269269
return null;
270270
}

apps/client/src/widgets/collections/board/context_menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import FNote from "../../../entities/fnote";
2-
import NoteColorPickerMenuItem from "../../../menus/custom-items/NoteColorPickerMenuItem";
2+
import NoteColorPicker from "../../../menus/custom-items/NoteColorPicker";
33
import contextMenu, { ContextMenuEvent } from "../../../menus/context_menu";
44
import link_context_menu from "../../../menus/link_context_menu";
55
import attributes from "../../../services/attributes";
@@ -78,7 +78,7 @@ export function openNoteContextMenu(api: Api, event: ContextMenuEvent, note: FNo
7878
{ kind: "separator" },
7979
{
8080
kind: "custom",
81-
componentFn: () => NoteColorPickerMenuItem({note})
81+
componentFn: () => NoteColorPicker({note})
8282
}
8383
],
8484
selectMenuItemHandler: ({ command }) => link_context_menu.handleLinkContextMenuItem(command, note.noteId),

apps/client/src/widgets/collections/calendar/context_menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import NoteColorPickerMenuItem from "../../../menus/custom-items/NoteColorPickerMenuItem";
1+
import NoteColorPicker from "../../../menus/custom-items/NoteColorPicker";
22
import FNote from "../../../entities/fnote";
33
import contextMenu, { ContextMenuEvent } from "../../../menus/context_menu";
44
import link_context_menu from "../../../menus/link_context_menu";
@@ -40,7 +40,7 @@ export function openCalendarContextMenu(e: ContextMenuEvent, noteId: string, par
4040
{ kind: "separator" },
4141
{
4242
kind: "custom",
43-
componentFn: () => NoteColorPickerMenuItem({note: noteId})
43+
componentFn: () => NoteColorPicker({note: noteId})
4444
}
4545
],
4646
selectMenuItemHandler: ({ command }) => link_context_menu.handleLinkContextMenuItem(command, noteId),

apps/client/src/widgets/collections/geomap/context_menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { LatLng, LeafletMouseEvent } from "leaflet";
22
import appContext, { type CommandMappings } from "../../../components/app_context.js";
33
import contextMenu, { type MenuItem } from "../../../menus/context_menu.js";
44
import linkContextMenu from "../../../menus/link_context_menu.js";
5-
import NoteColorPickerMenuItem from "../../../menus/custom-items/NoteColorPickerMenuItem.jsx";
5+
import NoteColorPicker from "../../../menus/custom-items/NoteColorPicker.jsx";
66
import { t } from "../../../services/i18n.js";
77
import { createNewNote } from "./api.js";
88
import { copyTextWithToast } from "../../../services/clipboard_ext.js";
@@ -23,7 +23,7 @@ export default function openContextMenu(noteId: string, e: LeafletMouseEvent, is
2323
{ kind: "separator"},
2424
{
2525
kind: "custom",
26-
componentFn: () => NoteColorPickerMenuItem({note: noteId})
26+
componentFn: () => NoteColorPicker({note: noteId})
2727
}
2828
];
2929
}

apps/client/src/widgets/collections/table/context_menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import link_context_menu from "../../../menus/link_context_menu.js";
77
import froca from "../../../services/froca.js";
88
import branches from "../../../services/branches.js";
99
import Component from "../../../components/component.js";
10-
import NoteColorPickerMenuItem from "../../../menus/custom-items/NoteColorPickerMenuItem.jsx";
10+
import NoteColorPicker from "../../../menus/custom-items/NoteColorPicker.jsx";
1111
import { RefObject } from "preact";
1212

1313
export function useContextMenu(parentNote: FNote, parentComponent: Component | null | undefined, tabulator: RefObject<Tabulator>): Partial<EventCallBackMethods> {
@@ -224,7 +224,7 @@ export function showRowContextMenu(parentComponent: Component, e: MouseEvent, ro
224224
{ kind: "separator"},
225225
{
226226
kind: "custom",
227-
componentFn: () => NoteColorPickerMenuItem({note: rowData.noteId})
227+
componentFn: () => NoteColorPicker({note: rowData.noteId})
228228
}
229229
],
230230
selectMenuItemHandler: ({ command }) => link_context_menu.handleLinkContextMenuItem(command, rowData.noteId),

0 commit comments

Comments
 (0)