⚒️ Design improvements.

This commit is contained in:
pheralb 2022-07-06 19:52:52 +01:00
parent 4c9b92ba5a
commit 3817e19f53
5 changed files with 30 additions and 12 deletions

View File

@ -9,6 +9,8 @@ const CustomIconBtn = (props: CustomIconBtnProps) => {
aria-label={props.title} aria-label={props.title}
icon={props.icon} icon={props.icon}
onClick={props.onClick} onClick={props.onClick}
mr={props.mr}
ml={props.ml}
/> />
); );
}; };

View File

@ -3,13 +3,16 @@ import { Link } from "@chakra-ui/react";
import NextLink from "next/link"; import NextLink from "next/link";
import { CustomLinkProps } from "@/interfaces/components"; import { CustomLinkProps } from "@/interfaces/components";
const CustomLink = ({ href, children, external }: CustomLinkProps) => { const CustomLink = ({ href, children, external, font, mr, ml }: CustomLinkProps) => {
return ( return (
<NextLink href={href} passHref> <NextLink href={href} passHref>
<Link <Link
isExternal={external} isExternal={external}
_hover={{ textDecoration: "none" }} _hover={{ textDecoration: "none" }}
_focus={{ border: "none" }} _focus={{ border: "none" }}
fontFamily={font}
mr={mr}
ml={ml}
> >
{children} {children}
</Link> </Link>

View File

@ -6,11 +6,16 @@ export interface CustomLinkProps {
href: string; href: string;
children: React.ReactNode; children: React.ReactNode;
external?: boolean; external?: boolean;
font?: string;
mr?: string;
ml?: string;
} }
export interface CustomIconBtnProps { export interface CustomIconBtnProps {
title: string; title: string;
icon: React.ReactElement; icon: React.ReactElement;
mr?: string;
ml?: string;
onClick?: () => void; onClick?: () => void;
} }

View File

@ -10,6 +10,7 @@ import {
Icon, Icon,
useDisclosure, useDisclosure,
Collapse, Collapse,
Text,
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import { ArrowSquareOut, MagnifyingGlass, Sticker, X } from "phosphor-react"; import { ArrowSquareOut, MagnifyingGlass, Sticker, X } from "phosphor-react";
import Theme from "./theme"; import Theme from "./theme";
@ -52,26 +53,31 @@ const Header = () => {
</HStack> </HStack>
</Tap> </Tap>
</CustomLink> </CustomLink>
<HStack display="flex" alignItems="center" spacing={1}> <HStack display="flex" alignItems="center" spacing={2}>
<HStack <Box display={{ base: "none", md: "inline-flex" }}>
spacing={1}
mr={1}
display={{ base: "none", md: "inline-flex" }}
>
{Links.map((link) => ( {Links.map((link) => (
<CustomLink <CustomLink
key={link.title} key={link.title}
href={link.slug} href={link.slug}
external={link.external} external={link.external}
font="Inter-Semibold"
mr="4"
ml="3"
> >
<Button variant="ghost" fontFamily="Inter-Semibold"> <Tap>
{link.title} {link.title}
{link.external ? ( {link.external ? (
<Icon as={ArrowSquareOut} ml="2" /> <Icon as={ArrowSquareOut} ml="2" />
) : null} ) : null}
</Button> </Tap>
</CustomLink> </CustomLink>
))} ))}
</Box>
<HStack
spacing={1}
mr={1}
display={{ base: "none", md: "inline-flex" }}
>
<CustomIconBtn <CustomIconBtn
title="Toggle Search bar" title="Toggle Search bar"
icon={ icon={

View File

@ -9,20 +9,22 @@ import {
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import { List } from "phosphor-react"; import { List } from "phosphor-react";
import { Links } from "./links"; import { Links } from "./links";
import Theme from "./theme";
const Mobile = () => { const Mobile = () => {
const bg = useColorModeValue("bg.light", "bg.dark"); const bg = useColorModeValue("bg.light", "bg.dark");
const mobileNav = useDisclosure(); const mobileNav = useDisclosure();
return ( return (
<> <>
<Theme />
<IconButton <IconButton
display={{ base: "flex", md: "none" }} display={{ base: "flex", md: "none" }}
aria-label="Open menu navbar" aria-label="Open menu navbar"
variant="ghost" variant="ghost"
icon={<List size={22} />} icon={<List size={22} />}
onClick={mobileNav.onOpen} onClick={mobileNav.onOpen}
ml="2"
/> />
<VStack <VStack
pos="absolute" pos="absolute"
top={0} top={0}
@ -33,7 +35,7 @@ const Mobile = () => {
p={4} p={4}
pb={4} pb={4}
bg={bg} bg={bg}
spacing={3} spacing={5}
rounded="sm" rounded="sm"
shadow="sm" shadow="sm"
borderWidth="1px" borderWidth="1px"
@ -46,7 +48,7 @@ const Mobile = () => {
href={link.slug} href={link.slug}
external={link.external} external={link.external}
> >
<Button variant="ghost">{link.title}</Button> {link.title}
</CustomLink> </CustomLink>
))} ))}
</VStack> </VStack>