using constants to define header/footer appearence
parent
00adf86fa8
commit
cdb77f1be1
|
@ -8,6 +8,9 @@ export const THEME_CONFIG = `${prefix}.theme`;
|
|||
export const VERSION_CHECK = `${prefix}.version-check`;
|
||||
export const TOKEN_HEADER = `x-${prefix}-token`;
|
||||
|
||||
export const SHOW_HEADER = false;
|
||||
export const SHOW_FOOTER = false;
|
||||
|
||||
export const DEFAULT_LOCALE = 'en-US';
|
||||
export const DEFAULT_THEME = 'light';
|
||||
export const DEFAUL_CHART_HEIGHT = 400;
|
||||
|
|
|
@ -3,6 +3,7 @@ import { useRouter } from 'next/router';
|
|||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteList from 'components/pages/WebsiteList';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import { SHOW_HEADER, SHOW_FOOTER } from 'lib/constants';
|
||||
|
||||
export default function DashboardPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
@ -15,7 +16,7 @@ export default function DashboardPage() {
|
|||
}
|
||||
|
||||
return (
|
||||
<Layout header={false} footer={false}>
|
||||
<Layout header={SHOW_HEADER} footer={SHOW_FOOTER}>
|
||||
<WebsiteList userId={userId} />
|
||||
</Layout>
|
||||
);
|
||||
|
|
|
@ -7,11 +7,16 @@ import { useRouter } from 'next/router';
|
|||
export default function LoginPage() {
|
||||
const { query } = useRouter();
|
||||
if (query.hash) {
|
||||
return <AutoLogin hash={query.hash} />;
|
||||
return (
|
||||
<Layout title="login" header={false} footer={false} center>
|
||||
<AutoLogin hash={query.hash} />
|
||||
</Layout>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<Layout title="login" header={false} footer={false} center>
|
||||
<LoginForm />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Layout title="login" header={false} footer={false} center>
|
||||
<LoginForm />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import Layout from 'components/layout/Layout';
|
||||
import Settings from 'components/pages/Settings';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import { SHOW_HEADER, SHOW_FOOTER } from 'lib/constants';
|
||||
|
||||
export default function SettingsPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
@ -11,7 +12,7 @@ export default function SettingsPage() {
|
|||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Layout header={SHOW_HEADER} footer={SHOW_FOOTER}>
|
||||
<Settings />
|
||||
</Layout>
|
||||
);
|
||||
|
|
|
@ -3,6 +3,7 @@ import { useRouter } from 'next/router';
|
|||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteDetails from 'components/pages/WebsiteDetails';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import { SHOW_HEADER, SHOW_FOOTER } from 'lib/constants';
|
||||
|
||||
export default function DetailsPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
@ -16,7 +17,7 @@ export default function DetailsPage() {
|
|||
const [websiteId] = id;
|
||||
|
||||
return (
|
||||
<Layout header={false} footer={false}>
|
||||
<Layout header={SHOW_HEADER} footer={SHOW_FOOTER}>
|
||||
<WebsiteDetails websiteId={websiteId} />
|
||||
</Layout>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue