trying a different redirect for home to event-types
This commit is contained in:
parent
9051a0d60e
commit
71fc0ba437
1 changed files with 17 additions and 14 deletions
|
@ -1,16 +1,19 @@
|
||||||
export default function Home() {
|
import { useRouter } from "next/router";
|
||||||
return (
|
|
||||||
<div className="loader">
|
function RedirectPage() {
|
||||||
<span className="loader-inner"></span>
|
const router = useRouter();
|
||||||
</div>
|
if (typeof window !== "undefined") {
|
||||||
);
|
router.push("/event-types");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getStaticProps() {
|
RedirectPage.getInitialProps = (ctx) => {
|
||||||
return {
|
if (ctx.res) {
|
||||||
redirect: {
|
ctx.res.writeHead(302, { Location: "/event-types" });
|
||||||
destination: "/event-types",
|
ctx.res.end();
|
||||||
permanent: false,
|
}
|
||||||
},
|
return {};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
export default RedirectPage;
|
||||||
|
|
Loading…
Reference in a new issue