diff --git a/src/components/ImageCard.tsx b/src/components/ImageCard.tsx index 3601c73..bbecaaa 100644 --- a/src/components/ImageCard.tsx +++ b/src/components/ImageCard.tsx @@ -91,7 +91,6 @@ export function ImageCard({ key: itemKey, data: item }: ImageCard.ImageCardProps function _handleClose(_e: Event) { ImagesSignal.default.removeImage(item.id) ImagesSignal.default.images.notify() - debounceLSUpdate() } return ( diff --git a/src/components/TextItem.tsx b/src/components/TextItem.tsx index ef5afac..3c0b9e9 100644 --- a/src/components/TextItem.tsx +++ b/src/components/TextItem.tsx @@ -4,6 +4,7 @@ import { useDebounce } from "../utils/useDebounce" import texts, { TextCardType } from "../signals/texts" import { LayerEnum } from "../utils/enums" import { Card } from "../types" +import { useThemeDetector } from "../utils/useThemeDetector" namespace TextItem { export interface TextCardProps { @@ -92,6 +93,12 @@ export function TextItem({ key: itemKey, data: item }: TextItem.TextCardProps) { updateLocalStorage() } + function _handleClose(e: MouseEvent) { + e.stopPropagation() + TextSignal.default.removeText(item.id) + TextSignal.default.texts.notify() + } + return (
) } -function ExpandIcon({ cb, item }: { - cb: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null | undefined, - item: TextSignal.TextCardType -}) { +namespace CloseIcon { + export interface Props { + cb: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null | undefined, + item: TextSignal.TextCardType + } +} +function CloseIcon({ item, cb }: CloseIcon.Props) { + const isDark = useThemeDetector() + return ( + + + + + + ) +} + +namespace ExpandIcon { + export interface Props { + cb: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null | undefined, + item: TextSignal.TextCardType + } +} +function ExpandIcon({ cb, item }: ExpandIcon.Props) { + const isDark = useThemeDetector() return (