mirror of
https://github.com/sechan100/daily-routine-2.git
synced 2026-07-22 05:37:51 +00:00
feat: Merge Note을 수동으로 할 수 있는 버튼 추가
This commit is contained in:
parent
0d8e474f4a
commit
021d5c8579
2 changed files with 18 additions and 45 deletions
|
|
@ -115,43 +115,4 @@ export const DailyRoutineView = () => {
|
|||
</TabNav>
|
||||
</MUIThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const SSSSSSS = () => {
|
||||
// return (
|
||||
// <VirtualSwiper
|
||||
// datas={[{key: "1", name: "Slide 1"}, {key: "2", name: "Slide 2"}, {key: "3", name: "Slide 3"}]}
|
||||
// loadEdgeData={async (edge, currentEdge) => {
|
||||
// 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 (<div
|
||||
// css={{
|
||||
// height: "60px",
|
||||
// display: "flex",
|
||||
// justifyContent: "center",
|
||||
// alignItems: "center",
|
||||
// border: "1px solid black",
|
||||
// }}
|
||||
// >
|
||||
// {data.name}
|
||||
// </div>
|
||||
// )}}
|
||||
// </VirtualSwiper>
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
|
@ -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 (
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in a new issue