refactor(notes): use shared types and interfaces in components
This commit is contained in:
1 parent
2975b80a94
commit
557e48116a
12 files changed
+16
-57
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import type { Note } from './types'
|
||||
import type { NotePatch } from './types/note'
|
||||
import { useNotes } from './hooks/useNotes'
|
||||
import NoteList from './components/NoteList'
|
||||
import NoteEditor from './components/NoteEditor'
|
||||
@@ -21,7 +21,7 @@ function App() {
|
||||
setCreating(false)
|
||||
}
|
||||
|
||||
const handleUpdate = (id: number, patch: Partial<Pick<Note, 'title' | 'content'>>) => {
|
||||
const handleUpdate = (id: number, patch: NotePatch) => {
|
||||
updateNote(id, patch)
|
||||
setSelectedId(null)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user