Refactor env check.

This commit is contained in:
Mike Cao 2022-10-27 16:42:57 -07:00
parent ba63991a92
commit fc9584eb44
14 changed files with 30 additions and 76 deletions

View file

@ -4,12 +4,12 @@ import Layout from 'components/layout/Layout';
import WebsiteDetails from 'components/pages/WebsiteDetails';
import useRequireLogin from 'hooks/useRequireLogin';
export default function DetailsPage({ pageDisabled }) {
export default function DetailsPage() {
const { loading } = useRequireLogin();
const router = useRouter();
const { id } = router.query;
if (pageDisabled || !id || loading) {
if (!id || loading) {
return null;
}
@ -21,11 +21,3 @@ export default function DetailsPage({ pageDisabled }) {
</Layout>
);
}
export async function getServerSideProps() {
return {
props: {
pageDisabled: !!process.env.DISABLE_UI,
},
};
}