2023-07-20 15:30:26 +00:00
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
|
import Routes from './routes'
|
|
|
|
import 'react-toastify/dist/ReactToastify.css'
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
import { createTheme, ThemeProvider } from '@material-ui/core/styles'
|
|
|
|
import { ptBR } from '@material-ui/core/locale'
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
import { TabTicketProvider } from '../src/context/TabTicketHeaderOption/TabTicketHeaderOption'
|
2022-10-25 14:16:36 +00:00
|
|
|
|
2022-01-06 01:26:15 +00:00
|
|
|
const App = () => {
|
2023-07-20 15:30:26 +00:00
|
|
|
const [locale, setLocale] = useState()
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
const theme = createTheme(
|
|
|
|
{
|
|
|
|
scrollbarStyles: {
|
2023-07-20 15:30:26 +00:00
|
|
|
'&::-webkit-scrollbar': {
|
|
|
|
width: '8px',
|
|
|
|
height: '8px',
|
2022-01-06 01:26:15 +00:00
|
|
|
},
|
2023-07-20 15:30:26 +00:00
|
|
|
'&::-webkit-scrollbar-thumb': {
|
|
|
|
boxShadow: 'inset 0 0 6px rgba(0, 0, 0, 0.3)',
|
2022-01-19 00:12:21 +00:00
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
backgroundColor: '#e8e8e8',
|
2022-01-06 01:26:15 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
palette: {
|
2022-01-19 00:12:21 +00:00
|
|
|
//primary: { main: "#2576d2" },
|
2023-07-20 15:30:26 +00:00
|
|
|
primary: { main: '#ec5114' },
|
2022-01-06 01:26:15 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
locale
|
2023-07-20 15:30:26 +00:00
|
|
|
)
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
useEffect(() => {
|
2023-07-20 15:30:26 +00:00
|
|
|
const i18nlocale = localStorage.getItem('i18nextLng')
|
2022-01-06 01:26:15 +00:00
|
|
|
const browserLocale =
|
2023-07-20 15:30:26 +00:00
|
|
|
i18nlocale.substring(0, 2) + i18nlocale.substring(3, 5)
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
if (browserLocale === 'ptBR') {
|
|
|
|
setLocale(ptBR)
|
2022-01-06 01:26:15 +00:00
|
|
|
}
|
2023-07-20 15:30:26 +00:00
|
|
|
}, [])
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<ThemeProvider theme={theme}>
|
2022-10-25 14:16:36 +00:00
|
|
|
{/*TabTicketProvider Context to manipulate the entire state of selected option from user click on tickets options header */}
|
|
|
|
<TabTicketProvider>
|
|
|
|
<Routes />
|
|
|
|
</TabTicketProvider>
|
2022-01-06 01:26:15 +00:00
|
|
|
</ThemeProvider>
|
2023-07-20 15:30:26 +00:00
|
|
|
)
|
|
|
|
}
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
export default App
|