Files
LingvAI/components/Header.tsx

51 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-03-16 01:33:19 +01:00
import { FC } from "react";
import NextLink from "next/link";
2021-03-16 23:58:12 +01:00
import { Flex, HStack, IconButton, Link, useColorModeValue } from "@chakra-ui/react";
2021-03-16 01:33:19 +01:00
import { FaGithub } from "react-icons/fa";
import Image from "next/image";
import ColorModeToggler from "./ColorModeToggler";
type Props = {
[key: string]: any
};
const Header: FC<Props> = (props) => (
<Flex
2021-03-17 21:30:47 +01:00
as="header"
2021-03-16 01:33:19 +01:00
px={1}
py={3}
justify="space-around"
align="center"
bgColor={useColorModeValue("lingva.100", "lingva.900")}
w="full"
{...props}
>
<NextLink href="/" passHref={true}>
<Link display="flex">
<Image
src={useColorModeValue("/banner_light.svg", "/banner_dark.svg")}
alt="Logo"
width={110}
height={64}
/>
</Link>
</NextLink>
<HStack spacing={3}>
<ColorModeToggler
variant={useColorModeValue("outline", "solid")}
/>
2021-03-16 01:33:19 +01:00
<IconButton
as={Link}
href="https://github.com/TheDavidDelta/lingva-translate"
isExternal={true}
aria-label="GitHub"
icon={<FaGithub />}
colorScheme="lingva"
variant={useColorModeValue("outline", "solid")}
2021-03-16 01:33:19 +01:00
/>
</HStack>
</Flex>
);
export default Header;