disable notification for mobile & non calculation pages
This commit is contained in:
parent
d0856f95af
commit
b99cad781e
@ -1,4 +1,5 @@
|
||||
/* eslint-disable import/no-mutable-exports */
|
||||
import { Media } from '@/styles/media';
|
||||
import type { MessageInstance } from 'antd/es/message/interface';
|
||||
import type { NotificationInstance } from 'antd/es/notification/interface';
|
||||
import type { ReactNode } from 'react';
|
||||
@ -26,7 +27,7 @@ export function Notification({ children }: { readonly children: ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
{messageContextHolder}
|
||||
{notificationContextHolder}
|
||||
<Media greaterThanOrEqual="laptop">{notificationContextHolder}</Media>
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
|
||||
@ -4,7 +4,7 @@ import '../styles/antd-fix.css';
|
||||
import '../styles/antd.min.css';
|
||||
import initializeQueryClient from '@/api/client';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import { Loading, Notification } from '@/Components/Common';
|
||||
import { Loading } from '@/Components/Common';
|
||||
import Layout from '@/Components/Layout';
|
||||
import { theme } from '@/config/ui';
|
||||
import { usePageLoading } from '@/hooks';
|
||||
@ -55,13 +55,11 @@ function App({ Component, pageProps }) {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Notification>
|
||||
<MediaContextProvider>
|
||||
<Layout {...pageProps}>
|
||||
{loading ? <Loading /> : <Component {...pageProps} />}
|
||||
</Layout>
|
||||
</MediaContextProvider>
|
||||
</Notification>
|
||||
<MediaContextProvider>
|
||||
<Layout {...pageProps}>
|
||||
{loading ? <Loading /> : <Component {...pageProps} />}
|
||||
</Layout>
|
||||
</MediaContextProvider>
|
||||
</AntdConfig>
|
||||
</QueryClientProvider>
|
||||
</ApolloProvider>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import * as Calculation from '@/Components/Calculation';
|
||||
import { Notification } from '@/Components/Common';
|
||||
import { Error } from '@/Components/Common/Error';
|
||||
import { NavigationBar, Tabs } from '@/Components/Layout/Navigation';
|
||||
import { NavigationProvider } from '@/context/navigation';
|
||||
@ -36,6 +37,7 @@ export function Content({ initHooks, title }) {
|
||||
<Head>
|
||||
<title>{getPageTitle(title)}</title>
|
||||
</Head>
|
||||
<Notification />
|
||||
<Media lessThan="laptop">
|
||||
<NavigationProvider>
|
||||
<Tabs tabs={tabs} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user