This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add acknowledgments section and appearance switch [NOTICKET]
- Loading branch information
Showing
8 changed files
with
527 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
"use client" | ||
|
||
import { Cog } from "lucide-react" | ||
import { useTheme } from "next-themes" | ||
import { FC, useState } from "react" | ||
import { | ||
AlertDialog, | ||
AlertDialogCancel, | ||
AlertDialogContent, | ||
AlertDialogDescription, | ||
AlertDialogFooter, | ||
AlertDialogHeader, | ||
AlertDialogTitle, | ||
} from "./ui/alert-dialog" | ||
import { Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarTrigger } from "./ui/menubar" | ||
|
||
interface SettingsMenuProps { | ||
downloadOnClick: () => void | ||
} | ||
|
||
export const SettingsMenu: FC<SettingsMenuProps> = ({ downloadOnClick }) => { | ||
const { setTheme, theme } = useTheme() | ||
const [isAckknowledgmentsOpen, setAckknowledgmentsOpen] = useState(false) | ||
|
||
return ( | ||
<> | ||
<Menubar> | ||
<MenubarMenu> | ||
<MenubarTrigger onClick={downloadOnClick}>Download</MenubarTrigger> | ||
</MenubarMenu> | ||
<MenubarMenu> | ||
<MenubarTrigger title="Settings"> | ||
<Cog className="h-5 w-5" /> | ||
</MenubarTrigger> | ||
<MenubarContent> | ||
<MenubarItem onClick={() => setTheme(theme === "light" ? "dark" : "light")}>Switch Appearance</MenubarItem> | ||
<MenubarSeparator /> | ||
<MenubarItem onClick={() => setAckknowledgmentsOpen(true)}>Acknowledgments</MenubarItem> | ||
<MenubarItem disabled>v1.0.1</MenubarItem> | ||
</MenubarContent> | ||
</MenubarMenu> | ||
</Menubar> | ||
<AlertDialog | ||
open={isAckknowledgmentsOpen} | ||
onOpenChange={(isAckknowledgmentsOpen) => { | ||
if (isAckknowledgmentsOpen === true) return | ||
setAckknowledgmentsOpen(false) | ||
}} | ||
> | ||
<AlertDialogContent> | ||
<AlertDialogHeader> | ||
<AlertDialogTitle> Acknowledgments</AlertDialogTitle> | ||
<AlertDialogDescription> | ||
We are deeply inspired by the creativity and innovation of countless individuals and projects, which have | ||
fueled our own endeavors and shaped the direction of this work. | ||
<ul className="mt-4 space-y-1"> | ||
<li> | ||
<a | ||
href="https://amac.zephra.org" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="font-medium underline underline-offset-4" | ||
> | ||
Amac | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://coverx.vercel.app" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="font-medium underline underline-offset-4" | ||
> | ||
CoverX | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://apps.apple.com/en/app/denim-playlist-cover-maker/id1532250420" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="font-medium underline underline-offset-4" | ||
> | ||
Denim | ||
</a> | ||
</li> | ||
</ul> | ||
</AlertDialogDescription> | ||
</AlertDialogHeader> | ||
<AlertDialogFooter> | ||
<AlertDialogCancel>Close</AlertDialogCancel> | ||
</AlertDialogFooter> | ||
</AlertDialogContent> | ||
</AlertDialog> | ||
</> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
"use client" | ||
|
||
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" | ||
import * as React from "react" | ||
|
||
import { buttonVariants } from "@/components/ui/button" | ||
import { cn } from "@/lib/utils" | ||
|
||
const AlertDialog = AlertDialogPrimitive.Root | ||
|
||
const AlertDialogTrigger = AlertDialogPrimitive.Trigger | ||
|
||
const AlertDialogPortal = ({ className, ...props }: AlertDialogPrimitive.AlertDialogPortalProps) => ( | ||
<AlertDialogPrimitive.Portal className={cn(className)} {...props} /> | ||
) | ||
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName | ||
|
||
const AlertDialogOverlay = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Overlay>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay> | ||
>(({ className, children, ...props }, ref) => ( | ||
<AlertDialogPrimitive.Overlay | ||
className={cn( | ||
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", | ||
className | ||
)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
)) | ||
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName | ||
|
||
const AlertDialogContent = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> | ||
>(({ className, ...props }, ref) => ( | ||
<AlertDialogPortal> | ||
<AlertDialogOverlay /> | ||
<AlertDialogPrimitive.Content | ||
ref={ref} | ||
className={cn( | ||
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
</AlertDialogPortal> | ||
)) | ||
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName | ||
|
||
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => ( | ||
<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} /> | ||
) | ||
AlertDialogHeader.displayName = "AlertDialogHeader" | ||
|
||
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => ( | ||
<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} /> | ||
) | ||
AlertDialogFooter.displayName = "AlertDialogFooter" | ||
|
||
const AlertDialogTitle = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Title>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title> | ||
>(({ className, ...props }, ref) => ( | ||
<AlertDialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold", className)} {...props} /> | ||
)) | ||
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName | ||
|
||
const AlertDialogDescription = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Description>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description> | ||
>(({ className, ...props }, ref) => ( | ||
<AlertDialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} /> | ||
)) | ||
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName | ||
|
||
const AlertDialogAction = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Action>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> | ||
>(({ className, ...props }, ref) => ( | ||
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} /> | ||
)) | ||
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName | ||
|
||
const AlertDialogCancel = React.forwardRef< | ||
React.ElementRef<typeof AlertDialogPrimitive.Cancel>, | ||
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> | ||
>(({ className, ...props }, ref) => ( | ||
<AlertDialogPrimitive.Cancel | ||
ref={ref} | ||
className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)} | ||
{...props} | ||
/> | ||
)) | ||
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName | ||
|
||
export { | ||
AlertDialog, | ||
AlertDialogTrigger, | ||
AlertDialogContent, | ||
AlertDialogHeader, | ||
AlertDialogFooter, | ||
AlertDialogTitle, | ||
AlertDialogDescription, | ||
AlertDialogAction, | ||
AlertDialogCancel, | ||
} |
Oops, something went wrong.