Tutorial #62
77
src/components/buttons/index.tsx
Normal file
77
src/components/buttons/index.tsx
Normal 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;
|
||||||
@@ -98,13 +98,17 @@ const Day = ({
|
|||||||
border="1px solid #181d8f"
|
border="1px solid #181d8f"
|
||||||
_hover={{
|
_hover={{
|
||||||
cursor: isBefore(currDateObj, endOfDay(currDate))
|
cursor: isBefore(currDateObj, endOfDay(currDate))
|
||||||
|
? selectedSticker !== null
|
||||||
? "pointer"
|
? "pointer"
|
||||||
|
: "default"
|
||||||
: "default",
|
: "default",
|
||||||
background: "gray.700",
|
background: "gray.700",
|
||||||
border: "1px solid #FFF",
|
border: "1px solid #FFF",
|
||||||
color: "whiteAlpha.900"
|
color: "whiteAlpha.900"
|
||||||
}}
|
}}
|
||||||
onClick={() => handleNav(overflowDirection)}
|
onClick={() =>
|
||||||
|
selectedSticker !== null ? handleNav(overflowDirection) : ""
|
||||||
|
}
|
||||||
spacing="0.5rem"
|
spacing="0.5rem"
|
||||||
alignContent="center"
|
alignContent="center"
|
||||||
justifyContent="flex-start"
|
justifyContent="flex-start"
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Divider, Heading, HStack, VStack } from "@chakra-ui/react";
|
import { Divider, Heading, VStack } from "@chakra-ui/react";
|
||||||
import CustomButton from "../../buttons/Custom";
|
import Buttons from "../../buttons";
|
||||||
import Patreon from "../../buttons/Patreon";
|
|
||||||
import Twitter from "../../buttons/Twitter";
|
|
||||||
import links, { LinkObj } from "../data/links";
|
|
||||||
|
|
||||||
const TutorialLinks = (): JSX.Element => {
|
const TutorialLinks = (): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
@@ -17,68 +14,7 @@ const TutorialLinks = (): JSX.Element => {
|
|||||||
<Heading as="h3" size="lg">
|
<Heading as="h3" size="lg">
|
||||||
{"More Info"}
|
{"More Info"}
|
||||||
</Heading>
|
</Heading>
|
||||||
<HStack
|
<Buttons />
|
||||||
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>
|
|
||||||
<Divider orientation="horizontal" />
|
<Divider orientation="horizontal" />
|
||||||
</VStack>
|
</VStack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { motion } from "framer-motion";
|
|||||||
import Patreon from "../../components/buttons/Patreon";
|
import Patreon from "../../components/buttons/Patreon";
|
||||||
import CustomButton from "../../components/buttons/Custom";
|
import CustomButton from "../../components/buttons/Custom";
|
||||||
import Twitter from "../../components/buttons/Twitter";
|
import Twitter from "../../components/buttons/Twitter";
|
||||||
|
import Buttons from "../../components/buttons";
|
||||||
|
|
||||||
const MotionBox = motion<BoxProps>(Box);
|
const MotionBox = motion<BoxProps>(Box);
|
||||||
|
|
||||||
@@ -69,15 +70,7 @@ const Footer = (): JSX.Element => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</MotionBox> */}
|
</MotionBox> */}
|
||||||
<CustomButton
|
<Buttons />
|
||||||
link={
|
|
||||||
"https://lucidcreations.media/introducing-code-name-potty-chart/"
|
|
||||||
}
|
|
||||||
text="More About This App"
|
|
||||||
type="footer"
|
|
||||||
/>
|
|
||||||
<Patreon />
|
|
||||||
<Twitter />
|
|
||||||
<Text color="brand.footerText" fontSize="xs">
|
<Text color="brand.footerText" fontSize="xs">
|
||||||
©
|
©
|
||||||
{` 2021 - ${new Date().getFullYear()} `}
|
{` 2021 - ${new Date().getFullYear()} `}
|
||||||
|
|||||||
Reference in New Issue
Block a user