Moved buttons to it's own component and added the new compoenent to the footer.

This commit is contained in:
Lucid Kobold
2022-06-24 10:45:19 -05:00
parent 6a0863faf3
commit 362b4babe2
5 changed files with 88 additions and 78 deletions

View File

@@ -0,0 +1,77 @@
import React from "react";
import { Box, HStack, VStack } from "@chakra-ui/react";
import CustomButton from "./Custom";
import links, { LinkObj } from "./data/links";
import Patreon from "./Patreon";
import Twitter from "./Twitter";
const Buttons = (): JSX.Element => {
return (
<Box h="auto" w="100%">
<HStack
display={{ base: "none", lg: "flex" }}
h="auto"
w="100%"
justifyContent="center"
alignContent="center"
spacing={4}
>
{links.map((link: LinkObj) => {
const { href, name, type } = link;
if (type === "primary" || type === "secondary") {
return (
<CustomButton
key={name.replaceAll(" ", "-")}
link={href}
text={name}
type={type}
/>
);
}
if (type === "patreon") {
return <Patreon key={type} />;
}
if (type === "twitter") {
return <Twitter key={type} />;
}
})}
</HStack>
<VStack
display={{ base: "flex", lg: "none" }}
h="auto"
w="100%"
justifyContent="center"
alignContent="center"
spacing={4}
>
{links.map((link: LinkObj) => {
const { href, name, type } = link;
if (type === "primary" || type === "secondary") {
return (
<CustomButton
key={name.replaceAll(" ", "-")}
link={href}
text={name}
type={type}
/>
);
}
if (type === "patreon") {
return <Patreon key={type} />;
}
if (type === "twitter") {
return <Twitter key={type} />;
}
})}
</VStack>
</Box>
);
};
export default Buttons;