From 021d5c8579bc75105d11e15ef8822c1f947fed85 Mon Sep 17 00:00:00 2001 From: sechan100 Date: Thu, 26 Dec 2024 11:07:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Merge=20Note=EC=9D=84=20=EC=88=98?= =?UTF-8?q?=EB=8F=99=EC=9C=BC=EB=A1=9C=20=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/ui/DailyRoutineView.tsx | 41 +----------------------------- src/pages/routine-note/Content.tsx | 22 ++++++++++++---- 2 files changed, 18 insertions(+), 45 deletions(-) diff --git a/src/app/ui/DailyRoutineView.tsx b/src/app/ui/DailyRoutineView.tsx index 0d2f1e1..2dd0562 100644 --- a/src/app/ui/DailyRoutineView.tsx +++ b/src/app/ui/DailyRoutineView.tsx @@ -115,43 +115,4 @@ export const DailyRoutineView = () => { ); -} - - - - - - - - - -// const SSSSSSS = () => { -// return ( -// { -// if(edge === "start"){ -// const newKey = `${Number(currentEdge.key) - 1 }`; -// return {key: newKey, name: `Slide ${newKey}` } -// } else { -// const newKey = `${Number(currentEdge.key) + 1 }`; -// return {key: newKey, name: `Slide ${newKey}` } -// } -// }} -// > -// {(data) => { -// return (
-// {data.name} -//
-// )}} -//
-// ); -// } +} \ No newline at end of file diff --git a/src/pages/routine-note/Content.tsx b/src/pages/routine-note/Content.tsx index c4d0e8a..72361dd 100644 --- a/src/pages/routine-note/Content.tsx +++ b/src/pages/routine-note/Content.tsx @@ -9,9 +9,10 @@ import { useStartRoutineModal } from '@widgets/routine'; import { TaskGroupWidget, useCreateGroupModal } from '@widgets/task-group'; import { useAddTodoModal } from '@widgets/todo'; import { WeeksWidget } from "@widgets/weeks"; -import { Menu } from "obsidian"; +import { Menu, Notice } from "obsidian"; import { useCallback, useMemo } from "react"; import { NoteContext } from './NoteContext'; +import { useRoutineMutationMerge } from '@features/merge-note'; const startRoutineIcon = "alarm-clock-plus"; @@ -22,7 +23,7 @@ const bem = dr("note"); export const RoutineNoteContent = () => { const note = useRoutineNote(n=>n.note); - const performance = useMemo(() => NoteEntity.getPerformance(note), [note]); + const { mergeNotes } = useRoutineMutationMerge(); const AddTodoModal = useAddTodoModal(); const StartRoutineModal = useStartRoutineModal(); @@ -38,8 +39,8 @@ export const RoutineNoteContent = () => { }); }); - m.addSeparator(); // Add Todo + m.addSeparator(); m.addItem(item => { item.setIcon(addTodoIcon); item.setTitle("Add Todo"); @@ -48,8 +49,8 @@ export const RoutineNoteContent = () => { }); }); - m.addSeparator(); // Add Group + m.addSeparator(); m.addItem(item => { item.setIcon("folder"); item.setTitle("Add Group"); @@ -57,8 +58,19 @@ export const RoutineNoteContent = () => { CreateGroupModal.open({}); }); }); + + // mergeNotes + m.addSeparator(); + m.addItem(item => { + item.setIcon("merge"); + item.setTitle("Merge Notes"); + item.onClick(() => { + mergeNotes(); + new Notice("All Notes Merged!"); + }); + }); - }, [AddTodoModal, CreateGroupModal, StartRoutineModal]); + }, [AddTodoModal, CreateGroupModal, StartRoutineModal, mergeNotes]); return (