forked from discord/access
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
88 lines (80 loc) · 2.26 KB
/
index.tsx
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import * as React from 'react';
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {createRoot} from 'react-dom/client';
import {BrowserRouter} from 'react-router-dom';
import {ThemeProvider, createTheme} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs';
import {LocalizationProvider} from '@mui/x-date-pickers';
import * as Sentry from '@sentry/react';
import App from './App';
import Error from './pages/Error';
const queryClient = new QueryClient({
defaultOptions: {
queries: {retry: false},
},
});
declare module '@mui/material/styles' {
interface Palette {
primary_extra_light: Palette['primary'];
}
interface PaletteOptions {
primary_extra_light?: PaletteOptions['primary'];
}
}
declare module '@mui/material/Button' {
interface ButtonPropsColorOverrides {
primary_extra_light: true;
}
}
// See https://discord.com/branding
let theme = createTheme({
palette: {
primary: {
main: '#5865F2',
},
secondary: {
main: '#EB459E',
},
error: {
main: '#ED4245',
},
warning: {
main: '#FEE75C',
},
success: {
main: '#57F287',
},
primary_extra_light: {
main: '#A5B2FF',
},
},
});
if (['production', 'staging'].includes(process.env.NODE_ENV)) {
// Use a placeholder DSN as we'll be using the tunnel to proxy all Sentry React errors
Sentry.init({
dsn: 'https://[email protected]/1234567',
release: process.env.REACT_APP_SENTRY_RELEASE,
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1.0,
tunnel: '/api/bugs/sentry',
});
}
createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Sentry.ErrorBoundary fallback={<Error />} showDialog>
<BrowserRouter>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<React.Fragment>
<CssBaseline />
<App />
</React.Fragment>
</LocalizationProvider>
</ThemeProvider>
</QueryClientProvider>
</BrowserRouter>
</Sentry.ErrorBoundary>
</React.StrictMode>,
);