diff --git a/apps/web/components/toolbar/download-base-palette.tsx b/apps/web/components/toolbar/download-base-palette.tsx index 19179ca..a14feb7 100644 --- a/apps/web/components/toolbar/download-base-palette.tsx +++ b/apps/web/components/toolbar/download-base-palette.tsx @@ -1,33 +1,39 @@ "use client"; import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@ui/components/ui/dialog"; -import DesktopPreviewToolbarIcon from "../ui/desktop-primary-toolbar-button"; + Popover, + PopoverContent, + PopoverTrigger, +} from "@ui/components/ui/popover"; + import primaryToolbarMenu from "../ui/primary-toolbar-menu"; +import { useState } from "react"; +import dynamic from "next/dynamic"; +import { Skeleton } from "ui/components/ui/skeleton"; +import { usePathname } from "next/navigation"; +import ToolbarMenuItem from "./toolbar-menu-item"; + +const DownloadBasePalettePlugin = dynamic( + () => import("@/components/toolbar/plugin/download-base-palette.plugin"), + { + loading: () => , + ssr: false, + }, +); function ToolbarDownloadBasePalette() { const menuItem = primaryToolbarMenu.Download; + const pathname = usePathname(); + const [open, setOpen] = useState(false); + if (pathname !== "/") return null; return ( - - {/* //TODO Add function */} - - - - - - Are you sure absolutely sure? - - This action cannot be undone. This will permanently delete your - account and remove your data from our servers. - - - - + + + + + + {open && } + + ); } diff --git a/apps/web/components/toolbar/plugin/shareable-link.plugin.tsx b/apps/web/components/toolbar/plugin/shareable-link.plugin.tsx index 5950893..3af20b0 100644 --- a/apps/web/components/toolbar/plugin/shareable-link.plugin.tsx +++ b/apps/web/components/toolbar/plugin/shareable-link.plugin.tsx @@ -38,7 +38,7 @@ function ShareableLinkPlugin({ colors, setOpen }) { Social preview import("@/components/toolbar/plugin/shareable-link.plugin"), @@ -37,7 +38,7 @@ function ToolbarShareableLink() { return ( - + {open && } diff --git a/apps/web/components/toolbar/toolbar-menu-item.tsx b/apps/web/components/toolbar/toolbar-menu-item.tsx new file mode 100644 index 0000000..1a5baab --- /dev/null +++ b/apps/web/components/toolbar/toolbar-menu-item.tsx @@ -0,0 +1,21 @@ +import { ToolbarMenu } from "../ui/primary-toolbar-menu"; +import DesktopPreviewToolbarIcon from "../ui/desktop-primary-toolbar-button"; + +const ToolbarMenuItem = ({ title, description, icon: Icon }: ToolbarMenu) => ( +
+ +
+
+
+ +
+
+
+
{title}
+
{description}
+
+
+
+); + +export default ToolbarMenuItem; diff --git a/apps/web/components/toolbar/upload-image.tsx b/apps/web/components/toolbar/upload-image.tsx index 5bc3050..9d803b7 100644 --- a/apps/web/components/toolbar/upload-image.tsx +++ b/apps/web/components/toolbar/upload-image.tsx @@ -7,8 +7,8 @@ import { DialogTitle, DialogTrigger, } from "@ui/components/ui/dialog"; -import DesktopPreviewToolbarIcon from "../ui/desktop-primary-toolbar-button"; import primaryToolbarMenu from "../ui/primary-toolbar-menu"; +import ToolbarMenuItem from "./toolbar-menu-item"; function ToolbarUploadImage() { const menuItem = primaryToolbarMenu["Upload Image"]; @@ -16,7 +16,7 @@ function ToolbarUploadImage() { {/* //TODO Add function */} - + diff --git a/apps/web/components/ui/desktop-primary-toolbar-button.tsx b/apps/web/components/ui/desktop-primary-toolbar-button.tsx index 20bc281..6c267af 100644 --- a/apps/web/components/ui/desktop-primary-toolbar-button.tsx +++ b/apps/web/components/ui/desktop-primary-toolbar-button.tsx @@ -29,7 +29,7 @@ const DesktopPreviewToolbarIcon = ({ variant="ghost" aria-label={title} size="icon" - className="flex h-8 w-8 select-none items-center rounded-sm px-1 py-1 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground" + className="hidden h-8 w-8 select-none items-center rounded-sm px-1 py-1 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground lg:flex" asChild >
diff --git a/apps/web/components/ui/mobile-primary-menu.tsx b/apps/web/components/ui/mobile-primary-menu.tsx index 4368d82..f9d6d7d 100644 --- a/apps/web/components/ui/mobile-primary-menu.tsx +++ b/apps/web/components/ui/mobile-primary-menu.tsx @@ -10,6 +10,7 @@ import { import { cn } from "@ui/lib/utils"; import { ChevronUp, Download, ImagePlus, LucideIcon, Menu } from "lucide-react"; import primaryToolbarMenu from "./primary-toolbar-menu"; +import { Toolbar } from "../toolbar"; function MobilePrimaryMenu({ disabled }: { disabled: boolean }) { return ( @@ -28,39 +29,23 @@ function MobilePrimaryMenu({ disabled }: { disabled: boolean }) { - + Tools - {/* {primaryToolbarMenu.map(({ title, description, icon: Icon }) => ( - - + + e.preventDefault()}> + - ))} */} + e.preventDefault()}> + + + e.preventDefault()}> + + + ); } -const MenuItem = ({ - title, - description, - icon: Icon, -}: { - title: string; - description: string; - icon: LucideIcon; -}) => ( -
-
-
- -
-
-
-
{title}
-
{description}
-
-
-); - export default MobilePrimaryMenu; diff --git a/apps/web/components/ui/primary-toolbar-menu.tsx b/apps/web/components/ui/primary-toolbar-menu.tsx index ff8e255..5c58117 100644 --- a/apps/web/components/ui/primary-toolbar-menu.tsx +++ b/apps/web/components/ui/primary-toolbar-menu.tsx @@ -24,7 +24,7 @@ const primaryToolbarMenu: PrimaryToolbarMenu = { }, [ToolbarMenus.DOWNLOAD]: { title: "Download", - description: "Coming Soon... Download the current palette as a PNG", + description: "Download the current palette as a PNG", icon: Download, }, [ToolbarMenus.SHARE]: {