add cloud_mode

This commit is contained in:
Brian Cao committed 2022-10-12 15:35:33 -07:00
1 parent 9147415761
commit db1ae3f2c7
13 files changed
+103 -25

No files matched your search

+8
View File
@@ -1,3 +1,11 @@
import Index from './index';
export default Index;
export async function getServerSideProps() {
return {
props: {
settingsDisabled: !!process.env.CLOUD_MODE,
},
};
}
+13 -3
View File
@@ -3,16 +3,26 @@ import Layout from 'components/layout/Layout';
import Settings from 'components/pages/Settings';
import useRequireLogin from 'hooks/useRequireLogin';
export default function SettingsPage() {
export default function SettingsPage({ settingsDisabled }) {
const { loading } = useRequireLogin();
if (loading) {
if (settingsDisabled || loading) {
return null;
}
return (
<Layout>
<Layout settingsDisabled={settingsDisabled}>
TEST TEST TEST
{settingsDisabled}
<Settings />
</Layout>
);
}
export async function getServerSideProps() {
return {
props: {
settingsDisabled: !!process.env.CLOUD_MODE,
},
};
}
+8
View File
@@ -1,3 +1,11 @@
import Index from './index';
export default Index;
export async function getServerSideProps() {
return {
props: {
settingsDisabled: !!process.env.CLOUD_MODE,
},
};
}