calcom/pages/index.tsx
Omar López d194878bb2
Suggestion: let prettier sort imports order (#673)
* Suggestion: let prettier sort imports order

# Conflicts:
#	yarn.lock

* AUTO SORT ALL THE IMPORTS

* Linting

* Fixes test
2021-09-22 13:52:38 -06:00

22 lines
438 B
TypeScript

import { useRouter } from "next/router";
import Loader from "@components/Loader";
function RedirectPage() {
const router = useRouter();
if (typeof window !== "undefined") {
router.push("/event-types");
return;
}
return <Loader />;
}
RedirectPage.getInitialProps = (ctx) => {
if (ctx.res) {
ctx.res.writeHead(302, { Location: "/event-types" });
ctx.res.end();
}
return {};
};
export default RedirectPage;