From 599d97af21dea55105d899898a41404f9a7e54e9 Mon Sep 17 00:00:00 2001 From: jakubmanczak Date: Sun, 11 Dec 2022 19:26:05 +0100 Subject: [PATCH] add icon to mobile navmenu & icon component init --- components/Icon.tsx | 61 ++++++++++++++++++++++++++++ components/Navigation/Navigation.tsx | 6 +-- 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 components/Icon.tsx diff --git a/components/Icon.tsx b/components/Icon.tsx new file mode 100644 index 0000000..0433463 --- /dev/null +++ b/components/Icon.tsx @@ -0,0 +1,61 @@ +enum IconSet { + Menu, + Twitter, +} + +type iconprops = { + icon: IconSet; + width?: number; + height?: number; +} & React.SVGProps; + +const Icon = ({ icon, width, height, ...props }: iconprops) => { + switch (icon) { + // guide for adding these: + // - add {width || ogWidth} + // - add {height || ogHeight} + // - add {...props} + case IconSet.Menu: + return ( + + + + + + ); + break; + case IconSet.Twitter: + return ( + + + + ); + break; + } +}; + +export { Icon, IconSet }; diff --git a/components/Navigation/Navigation.tsx b/components/Navigation/Navigation.tsx index 5e814c2..6d27b52 100644 --- a/components/Navigation/Navigation.tsx +++ b/components/Navigation/Navigation.tsx @@ -1,8 +1,9 @@ import styles from "./Navigation.module.scss"; import { GractwoLogo } from "../Logo"; -import Link from "next/link"; +import { Icon, IconSet } from "../Icon"; import navigation from "../../data/navigation.json"; +import Link from "next/link"; const Navigation = () => { let username: string = ""; @@ -25,8 +26,7 @@ const Navigation = () => { ); })}
- - nawigacja + {/* TUTAJ WSTAWIĆ IKONKĘ PÓŹNIEJ */}
{navigation.map((navlink) => {