import { Button, Container, createStyles, Group, List, Text, ThemeIcon, Title, } from "@mantine/core"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; import { TbCheck } from "react-icons/tb"; import { FormattedMessage } from "react-intl"; import Logo from "../components/Logo"; import Meta from "../components/Meta"; import useUser from "../hooks/user.hook"; const webroot = process.env.WEBROOT || ""; const useStyles = createStyles((theme) => ({ inner: { display: "flex", justifyContent: "space-between", paddingTop: `calc(${theme.spacing.md} * 4)`, paddingBottom: `calc(${theme.spacing.md} * 4)`, }, content: { maxWidth: 480, marginRight: `calc(${theme.spacing.md} * 3)`, [theme.fn.smallerThan("md")]: { maxWidth: "100%", marginRight: 0, }, }, title: { color: theme.colorScheme === "dark" ? theme.white : theme.black, fontSize: 44, lineHeight: 1.2, fontWeight: 900, [theme.fn.smallerThan("xs")]: { fontSize: 28, }, }, control: { [theme.fn.smallerThan("xs")]: { flex: 1, }, }, image: { [theme.fn.smallerThan("md")]: { display: "none", }, }, highlight: { position: "relative", backgroundColor: theme.colorScheme === "dark" ? theme.fn.rgba(theme.colors[theme.primaryColor][6], 0.55) : theme.colors[theme.primaryColor][0], borderRadius: theme.radius.sm, padding: "4px 12px", }, })); export default function Home() { const { classes } = useStyles(); const { refreshUser } = useUser(); const router = useRouter(); // If the user is already logged in, redirect to the upload page useEffect(() => { refreshUser().then((user) => { if (user) { router.replace(webroot + "/upload"); } }); }, []); return ( <>
<FormattedMessage id="home.title" values={{ h: (chunks) => ( <span className={classes.highlight}>{chunks} </span> ), }} /> } >
{" "} -
{" "} -
{" "} -
); }