Files
LingvAI/components/Layout.tsx

49 lines
1.1 KiB
TypeScript
Raw Normal View History

import { FC, PropsWithChildren } from "react";
import { Flex, VStack, Button, Link, useColorModeValue } from "@chakra-ui/react";
import { Header, Footer } from ".";
2021-03-18 14:18:29 +01:00
type Props = {
[key: string]: any
};
const Layout: FC<PropsWithChildren<Props>> = ({ children, ...props }) => (
2021-03-18 14:18:29 +01:00
<>
<Button
as={Link}
href="#main"
userSelect="none"
position="absolute"
top="-100px"
left="0"
_focus={{
top: "0"
}}
>
Skip to content
</Button>
<VStack minH="100%" spacing={7}>
<Header
bgColor={useColorModeValue("lingva.100", "lingva.900")}
/>
2021-03-18 14:18:29 +01:00
<Flex
as="main"
id="main"
flexGrow={1}
w="full"
{...props}
2021-03-18 14:18:29 +01:00
>
{children}
</Flex>
<Footer
bgColor={useColorModeValue("lingva.100", "lingva.900")}
color={useColorModeValue("lingva.900", "lingva.100")}
/>
2021-03-18 14:18:29 +01:00
</VStack>
</>
);
export default Layout;