link-stack/apps/metamigo-frontend/pages/index.tsx

31 lines
738 B
TypeScript
Raw Normal View History

2023-03-22 08:17:51 +00:00
// @ts-nocheck
2023-02-13 12:41:30 +00:00
import { NextPage } from "next";
2023-05-25 07:03:57 +00:00
import { Typography, Box, Button, Grid, Link } from "@mui/material";
2023-03-15 12:17:43 +00:00
import { FC, useEffect } from "react";
2023-02-13 12:41:30 +00:00
import { useRouter } from "next/router";
2023-03-14 17:40:24 +00:00
export const RedirectToAdmin: FC = ({ children }) => {
2023-02-13 12:41:30 +00:00
const router = useRouter();
useEffect(() => {
router.push("/admin");
});
return <>{children}</>;
};
const Home: NextPage = () => (
<Box>
<Typography variant="h3">Metamigo</Typography>
2023-03-14 17:40:24 +00:00
<Grid container justifyContent="space-around" style={{ padding: 60 }}>
2023-02-13 12:41:30 +00:00
<Grid item>
<Link href="/admin">
<Button variant="contained">Admin</Button>
<RedirectToAdmin />
</Link>
</Grid>
</Grid>
</Box>
);
export default Home;