-
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.
Merge branch 'main' into b-2344-add-hackathon-banner-to-menu
- Loading branch information
Showing
8 changed files
with
125 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
import logoIllustration from "@/public/images/logos/logo-illustration.svg"; | ||
import logoWordmark from "@/public/images/logos/logo-wordmark.svg"; | ||
import Image from "next/image"; | ||
|
||
import { cn } from "@/shared/helpers/cn"; | ||
|
||
import { LogoProps } from "./logo.types"; | ||
|
||
export function Logo({ type = "full", classNames }: LogoProps) { | ||
const showIllustration = type === "illustration" || type === "full"; | ||
const showWordmark = type === "word-mark" || type === "full"; | ||
|
||
return ( | ||
<div className={cn("flex flex-row items-center justify-start gap-3", classNames?.base)}> | ||
{showIllustration && ( | ||
<Image src={logoIllustration} alt="logo illustration" className={cn("min-w-10", classNames?.illustration)} /> | ||
)} | ||
{showWordmark && ( | ||
<Image src={logoWordmark} alt="logo word mark" className={cn("h-auto min-w-[100px]", classNames?.wordmark)} /> | ||
)} | ||
</div> | ||
); | ||
} |
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,10 @@ | ||
interface classNames { | ||
base: string; | ||
illustration: string; | ||
wordmark: string; | ||
} | ||
|
||
export interface LogoProps { | ||
type?: "illustration" | "word-mark" | "full"; | ||
classNames?: Partial<classNames>; | ||
} |
47 changes: 47 additions & 0 deletions
47
shared/features/navigation/primary-navigation-desktop/header-menu/header-menu.tsx
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,47 @@ | ||
import { Button } from "@/design-system/atoms/button/variants/button-default"; | ||
|
||
import { Logo } from "@/shared/components/logo/logo"; | ||
import { cn } from "@/shared/helpers/cn"; | ||
|
||
import { HeaderMenuProps } from "./header-menu.types"; | ||
|
||
export function HeaderMenu({ isFolded, onFoldChange }: HeaderMenuProps) { | ||
function onUnFold() { | ||
onFoldChange(false); | ||
} | ||
|
||
function onFold() { | ||
onFoldChange(true); | ||
} | ||
|
||
return ( | ||
<div className={"relative flex w-full items-center justify-between gap-1 overflow-hidden"}> | ||
<div className={"group/header w-fit"}> | ||
<Logo | ||
classNames={{ | ||
base: cn({ "group-hover/header:!opacity-0 transition-all": isFolded }), | ||
}} | ||
/> | ||
{isFolded && ( | ||
<Button | ||
variant={"secondary-light"} | ||
startIcon={{ name: "ri-sidebar-unfold-line" }} | ||
hideText={true} | ||
size={"l"} | ||
onClick={onUnFold} | ||
classNames={{ | ||
base: "absolute top-0 left-0 transition-all opacity-0 group-hover/header:opacity-100 !border-container-stroke-separator", | ||
}} | ||
/> | ||
)} | ||
</div> | ||
<Button | ||
variant={"secondary-light"} | ||
startIcon={{ name: "ri-sidebar-fold-line" }} | ||
hideText={true} | ||
size={"l"} | ||
onClick={onFold} | ||
/> | ||
</div> | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
shared/features/navigation/primary-navigation-desktop/header-menu/header-menu.types.ts
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,4 @@ | ||
export interface HeaderMenuProps { | ||
isFolded?: boolean; | ||
onFoldChange: (isFolded: boolean) => void; | ||
} |
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