| 1 |
import Favorites from './pages/favorites/favorites'; |
| 2 |
import Index from './pages/index'; |
| 3 |
import Overview from './pages/overview/overview'; |
| 4 |
import Preview from './pages/preview/preview'; |
| 5 |
import { LastFilterProvider } from './context/last-filter-context'; |
| 6 |
import { QueryClientProvider, QueryClient } from 'react-query'; |
| 7 |
import { ReactQueryDevtools } from 'react-query/devtools'; |
| 8 |
import { Router } from '@reach/router'; |
| 9 |
import { SettingsProvider } from './context/settings-context'; |
| 10 |
|
| 11 |
const queryClient = new QueryClient( { |
| 12 |
defaultOptions: { |
| 13 |
queries: { |
| 14 |
refetchOnWindowFocus: false, |
| 15 |
retry: false, |
| 16 |
staleTime: 1000 * 60 * 30, // 30 minutes |
| 17 |
}, |
| 18 |
}, |
| 19 |
} ); |
| 20 |
|
| 21 |
export default function App() { |
| 22 |
return ( |
| 23 |
<div className="e-kit-library"> |
| 24 |
<QueryClientProvider client={ queryClient }> |
| 25 |
<SettingsProvider value={ elementorAppConfig[ 'kit-library' ] }> |
| 26 |
<LastFilterProvider> |
| 27 |
<Router> |
| 28 |
<Index path="/" /> |
| 29 |
<Favorites path="/favorites" /> |
| 30 |
<Preview path="/preview/:id" /> |
| 31 |
<Overview path="/overview/:id" /> |
| 32 |
</Router> |
| 33 |
</LastFilterProvider> |
| 34 |
</SettingsProvider> |
| 35 |
{ elementorCommon.config.isElementorDebug && <ReactQueryDevtools initialIsOpen={ false } /> } |
| 36 |
</QueryClientProvider> |
| 37 |
</div> |
| 38 |
); |
| 39 |
} |
| 40 |
|