186 lines
5.4 KiB
JavaScript
Raw Normal View History

2022-01-16 22:27:55 +00:00
import React from "react";
import {
chakra,
Box,
Flex,
VisuallyHidden,
HStack,
Button,
useDisclosure,
VStack,
IconButton,
CloseButton,
Container,
Image,
useColorModeValue,
} from "@chakra-ui/react";
import Dark from "components/header/dark";
import {
IoApps,
IoBookOutline,
IoCloseSharp,
IoLogoGithub,
IoLogoTwitter,
} from "react-icons/io5";
2022-01-16 22:27:55 +00:00
import Link from "next/link";
import Hover from "animations/hover";
import Show from "animations/show";
import { BiLinkExternal } from "react-icons/bi";
2022-01-16 22:27:55 +00:00
const Header = () => {
const mobileNav = useDisclosure();
const bg = useColorModeValue("#fffffe", "#16161a");
const border = useColorModeValue("0", "1px");
const borderRadius = useColorModeValue("10px", "0");
2022-01-16 22:27:55 +00:00
return (
<>
<Box
2022-01-16 22:27:55 +00:00
w="full"
bg={bg}
mt="5"
mb="5"
px={{ base: 3, md: 5 }}
py="3"
pb="3"
borderRadius={borderRadius}
borderBottomWidth={border}
shadow="sm"
2022-01-16 22:27:55 +00:00
pos="sticky"
top="2"
2022-01-16 22:27:55 +00:00
zIndex="1000"
>
<Show>
2022-01-16 22:27:55 +00:00
<Flex alignItems="center" justifyContent="space-between" mx="auto">
2022-01-21 22:30:32 +00:00
<Hover>
<Link href="/" passHref>
2022-01-16 22:27:55 +00:00
<Flex cursor="pointer">
<chakra.a title="iconr" display="flex" alignItems="center">
<Image
2022-01-21 22:30:32 +00:00
src="/images/logo.png"
2022-01-16 22:27:55 +00:00
boxSize="25px"
alt="iconr logo"
/>
<VisuallyHidden>iconr</VisuallyHidden>
</chakra.a>
<chakra.h1
fontSize="2xl"
2022-01-16 22:27:55 +00:00
fontWeight="bold"
fontFamily="Eina-Bold"
ml="3"
>
iconr
</chakra.h1>
</Flex>
2022-01-21 22:30:32 +00:00
</Link>
</Hover>
2022-01-16 22:27:55 +00:00
<HStack display="flex" alignItems="center">
<HStack
spacing={2}
color="brand.500"
display={{ base: "none", md: "inline-flex" }}
>
<Link
href="https://github.com/pheralb/iconr/tree/main/public/library"
passHref
>
<Button
variant="ghost"
rightIcon={<BiLinkExternal />}
fontWeight="light"
>
Library
</Button>
2022-01-16 22:27:55 +00:00
</Link>
2022-01-21 22:30:32 +00:00
<Link href="https://twitter.com/iconrhq" passHref>
<IconButton
aria-label="Twitter profile"
bg="transparent"
border="0"
variant="outline"
icon={<IoLogoTwitter size="25" />}
/>
</Link>
2022-01-16 22:27:55 +00:00
<Link href="https://github.com/pheralb/iconr" passHref>
<IconButton
aria-label="Github Repository"
bg="transparent"
border="0"
variant="outline"
icon={<IoLogoGithub size="25" />}
/>
</Link>
<Dark />
</HStack>
<Box display={{ base: "inline-flex", md: "none" }}>
<IconButton
display={{ base: "flex", md: "none" }}
aria-label="Open menu"
fontSize="20px"
variant="ghost"
icon={<IoApps />}
onClick={mobileNav.onOpen}
/>
<VStack
pos="absolute"
borderWidth="2px"
2022-01-16 22:27:55 +00:00
bg={bg}
top={0}
left={0}
right={0}
display={mobileNav.isOpen ? "flex" : "none"}
flexDirection="column"
pt="4"
2022-01-16 22:27:55 +00:00
pb={4}
spacing={3}
rounded="sm"
shadow="sm"
>
<Button
bg="transparent"
border="0"
variant="outline"
leftIcon={<IoCloseSharp size="25" />}
fontWeight="light"
2022-01-16 22:27:55 +00:00
onClick={mobileNav.onClose}
>
Close
</Button>
2022-01-16 22:27:55 +00:00
<Link
href="https://github.com/pheralb/iconr/tree/main/public/library"
passHref
>
<Button
bg="transparent"
border="0"
variant="outline"
leftIcon={<IoBookOutline size="25" />}
fontWeight="light"
>
Library
</Button>
2022-01-16 22:27:55 +00:00
</Link>
<Link href="https://github.com/pheralb/iconr" passHref>
<Button
2022-01-16 22:27:55 +00:00
bg="transparent"
border="0"
variant="outline"
leftIcon={<IoLogoGithub size="25" />}
fontWeight="light"
>
Github
</Button>
2022-01-16 22:27:55 +00:00
</Link>
<Dark />
</VStack>
</Box>
</HStack>
</Flex>
</Show>
</Box>
2022-01-16 22:27:55 +00:00
</>
);
};
export default Header;