1
- import { ReactElement , ReactNode , useState } from 'react' ;
1
+ import { ReactElement , ReactNode } from 'react' ;
2
2
import { NextPage } from 'next' ;
3
3
import type { AppType } from 'next/dist/shared/lib/utils' ;
4
4
import type { AppProps } from 'next/app' ;
5
5
import Head from 'next/head' ;
6
- import { Analytics } from '@vercel/analytics/react' ;
7
- import { ClerkProvider } from '@clerk/nextjs' ;
8
- import { useRouter } from 'next/router' ;
9
- import { Toaster } from 'react-hot-toast' ;
10
- import { ReactQueryDevtools } from '@tanstack/react-query-devtools' ;
11
6
12
7
import 'styles/main.css' ;
13
8
import '@uploadthing/react/styles.css' ;
14
- import { twConfig } from 'utils/helpers/tailwind' ;
15
- import { pl as clerkPl } from 'locale/clerk/pl' ;
16
- import pl from 'locale/pl.json' ;
17
9
import { api } from 'utils/api' ;
18
- import { isBrowser } from 'utils/helpers' ;
19
- import { IntlProvider } from 'react-intl' ;
20
- import { MetaPixelScript } from 'components/Common/externalScripts' ;
21
10
22
11
export type NextPageWithLayout < P = { } , IP = P > = NextPage < P , IP > & {
23
12
getLayout ?: ( page : ReactElement ) => ReactNode ;
@@ -27,58 +16,17 @@ type AppPropsWithLayout = AppProps & {
27
16
Component : NextPageWithLayout ;
28
17
} ;
29
18
30
- const messages = {
31
- pl,
32
- } ;
33
-
34
19
const App : AppType = ( { Component, pageProps } : AppPropsWithLayout ) => {
35
- const { push, events, locale } = useRouter ( ) ;
36
- const [ loading , setLoading ] = useState ( false ) ;
37
- isBrowser ( ) && events . on ( 'routeChangeStart' , ( ) => setLoading ( true ) ) ;
38
- isBrowser ( ) && events . on ( 'routeChangeComplete' , ( ) => setLoading ( false ) ) ;
39
- isBrowser ( ) && events . on ( 'routeChangeError' , ( ) => setLoading ( false ) ) ;
40
-
41
- const getLayout = Component . getLayout ?? ( ( page ) => page ) ;
42
20
return (
43
21
< >
44
- < style jsx global > { `body a button { cursor: ${ loading ? 'wait !important' : 'unset' } }` } </ style >
45
22
< Head >
46
- < title > Adsylabs - automatyzujemy współprace marketingowe </ title >
23
+ < title > Adsylabs</ title >
47
24
< meta name = "viewport" content = "width=device-width, initial-scale=1" />
48
- < meta
49
- name = "description"
50
- content = "Sprawdź jak automatyzujemy zatrudnianie i zarządzanie sprawdzonymi specjalistami marketingu. Nie znajdziemy kandydata? Nie płacisz."
51
- />
52
25
< link rel = "icon" href = "/favicon.ico" />
53
26
< meta name = "theme-color" content = "#000000" />
54
27
</ Head >
55
28
56
- < MetaPixelScript />
57
- < Analytics />
58
- < Toaster />
59
-
60
- < ClerkProvider
61
- localization = { clerkPl }
62
- appearance = { {
63
- variables : {
64
- colorPrimary : twConfig ?. theme ?. colors ?. primary ,
65
- } ,
66
- } }
67
- navigate = { ( to ) => push ( to ) }
68
- { ...pageProps }
69
- >
70
- { getLayout (
71
- // @ts -ignore
72
- < IntlProvider locale = { locale } messages = { messages [ locale ] } >
73
- < Component { ...pageProps } />
74
- </ IntlProvider >
75
- ) }
76
- { process . env . NODE_ENV !== 'production' && (
77
- < div className = "hidden md:block" >
78
- < ReactQueryDevtools initialIsOpen = { false } />
79
- </ div >
80
- ) }
81
- </ ClerkProvider >
29
+ < Component { ...pageProps } />
82
30
</ >
83
31
) ;
84
32
} ;
0 commit comments