From fee06527a8915054196ac5aa328766c792a7ef53 Mon Sep 17 00:00:00 2001 From: Triston Armstrong Date: Fri, 25 Oct 2024 11:18:42 +0700 Subject: [PATCH] fix: fix linter and type errors --- src/components/cardSelector/StickyNoteButton.tsx | 5 +++-- src/components/cardSelector/TextButton.tsx | 5 +++-- src/components/index.ts | 3 --- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/cardSelector/StickyNoteButton.tsx b/src/components/cardSelector/StickyNoteButton.tsx index 2104d30..a6acf54 100644 --- a/src/components/cardSelector/StickyNoteButton.tsx +++ b/src/components/cardSelector/StickyNoteButton.tsx @@ -1,5 +1,6 @@ import { NotesSigal } from "../../signals" import notes from "../../signals/notes" +import { CardTypes } from "../../types" import { updateLocalStorage } from "../../utils/localStorage" import { Tooltip } from "./Tooltip" import { defaultClassName } from "./utils" @@ -7,7 +8,7 @@ import { defaultClassName } from "./utils" export function StickyNoteButton() { function _handleClick(e: MouseEvent) { NotesSigal.default.addNote({ - type: "note", + type: CardTypes.NOTES, title: "New Note", contents: "", position: { @@ -19,7 +20,7 @@ export function StickyNoteButton() { h: 200 } }) - updateLocalStorage("notes", notes.notes.value) + updateLocalStorage(CardTypes.NOTES, notes.notes) } return ( diff --git a/src/components/cardSelector/TextButton.tsx b/src/components/cardSelector/TextButton.tsx index 5c2bc80..dcd3c30 100644 --- a/src/components/cardSelector/TextButton.tsx +++ b/src/components/cardSelector/TextButton.tsx @@ -3,13 +3,14 @@ import { TextSignal } from "../../signals"; import texts from "../../signals/texts"; import { updateLocalStorage } from "../../utils/localStorage"; import { defaultClassName } from "./utils"; +import { CardTypes } from "../../types"; export function TextButton() { function _handleClick(e: MouseEvent) { TextSignal.default.addText({ fontSize: 84, - type: "texts", + type: CardTypes.TEXTS, title: "New Note", contents: "todo: fill me", position: { @@ -21,7 +22,7 @@ export function TextButton() { h: 100 } }) - updateLocalStorage("texts", texts.texts).notify() + updateLocalStorage(CardTypes.TEXTS, texts.texts).notify() } return ( diff --git a/src/components/index.ts b/src/components/index.ts index 0f435ea..e7b81bf 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,4 +1 @@ -export * from "./CanvasItem" -export * from "./CanvasControls" export * from "./InfinateCanvas" -export * from "./CardSelector"