forked from DevCom-IITB/ResoBin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
42 lines (36 loc) · 1.2 KB
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { Suspense } from 'react'
import { Helmet } from 'react-helmet-async'
import { useSelector } from 'react-redux'
import { ThemeProvider } from 'styled-components/macro'
import { LoaderAnimation } from 'components/shared'
import { usePageTracking } from 'hooks'
import { AppRoutes } from 'routes'
import { selectAuthLoading } from 'store/authSlice'
import { selectTheme } from 'store/settingsSlice'
import { themes, GlobalStyles } from 'styles'
// ? for viewing course resource pdfs
// import worker from 'pdfjs-dist/build/pdf.worker.entry'
// import { pdfjs } from 'react-pdf'
// pdfjs.GlobalWorkerOptions.workerSrc = worker
const App = () => {
const theme = useSelector(selectTheme)
const authLoading = useSelector(selectAuthLoading)
usePageTracking()
return (
<ThemeProvider theme={themes[theme] ?? themes.dark}>
<Helmet>
<title>ResoBin</title>
<meta
name="description"
content="IIT Bombay's resources sharing website"
/>
</Helmet>
<GlobalStyles />
<LoaderAnimation fixed disable={!authLoading} />
<Suspense fallback={<LoaderAnimation fixed />}>
<AppRoutes />
</Suspense>
</ThemeProvider>
)
}
export default App