apps/web: create Content component to separate from error
This commit is contained in:
parent
540d5642a1
commit
47d47a0bfd
@ -10,9 +10,7 @@ import * as hooks from '@/process/hooks';
|
||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Home(props) {
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
function Content() {
|
||||
hooks.useSentryScope();
|
||||
hooks.useMainData();
|
||||
hooks.useInsuranceData();
|
||||
@ -29,6 +27,13 @@ export default function Home(props) {
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home(props) {
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
return <Content />;
|
||||
}
|
||||
|
||||
export const makeGetServerSideProps = ({ roles }) =>
|
||||
/** @type {import('next').GetServerSideProps} */
|
||||
(
|
||||
|
||||
@ -8,12 +8,10 @@ import * as hooks from '@/process/hooks';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Unlimited(props) {
|
||||
function Content() {
|
||||
const store = useStore();
|
||||
store.$process.add('Unlimited');
|
||||
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
hooks.useSentryScope();
|
||||
hooks.useMainData();
|
||||
hooks.useGetUsers();
|
||||
@ -33,6 +31,12 @@ export default function Unlimited(props) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function Unlimited(props) {
|
||||
if (props.statusCode !== 200) return <Error {...props} />;
|
||||
|
||||
return <Content />;
|
||||
}
|
||||
|
||||
export const getServerSideProps = makeGetServerSideProps({
|
||||
roles: unlimitedRoles,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user