Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed May 30, 2024
1 parent 0bd63b0 commit 4fc1a98
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
23 changes: 12 additions & 11 deletions src/renderer/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ import {
NavigationMenuLink,
NavigationMenuList,
navigationMenuTriggerStyle,
} from "@renderer/components/ui/navigation-menu";
import { Link } from "react-router-dom";
import { UserButton } from "./user-button";
} from "@renderer/components/ui/navigation-menu"
import { Link } from "react-router-dom"

import { UserButton } from "./user-button"

const items = [{
name: 'Home',
link: '/'
name: "Home",
link: "/",
}, {
name: 'Download',
link: '/download'
name: "Download",
link: "/download",
}, {
name: 'Blog',
link: '/blog'
name: "Blog",
link: "/blog",
}]

export function Header() {
return (
<header className="w-full border-b px-10 py-3">
<div className="flex items-center justify-between w-full max-w-[1400px] mx-auto">
<div className="mx-auto flex w-full max-w-[1400px] items-center justify-between">
<div className="flex items-center gap-8">
<div className="flex items-center gap-2 text-xl font-bold">
<img src="../icon.svg" alt="logo" className="size-8" />
Expand All @@ -45,5 +46,5 @@ export function Header() {
<UserButton className="h-10 bg-transparent px-10 py-0" />
</div>
</header>
);
)
}
34 changes: 17 additions & 17 deletions src/renderer/src/components/ui/navigation-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from "react"
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
import { cn } from "@renderer/lib/utils"
import { cva } from "class-variance-authority"
import { ChevronDown } from "lucide-react"

import { cn } from "@renderer/lib/utils"
import * as React from "react"

const NavigationMenu = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
Expand All @@ -13,7 +12,7 @@ const NavigationMenu = React.forwardRef<
ref={ref}
className={cn(
"relative z-10 flex max-w-max flex-1 items-center justify-center",
className
className,
)}
{...props}
>
Expand All @@ -31,7 +30,7 @@ const NavigationMenuList = React.forwardRef<
ref={ref}
className={cn(
"group flex flex-1 list-none items-center justify-center space-x-1",
className
className,
)}
{...props}
/>
Expand All @@ -41,7 +40,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
const NavigationMenuItem = NavigationMenuPrimitive.Item

const navigationMenuTriggerStyle = cva(
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",
)

const NavigationMenuTrigger = React.forwardRef<
Expand All @@ -53,9 +52,10 @@ const NavigationMenuTrigger = React.forwardRef<
className={cn(navigationMenuTriggerStyle(), "group", className)}
{...props}
>
{children}{" "}
{children}
{" "}
<ChevronDown
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
className="relative top-px ml-1 size-3 transition duration-200 group-data-[state=open]:rotate-180"
aria-hidden="true"
/>
</NavigationMenuPrimitive.Trigger>
Expand All @@ -70,7 +70,7 @@ const NavigationMenuContent = React.forwardRef<
ref={ref}
className={cn(
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
className
className,
)}
{...props}
/>
Expand All @@ -87,7 +87,7 @@ const NavigationMenuViewport = React.forwardRef<
<NavigationMenuPrimitive.Viewport
className={cn(
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
className
className,
)}
ref={ref}
{...props}
Expand All @@ -105,24 +105,24 @@ const NavigationMenuIndicator = React.forwardRef<
ref={ref}
className={cn(
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
className
className,
)}
{...props}
>
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
<div className="relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
</NavigationMenuPrimitive.Indicator>
))
NavigationMenuIndicator.displayName =
NavigationMenuPrimitive.Indicator.displayName

export {
navigationMenuTriggerStyle,
NavigationMenu,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuContent,
NavigationMenuTrigger,
NavigationMenuLink,
NavigationMenuIndicator,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
NavigationMenuViewport,
}

0 comments on commit 4fc1a98

Please sign in to comment.