From 47d47a0bfdee56aeee7a983ca77a2b4a057cd5e1 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 4 Mar 2024 16:41:22 +0300 Subject: [PATCH] apps/web: create Content component to separate from error --- apps/web/pages/index.jsx | 11 ++++++++--- apps/web/pages/unlimited.jsx | 10 +++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/web/pages/index.jsx b/apps/web/pages/index.jsx index 41f4da5..6fdefbf 100644 --- a/apps/web/pages/index.jsx +++ b/apps/web/pages/index.jsx @@ -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 ; - +function Content() { hooks.useSentryScope(); hooks.useMainData(); hooks.useInsuranceData(); @@ -29,6 +27,13 @@ export default function Home(props) { ); } + +export default function Home(props) { + if (props.statusCode !== 200) return ; + + return ; +} + export const makeGetServerSideProps = ({ roles }) => /** @type {import('next').GetServerSideProps} */ ( diff --git a/apps/web/pages/unlimited.jsx b/apps/web/pages/unlimited.jsx index b21af4e..e6bc64d 100644 --- a/apps/web/pages/unlimited.jsx +++ b/apps/web/pages/unlimited.jsx @@ -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 ; - 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 ; + + return ; +} + export const getServerSideProps = makeGetServerSideProps({ roles: unlimitedRoles, });