-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,49 @@ | ||
"use client"; | ||
|
||
import { Logo } from "@repo/design-system/svg"; | ||
import { useQuestionsStore } from "./providers/storeProvider"; | ||
import { Button } from "@repo/design-system/ui"; | ||
import { CloseIcon } from "@repo/design-system/icons"; | ||
import { usePathname } from "next/navigation"; | ||
|
||
export default function Header() { | ||
const isRekapitulace = useQuestionsStore((state) => state.isRekapitulace); | ||
const currentLocation = useQuestionsStore((state) => state.currentLocation); | ||
const guide = useQuestionsStore((state) => state.guide); | ||
const path = usePathname(); | ||
|
||
return ( | ||
// sticky implementation? | ||
<header className="flex h-14 w-screen items-center justify-center bg-primary"> | ||
Volební kalkulačka {isRekapitulace ? "Rekap true" : "Rekap false"} | ||
Location: {currentLocation} | ||
<header className="h-1/6 max-w-[100vw]"> | ||
<div className="flex w-full items-center justify-between gap-2 p-4 sm:p-8"> | ||
{/* logo wrapper */} | ||
<div className="flex gap-2"> | ||
<Logo className="h-5 w-[5.953rem]" /> | ||
<div className="hidden text-sm font-bold uppercase sm:block"> | ||
Volební kalkulačka | ||
</div> | ||
</div> | ||
{/* title component, refactor */} | ||
{guide[0]?.title && guide[0]?.region ? ( | ||
<div className="mr-auto"> | ||
<p className="font-primary text-sm text-neutral"> | ||
{guide[0]?.title} — {guide[0]?.region} | ||
</p> | ||
</div> | ||
) : null} | ||
{/* refactor visiblity condition later */} | ||
{path != "/" && ( | ||
<Button | ||
fitContent | ||
kind="link" | ||
size="auto" | ||
icon={CloseIcon} | ||
hasIcon | ||
iconPosition="right" | ||
// refactor | ||
onClick={() => alert("Back to home")} | ||
> | ||
Zpět na hlavní stránku | ||
</Button> | ||
)} | ||
</div> | ||
</header> | ||
); | ||
} |
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
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,18 @@ | ||
export function CloseIcon( | ||
props: React.JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>, | ||
) { | ||
return ( | ||
<svg | ||
viewBox="0 0 24 24" | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
{props.children} | ||
<path | ||
d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z" | ||
fill="currentColor" | ||
></path> | ||
</svg> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./blueBlob"; | ||
export * from "./redBlob"; | ||
export * from "./logo"; |
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,38 @@ | ||
export function Logo( | ||
props: React.JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>, | ||
) { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 300 65" | ||
fill="none" | ||
role="img" | ||
{...props} | ||
> | ||
<path | ||
d="M65.9601 0.28401L77.9054 12.248L37.9138 52.3008L25.9684 64.2647L0 38.2562L11.9454 26.2923L25.9684 40.337L65.9601 0.28401Z" | ||
fill="var(--primary-50)" | ||
/> | ||
<path | ||
d="M126.768 0.283997L74.8308 52.3007L86.7762 64.2647L138.713 12.248L126.768 0.283997Z" | ||
fill="var(--neutral-10)" | ||
/> | ||
<path | ||
d="M207.144 0.000134698L219.089 11.9641L199.093 31.9906L219.089 52.0171L207.143 63.981L187.148 43.9544L167.152 63.9809L155.207 52.0169L175.202 31.9905L155.207 11.9639L167.152 1.38557e-05L187.148 20.0267L207.144 0.000134698Z" | ||
fill="var(--secondary-50)" | ||
/> | ||
<path | ||
d="M255.196 9.84723C255.196 15.1288 250.921 19.4104 245.647 19.4104C240.374 19.4104 236.099 15.1288 236.099 9.84723C236.099 4.56561 240.374 0.28401 245.647 0.28401C250.921 0.28401 255.196 4.56561 255.196 9.84723Z" | ||
fill="var(--primary-50)" | ||
/> | ||
<path | ||
d="M288.036 0.28401L236.099 52.3007L248.044 64.2647L299.981 12.248L288.036 0.28401Z" | ||
fill="var(--neutral-10)" | ||
/> | ||
<path | ||
d="M300 54.4368C300 59.7184 295.725 64 290.452 64C285.178 64 280.903 59.7184 280.903 54.4368C280.903 49.1552 285.178 44.8736 290.452 44.8736C295.725 44.8736 300 49.1552 300 54.4368Z" | ||
fill="var(--secondary-50)" | ||
/> | ||
</svg> | ||
); | ||
} |