22
33import { useEffect , useRef , useState } from "react" ;
44import Link from "next/link" ;
5- import { Coffee , Github , Heart , Twitter } from "lucide-react" ;
5+ import { Coffee , Github , Heart , Menu , Twitter } from "lucide-react" ;
66import { HugeiconsIcon } from "@hugeicons/react" ;
77import {
88 GridTableIcon ,
@@ -299,10 +299,12 @@ export default function Toolbar() {
299299 } , [ undo , canUndo ] ) ;
300300
301301 return (
302- < div className = "flex items-center gap-2 border-b bg-background px-4 py-2" >
303- < Link href = "/" className = "flex items-center gap-2 mr-4" >
302+ < div className = "flex items-center gap-1 border-b bg-background px-2 py-2 sm:gap-2 sm:px-4 " >
303+ < Link href = "/" className = "mr-1 flex shrink-0 items-center gap-2 sm: mr-4" >
304304 < img src = "/logo.png" alt = "Isoshire" className = "w-10 object-contain" />
305- < h1 className = { `text-3xl font-bold ${ bilboSwashCaps . className } ` } >
305+ < h1
306+ className = { `hidden text-3xl font-bold md:block ${ bilboSwashCaps . className } ` }
307+ >
306308 Iso Middle Earth
307309 </ h1 >
308310 </ Link >
@@ -356,7 +358,7 @@ export default function Toolbar() {
356358 >
357359 < SelectTrigger
358360 aria-label = "Choose location"
359- className = "border-zinc-300 bg-linear-to-t from-muted to-background shadow-xs shadow-zinc-950/10 hover:to-muted dark:from-muted/50 dark:border-border duration-200 "
361+ className = "w-[118px] border-zinc-300 bg-linear-to-t from-muted to-background shadow-xs shadow-zinc-950/10 duration-200 hover:to-muted sm:w-[156px] dark:border-border dark:from-muted/50 "
360362 >
361363 < SelectValue placeholder = "Choose location" />
362364 </ SelectTrigger >
@@ -390,10 +392,10 @@ export default function Toolbar() {
390392 < TooltipTrigger asChild >
391393 < Button
392394 variant = "outline"
395+ size = "icon"
393396 onClick = { undo }
394397 disabled = { ! canUndo }
395398 aria-label = "Undo"
396- className = "gap-2"
397399 >
398400 < HugeiconsIcon icon = { Undo02Icon } />
399401 </ Button >
@@ -414,6 +416,7 @@ export default function Toolbar() {
414416 size = "icon"
415417 onClick = { handleExport }
416418 aria-label = "Export PNG"
419+ className = "hidden sm:inline-flex"
417420 >
418421 < HugeiconsIcon icon = { Download01Icon } className = "h-4 w-4" />
419422 </ Button >
@@ -425,6 +428,7 @@ export default function Toolbar() {
425428 variant = "outline"
426429 size = "icon"
427430 aria-label = "Save and load states"
431+ className = "hidden sm:inline-flex"
428432 >
429433 < HugeiconsIcon icon = { FloppyDiskIcon } className = "h-4 w-4" />
430434 </ Button >
@@ -475,13 +479,89 @@ export default function Toolbar() {
475479 </ DialogContent >
476480 </ Dialog >
477481
478- < Button variant = "outline" size = "icon" asChild aria-label = "Collections" >
482+ < Button
483+ variant = "outline"
484+ size = "icon"
485+ asChild
486+ aria-label = "Collections"
487+ className = "hidden sm:inline-flex"
488+ >
479489 < Link href = "/collections" >
480490 < HugeiconsIcon icon = { AdventureIcon } />
481491 </ Link >
482492 </ Button >
483493
484- < div className = "ml-auto flex items-center gap-1" >
494+ < Dialog >
495+ < DialogTrigger asChild >
496+ < Button
497+ variant = "outline"
498+ size = "icon"
499+ className = "ml-auto sm:hidden"
500+ aria-label = "Open more options"
501+ >
502+ < Menu className = "h-4 w-4" />
503+ </ Button >
504+ </ DialogTrigger >
505+ < DialogContent className = "max-w-xs" >
506+ < DialogHeader >
507+ < DialogTitle > More</ DialogTitle >
508+ </ DialogHeader >
509+ < div className = "grid gap-2" >
510+ < Button
511+ variant = "outline"
512+ className = "justify-start gap-2"
513+ onClick = { handleExport }
514+ >
515+ < HugeiconsIcon icon = { Download01Icon } className = "h-4 w-4" />
516+ Export PNG
517+ </ Button >
518+ < Button variant = "outline" asChild className = "justify-start gap-2" >
519+ < Link href = "/collections" >
520+ < HugeiconsIcon icon = { AdventureIcon } className = "h-4 w-4" />
521+ Collections
522+ </ Link >
523+ </ Button >
524+ < Button variant = "outline" asChild className = "justify-start gap-2" >
525+ < a href = "https://x.com/strad3r" target = "_blank" rel = "noreferrer" >
526+ < Twitter className = "h-4 w-4" />
527+ X / Twitter
528+ </ a >
529+ </ Button >
530+ < Button variant = "outline" asChild className = "justify-start gap-2" >
531+ < a
532+ href = "https://github.com/hasanharman/isoshire"
533+ target = "_blank"
534+ rel = "noreferrer"
535+ >
536+ < Github className = "h-4 w-4" />
537+ GitHub
538+ </ a >
539+ </ Button >
540+ < Button variant = "outline" asChild className = "justify-start gap-2" >
541+ < a
542+ href = "https://github.com/sponsors/hasanharman"
543+ target = "_blank"
544+ rel = "noreferrer"
545+ >
546+ < Heart className = "h-4 w-4" />
547+ Sponsor
548+ </ a >
549+ </ Button >
550+ < Button variant = "outline" asChild className = "justify-start gap-2" >
551+ < a
552+ href = "https://buymeacoffee.com/hasanharman"
553+ target = "_blank"
554+ rel = "noreferrer"
555+ >
556+ < Coffee className = "h-4 w-4" />
557+ Buy Me a Coffee
558+ </ a >
559+ </ Button >
560+ </ div >
561+ </ DialogContent >
562+ </ Dialog >
563+
564+ < div className = "ml-auto hidden items-center gap-1 sm:flex" >
485565 < Button variant = "ghost" size = "icon" asChild aria-label = "X @strad3r" >
486566 < a href = "https://x.com/strad3r" target = "_blank" rel = "noreferrer" >
487567 < Twitter className = "h-4 w-4" />
0 commit comments