From 6bbed4100a9076ab61ad8ffa15b419d8b10ca213 Mon Sep 17 00:00:00 2001 From: Triston Armstrong Date: Mon, 7 Oct 2024 01:33:25 -0400 Subject: [PATCH] add tooltips to creation buttons --- src/components/cardSelector/ExportButton.tsx | 39 +++++++------ .../cardSelector/ImageCardButton.tsx | 55 ++++++++++--------- src/components/cardSelector/ImportButton.tsx | 39 +++++++------ .../cardSelector/StickyNoteButton.tsx | 37 +++++++------ src/components/cardSelector/TextButton.tsx | 35 ++++++------ src/components/cardSelector/Tooltip.tsx | 8 +++ 6 files changed, 118 insertions(+), 95 deletions(-) create mode 100644 src/components/cardSelector/Tooltip.tsx diff --git a/src/components/cardSelector/ExportButton.tsx b/src/components/cardSelector/ExportButton.tsx index a48948b..f2aa17c 100644 --- a/src/components/cardSelector/ExportButton.tsx +++ b/src/components/cardSelector/ExportButton.tsx @@ -1,4 +1,5 @@ import { ImagesSignal, NotesSigal } from "../../signals" +import { Tooltip } from "./Tooltip" import { defaultClassName } from "./utils" export function ExportButton() { @@ -25,23 +26,25 @@ export function ExportButton() { } return ( - - - - - + + + + + + + ) } diff --git a/src/components/cardSelector/ImageCardButton.tsx b/src/components/cardSelector/ImageCardButton.tsx index 4643010..018d354 100644 --- a/src/components/cardSelector/ImageCardButton.tsx +++ b/src/components/cardSelector/ImageCardButton.tsx @@ -1,6 +1,7 @@ import { ImagesSignal } from "../../signals" import images from "../../signals/images" import { updateLocalStorage } from "../../utils/localStorage" +import { Tooltip } from "./Tooltip" import { defaultClassName } from "./utils" export function ImageCardButton() { @@ -48,31 +49,33 @@ export function ImageCardButton() { } return ( - - - - - + + + + + + + ) } diff --git a/src/components/cardSelector/ImportButton.tsx b/src/components/cardSelector/ImportButton.tsx index 90f5952..5a41c7d 100644 --- a/src/components/cardSelector/ImportButton.tsx +++ b/src/components/cardSelector/ImportButton.tsx @@ -3,6 +3,7 @@ import notes from "../../signals/notes" import { Card } from "../../types" import { convertBase64ToJson } from "../../utils/convertBase64ToJson" import { updateLocalStorage } from "../../utils/localStorage" +import { Tooltip } from "./Tooltip" import { defaultClassName } from "./utils" export function ImportButton() { @@ -44,23 +45,25 @@ export function ImportButton() { } return ( - - - - - + + + + + + + ) } diff --git a/src/components/cardSelector/StickyNoteButton.tsx b/src/components/cardSelector/StickyNoteButton.tsx index ac302b9..2104d30 100644 --- a/src/components/cardSelector/StickyNoteButton.tsx +++ b/src/components/cardSelector/StickyNoteButton.tsx @@ -1,6 +1,7 @@ import { NotesSigal } from "../../signals" import notes from "../../signals/notes" import { updateLocalStorage } from "../../utils/localStorage" +import { Tooltip } from "./Tooltip" import { defaultClassName } from "./utils" export function StickyNoteButton() { @@ -22,23 +23,25 @@ export function StickyNoteButton() { } return ( - - - - + + + + + + ) } diff --git a/src/components/cardSelector/TextButton.tsx b/src/components/cardSelector/TextButton.tsx index f2dabc4..0abe079 100644 --- a/src/components/cardSelector/TextButton.tsx +++ b/src/components/cardSelector/TextButton.tsx @@ -1,23 +1,26 @@ +import { Tooltip } from "./Tooltip"; import { defaultClassName } from "./utils"; export function TextButton() { return ( - - - - - + + + + + + + ) } diff --git a/src/components/cardSelector/Tooltip.tsx b/src/components/cardSelector/Tooltip.tsx new file mode 100644 index 0000000..79efa48 --- /dev/null +++ b/src/components/cardSelector/Tooltip.tsx @@ -0,0 +1,8 @@ +export function Tooltip({ children, message }: { children: JSX.Element, message: string }) { + return ( +
+ {children} +
+ ) +}