Added checks for CLOUD_MODE.

This commit is contained in:
Mike Cao 2023-02-27 20:03:04 -08:00
parent 5657a64c77
commit 3ac560dc0f
24 changed files with 175 additions and 60 deletions

View file

@ -2,11 +2,11 @@ import { useRouter } from 'next/router';
import WebsiteSettings from 'components/pages/settings/websites/WebsiteSettings';
import AppLayout from 'components/layout/AppLayout';
export default function WebsiteSettingsPage() {
export default function WebsiteSettingsPage({ disabled }) {
const router = useRouter();
const { id } = router.query;
if (!id) {
if (!id || disabled) {
return null;
}
@ -16,3 +16,11 @@ export default function WebsiteSettingsPage() {
</AppLayout>
);
}
export async function getServerSideProps() {
return {
props: {
disabled: !!process.env.CLOUD_MODE,
},
};
}

View file

@ -1,10 +1,22 @@
import AppLayout from 'components/layout/AppLayout';
import WebsitesList from 'components/pages/settings/websites/WebsitesList';
export default function WebsitesPage() {
export default function WebsitesPage({ disabled }) {
if (disabled) {
return null;
}
return (
<AppLayout>
<WebsitesList />
</AppLayout>
);
}
export async function getServerSideProps() {
return {
props: {
disabled: !!process.env.CLOUD_MODE,
},
};
}