2020-09-19 22:10:52 -07:00
|
|
|
|
import React from "react";
|
|
|
|
|
import {
|
|
|
|
|
Box,
|
|
|
|
|
IconButton,
|
|
|
|
|
HStack,
|
2020-09-20 20:10:26 -07:00
|
|
|
|
Link as ChakraLink,
|
2020-09-19 22:10:52 -07:00
|
|
|
|
Tooltip,
|
|
|
|
|
useColorMode,
|
2021-03-13 03:14:35 -08:00
|
|
|
|
Grid,
|
2020-12-25 09:08:33 -08:00
|
|
|
|
} from "@chakra-ui/react";
|
2020-09-19 22:10:52 -07:00
|
|
|
|
import { EmailIcon, MoonIcon, SunIcon } from "@chakra-ui/icons";
|
2021-03-13 03:14:35 -08:00
|
|
|
|
import { SiGithub, SiTwitter } from "react-icons/si";
|
2022-09-14 19:15:48 -07:00
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
|
import Link from "next/link";
|
2020-09-19 22:10:52 -07:00
|
|
|
|
|
|
|
|
|
function GlobalFooter() {
|
2020-09-20 20:10:26 -07:00
|
|
|
|
const classicDTIUrl = useClassicDTIUrl();
|
|
|
|
|
|
2020-09-19 22:10:52 -07:00
|
|
|
|
return (
|
2020-09-20 20:10:26 -07:00
|
|
|
|
<Box as="footer" display="flex" alignItems="flex-start">
|
|
|
|
|
<Box
|
|
|
|
|
// This empty box grows at the same rate as the box on the right, so
|
|
|
|
|
// the middle box will be centered, if there's space!
|
|
|
|
|
flex="1 0 0"
|
|
|
|
|
/>
|
|
|
|
|
<Box textAlign="center" fontSize="xs">
|
|
|
|
|
<HStack spacing="4" justifyContent="center">
|
2022-09-25 06:00:59 -07:00
|
|
|
|
<Link href="/terms" passHref>
|
|
|
|
|
<ChakraLink>Terms of Use (Sep 2022)</ChakraLink>
|
|
|
|
|
</Link>
|
2022-09-14 19:15:48 -07:00
|
|
|
|
<Link href="/privacy" passHref>
|
2022-09-25 06:00:59 -07:00
|
|
|
|
<ChakraLink>Privacy Policy (Sep 2022)</ChakraLink>
|
2022-09-14 19:15:48 -07:00
|
|
|
|
</Link>
|
2022-09-25 08:05:38 -07:00
|
|
|
|
<Link href="/donate" passHref>
|
|
|
|
|
<ChakraLink>Donors</ChakraLink>
|
|
|
|
|
</Link>
|
2020-09-20 20:10:26 -07:00
|
|
|
|
<ChakraLink href={classicDTIUrl}>Classic DTI</ChakraLink>
|
|
|
|
|
</HStack>
|
|
|
|
|
<Box as="p" opacity="0.75">
|
|
|
|
|
Images © 2000–{new Date().getFullYear()} Neopets, Inc. All Rights
|
|
|
|
|
Reserved. Used With Permission.
|
|
|
|
|
</Box>
|
2020-09-19 22:10:52 -07:00
|
|
|
|
</Box>
|
2021-03-13 03:14:35 -08:00
|
|
|
|
<Grid
|
2020-09-20 20:10:26 -07:00
|
|
|
|
flex="1 0 0"
|
2021-03-13 03:14:35 -08:00
|
|
|
|
templateColumns={{
|
|
|
|
|
base: "repeat(2, min-content)",
|
|
|
|
|
sm: "repeat(4, min-content)",
|
|
|
|
|
}}
|
|
|
|
|
gap="2"
|
|
|
|
|
justifyContent="end"
|
2020-09-19 22:10:52 -07:00
|
|
|
|
marginLeft="3"
|
|
|
|
|
opacity="0.75"
|
|
|
|
|
transition="opacity 0.2s"
|
|
|
|
|
_hover={{ opacity: "1" }}
|
|
|
|
|
_focusWithin={{ opacity: "1" }}
|
2020-09-20 20:10:26 -07:00
|
|
|
|
// This will center our content against the top two lines of text to
|
|
|
|
|
// our left, which ends up feeling like the right visual balance, even
|
|
|
|
|
// when the text wraps to 3 lines on mobile.
|
|
|
|
|
// 2 lines at 1.5 line height = 3em.
|
|
|
|
|
fontSize="xs"
|
|
|
|
|
minHeight="3em"
|
2020-09-19 22:10:52 -07:00
|
|
|
|
>
|
|
|
|
|
<Tooltip label="Email">
|
|
|
|
|
<IconButton
|
|
|
|
|
as="a"
|
|
|
|
|
href="mailto:matchu@openneo.net"
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
aria-label="Email"
|
|
|
|
|
icon={<EmailIcon />}
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
2021-03-13 03:14:35 -08:00
|
|
|
|
<Tooltip label="Twitter">
|
|
|
|
|
<IconButton
|
|
|
|
|
as="a"
|
|
|
|
|
href="https://twitter.com/NeopetsDTI"
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
aria-label="Twitter"
|
|
|
|
|
icon={<SiTwitter />}
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
2020-09-19 22:10:52 -07:00
|
|
|
|
<Tooltip label="GitHub">
|
|
|
|
|
<IconButton
|
|
|
|
|
as="a"
|
|
|
|
|
href="https://github.com/matchu/impress-2020"
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
aria-label="GitHub"
|
|
|
|
|
icon={<SiGithub />}
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
<ColorModeButton />
|
2021-03-13 03:14:35 -08:00
|
|
|
|
</Grid>
|
2020-09-19 22:10:52 -07:00
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ColorModeButton() {
|
|
|
|
|
const { colorMode, toggleColorMode } = useColorMode();
|
|
|
|
|
const label = colorMode === "light" ? "Dark mode" : "Light mode";
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Tooltip label={label}>
|
|
|
|
|
<IconButton
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
aria-label={label}
|
|
|
|
|
icon={colorMode === "light" ? <MoonIcon /> : <SunIcon />}
|
|
|
|
|
onClick={toggleColorMode}
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-20 20:10:26 -07:00
|
|
|
|
function useClassicDTIUrl() {
|
2022-09-14 19:15:48 -07:00
|
|
|
|
const { pathname, query } = useRouter();
|
2020-09-20 20:10:26 -07:00
|
|
|
|
|
2022-09-14 22:16:39 -07:00
|
|
|
|
if (pathname === "/items/[itemId]") {
|
2022-09-14 19:15:48 -07:00
|
|
|
|
return `https://impress.openneo.net/items/${query.itemId}`;
|
2020-09-20 20:10:26 -07:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-14 22:16:39 -07:00
|
|
|
|
if (pathname === "/user/[userId]/lists") {
|
2022-09-14 19:15:48 -07:00
|
|
|
|
return `https://impress.openneo.net/user/${query.userId}/closet`;
|
2020-09-20 20:10:26 -07:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-14 19:15:48 -07:00
|
|
|
|
if (pathname === "/modeling") {
|
2020-09-20 20:10:26 -07:00
|
|
|
|
return "https://impress.openneo.net/modeling";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "https://impress.openneo.net/";
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-19 22:10:52 -07:00
|
|
|
|
export default GlobalFooter;
|