cleanup classnames and add text button

This commit is contained in:
Triston Armstrong 2024-10-06 11:34:59 -04:00
parent 5c5740bc73
commit c5abeb7a31
6 changed files with 76 additions and 47 deletions

View File

@ -2,6 +2,7 @@ import { useRef } from "kaioken"
import { StickyNoteButton } from "./StickyNoteButton" import { StickyNoteButton } from "./StickyNoteButton"
import { ImageCardButton } from "./ImageCardButton" import { ImageCardButton } from "./ImageCardButton"
import { ExportButton } from "./ExportButton" import { ExportButton } from "./ExportButton"
import { TextButton } from "./TextButton"
export function CardSelector() { export function CardSelector() {
const containerRef = useRef<HTMLDivElement>(null) const containerRef = useRef<HTMLDivElement>(null)
@ -15,7 +16,10 @@ export function CardSelector() {
}}> }}>
<StickyNoteButton /> <StickyNoteButton />
<ImageCardButton /> <ImageCardButton />
<TextButton />
<Divider /> <Divider />
<ExportButton /> <ExportButton />
</div> </div>
) )
@ -27,7 +31,6 @@ function Divider() {
margin: '2px 2px', margin: '2px 2px',
border: "1px solid #9c9c9c", border: "1px solid #9c9c9c",
borderRight: 'none', borderRight: 'none',
borderLeft: 'none',
}}></div> }}></div>
) )
} }

View File

@ -1,4 +1,5 @@
import { ImagesSignal, NotesSigal } from "../../signals" import { ImagesSignal, NotesSigal } from "../../signals"
import { defaultClassName } from "./utils"
export function ExportButton() { export function ExportButton() {
@ -35,7 +36,7 @@ export function ExportButton() {
stroke-width="2" stroke-width="2"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
className="cursor-pointer w-5 h-5 text-[#9c9c9c] hover:text-blue-500 transition-color duration-300" className={defaultClassName}
> >
<path <path
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /> d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />

View File

@ -1,6 +1,7 @@
import { ImagesSignal } from "../../signals" import { ImagesSignal } from "../../signals"
import images from "../../signals/images" import images from "../../signals/images"
import { updateLocalStorage } from "../../utils/localStorage" import { updateLocalStorage } from "../../utils/localStorage"
import { defaultClassName } from "./utils"
export function ImageCardButton() { export function ImageCardButton() {
function _handleClick(mouseEvent: MouseEvent) { function _handleClick(mouseEvent: MouseEvent) {
@ -47,8 +48,8 @@ export function ImageCardButton() {
} }
return ( return (
<button onclick={_handleClick}>
<svg <svg
onclick={_handleClick}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
height="24" height="24"
@ -58,7 +59,7 @@ export function ImageCardButton() {
stroke-width="2" stroke-width="2"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
className="w-5 h-5 text-[#9c9c9c] hover:text-blue-500 transition-color duration-300"> className={defaultClassName}>
<rect <rect
width="18" width="18"
height="18" height="18"
@ -73,6 +74,5 @@ export function ImageCardButton() {
<path <path
d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" /> d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />
</svg> </svg>
</button>
) )
} }

View File

@ -1,6 +1,7 @@
import { NotesSigal } from "../../signals" import { NotesSigal } from "../../signals"
import notes from "../../signals/notes" import notes from "../../signals/notes"
import { updateLocalStorage } from "../../utils/localStorage" import { updateLocalStorage } from "../../utils/localStorage"
import { defaultClassName } from "./utils"
export function StickyNoteButton() { export function StickyNoteButton() {
function _handleClick(e: MouseEvent) { function _handleClick(e: MouseEvent) {
@ -21,8 +22,8 @@ export function StickyNoteButton() {
} }
return ( return (
<button onclick={_handleClick} className="cursor-pointer">
<svg <svg
onclick={_handleClick}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
height="24" height="24"
@ -32,13 +33,12 @@ export function StickyNoteButton() {
stroke-width="2" stroke-width="2"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
className="w-5 h-5 text-[#9c9c9c] hover:text-blue-500 transition-color duration-300"> className={defaultClassName}>
<path <path
d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z" /> d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z" />
<path <path
d="M15 3v4a2 2 0 0 0 2 2h4" /> d="M15 3v4a2 2 0 0 0 2 2h4" />
</svg> </svg>
</button>
) )
} }

View File

@ -0,0 +1,23 @@
import { defaultClassName } from "./utils";
export function TextButton() {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
className={defaultClassName}
>
<path d="M4 20h16" />
<path d="m6 16 6-12 6 12" />
<path d="M8 12h8" />
</svg>
)
}

View File

@ -0,0 +1,2 @@
export const defaultClassName =
"cursor-pointer w-5 h-5 text-[#9c9c9c] hover:text-blue-500 transition-color duration-300"