Skip to content

Commit

Permalink
build: fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
brankoconjic committed Jun 18, 2024
1 parent 490dcbb commit 10d5674
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 49 deletions.
61 changes: 21 additions & 40 deletions apps/docs/src/components/header/navigation/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const NavRoot = forwardRef<NavRootElement, NavRootProps>((props, ref) => {

return (
<NavigationMenu.Root
className={cn(
"self-stretch text-[15px] leading-6 text-white/60",
className
)}
className={cn("self-stretch text-[15px] leading-6 text-white/60", className)}
{...otherProps}
ref={ref}
/>
Expand All @@ -36,28 +33,20 @@ NavList.displayName = "NavList";

/* --------------------------------- Trigger -------------------------------- */
type NavListTriggerElement = React.ElementRef<typeof NavigationMenu.Trigger>;
type NavListTriggerProps = React.ComponentPropsWithoutRef<
typeof NavigationMenu.Trigger
>;

const NavListTrigger = forwardRef<NavListTriggerElement, NavListTriggerProps>(
(props, ref) => {
return <NavigationMenu.Trigger {...props} ref={ref} />;
}
);
type NavListTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenu.Trigger>;

const NavListTrigger = forwardRef<NavListTriggerElement, NavListTriggerProps>((props, ref) => {
return <NavigationMenu.Trigger {...props} ref={ref} />;
});
NavListTrigger.displayName = "NavListTrigger";

/* --------------------------------- Content -------------------------------- */
type NavListContentElement = React.ElementRef<typeof NavigationMenu.Content>;
type NavListContentProps = React.ComponentPropsWithoutRef<
typeof NavigationMenu.Content
>;

const NavListContent = forwardRef<NavListContentElement, NavListContentProps>(
(props, ref) => {
return <NavigationMenu.Content {...props} ref={ref} />;
}
);
type NavListContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenu.Content>;

const NavListContent = forwardRef<NavListContentElement, NavListContentProps>((props, ref) => {
return <NavigationMenu.Content {...props} ref={ref} />;
});
NavListContent.displayName = "NavListContent";

/* ---------------------------------- Item ---------------------------------- */
Expand All @@ -80,28 +69,20 @@ NavLink.displayName = "NavLink";

/* ----------------------------------- Sub ---------------------------------- */
type NavItemSubElement = React.ElementRef<typeof NavigationMenu.Sub>;
type NavItemSubProps = React.ComponentPropsWithoutRef<
typeof NavigationMenu.Sub
>;

const NavItemSub = forwardRef<NavItemSubElement, NavItemSubProps>(
(props, ref) => {
return <NavigationMenu.Sub {...props} ref={ref} />;
}
);
type NavItemSubProps = React.ComponentPropsWithoutRef<typeof NavigationMenu.Sub>;

const NavItemSub = forwardRef<NavItemSubElement, NavItemSubProps>((props, ref) => {
return <NavigationMenu.Sub {...props} ref={ref} />;
});
NavItemSub.displayName = "NavItemSub";

/* -------------------------------- Viewport -------------------------------- */
type NavViewportElement = React.ElementRef<typeof NavigationMenu.Viewport>;
type NavViewportProps = React.ComponentPropsWithoutRef<
typeof NavigationMenu.Viewport
>;

const NavViewport = forwardRef<NavViewportElement, NavViewportProps>(
(props, ref) => {
return <NavigationMenu.Viewport {...props} ref={ref} />;
}
);
type NavViewportProps = React.ComponentPropsWithoutRef<typeof NavigationMenu.Viewport>;

const NavViewport = forwardRef<NavViewportElement, NavViewportProps>((props, ref) => {
return <NavigationMenu.Viewport {...props} ref={ref} />;
});
NavViewport.displayName = "NavViewport";

/* ---------------------------------- Export --------------------------------- */
Expand Down
10 changes: 3 additions & 7 deletions apps/docs/src/components/header/navigation/secondary-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ export function SecondaryNav() {
const isActive = item.slug === "guides";

return (
<Navigation.Item
key={`${item.slug}-${index}`}
className="inline-flex grow"
>
<Navigation.Item key={`${item.slug}-${index}`} className="inline-flex grow">
<Navigation.Link
className={cn(
focusClasses,
"group z-[51] -mb-px inline-flex shrink-0 grow items-center justify-center px-4 !outline-none outline-white transition-all duration-100 focus-visible:text-white",
isActive && "text-white shadow-[inset_0_-2px_0px_#FFC233]",
!isActive &&
"hover:text-white data-[state=open]:text-white data-[state=open]:shadow-[inset_0_-2px_0px_#FFC233]",
item.children &&
"pr-2 hover:shadow-[inset_0_-2px_0px_#FFC233]"
item.children && "pr-2 hover:shadow-[inset_0_-2px_0px_#FFC233]"
)}
href={item.href}
>
Expand All @@ -36,7 +32,7 @@ export function SecondaryNav() {
);
})}

<Navigation.Viewport className="absolute left-0 top-full z-50 w-full border-t border-white/20 bg-primary opacity-0 shadow-2xl transition-all duration-200 animate-in data-[state=open]:opacity-100 data-[state=closed]:fade-out-100 data-[state=open]:fade-in-0" />
<Navigation.Viewport className="animate-in data-[state=closed]:fade-out-100 data-[state=open]:fade-in-0 absolute left-0 top-full z-50 w-full border-t border-white/20 bg-primary opacity-0 shadow-2xl transition-all duration-200 data-[state=open]:opacity-100" />
</Navigation.List>
</Navigation>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function WebflowResourceItem({
className={cn(
focusClasses,
size === "lg" &&
"p-4 outline-white transition-colors duration-180 hover:bg-white focus-visible:bg-white",
"duration-180 p-4 outline-white transition-colors hover:bg-white focus-visible:bg-white",
"group flex select-none flex-col rounded-lg leading-6"
)}
>
Expand All @@ -47,7 +47,7 @@ export function WebflowResourceItem({
className={cn(
"flex items-center",
size === "lg" &&
"text-base text-white transition-colors duration-180 group-hover:text-gray-900 group-focus-visible:text-gray-900",
"duration-180 text-base text-white transition-colors group-hover:text-gray-900 group-focus-visible:text-gray-900",
size === "sm" && "text-surface-500"
)}
>
Expand Down

0 comments on commit 10d5674

Please sign in to comment.