@@ -3,22 +3,24 @@ import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'
3
3
import './app.css'
4
4
import CombinedProvider from './contexts/CombinedProvider'
5
5
import { AboutPage , TimeTableSchedulerPage , FaqsPage , NotFoundPage } from './pages'
6
- import { getPath , config , plausible } from './utils'
6
+ import { getPath , config , dev_config , plausible } from './utils'
7
7
import Layout from './components/layout'
8
8
9
+ const configToUse = Number ( import . meta. env . VITE_APP_PROD ) ? config : dev_config
10
+
9
11
// Configures the path for pages.
10
12
const pages = [
11
- { path : getPath ( config . paths . about ) , location : 'Sobre' , element : AboutPage , liquid : true } ,
12
- { path : getPath ( config . paths . planner ) , location : 'Horários' , element : TimeTableSchedulerPage , liquid : true } ,
13
- { path : getPath ( config . paths . faqs ) , location : 'FAQs' , element : FaqsPage , liquid : true } ,
14
- { path : getPath ( config . paths . notfound ) , location : 'NotFound' , element : NotFoundPage , liquid : true } ,
13
+ { path : getPath ( configToUse . paths . about ) , location : 'Sobre' , element : AboutPage , liquid : true } ,
14
+ { path : getPath ( configToUse . paths . planner ) , location : 'Horários' , element : TimeTableSchedulerPage , liquid : true } ,
15
+ { path : getPath ( configToUse . paths . faqs ) , location : 'FAQs' , element : FaqsPage , liquid : true } ,
16
+ { path : getPath ( configToUse . paths . notfound ) , location : 'NotFound' , element : NotFoundPage , liquid : true } ,
15
17
]
16
18
17
19
const redirects = [
18
- { from : "/" , to : getPath ( config . paths . planner ) } ,
19
- { from : config . pathPrefix , to : getPath ( config . paths . planner ) } ,
20
- { from : config . pathPrefix . slice ( 0 , - 1 ) , to : getPath ( config . paths . planner ) } ,
21
- { from : getPath ( config . paths . home ) , to : getPath ( config . paths . about ) } ,
20
+ { from : "/" , to : getPath ( configToUse . paths . planner ) } ,
21
+ { from : configToUse . pathPrefix , to : getPath ( configToUse . paths . planner ) } ,
22
+ { from : configToUse . pathPrefix . slice ( 0 , - 1 ) , to : getPath ( configToUse . paths . planner ) } ,
23
+ { from : getPath ( configToUse . paths . home ) , to : getPath ( configToUse . paths . about ) } ,
22
24
]
23
25
24
26
const App = ( ) => {
@@ -59,4 +61,4 @@ const App = () => {
59
61
)
60
62
}
61
63
62
- export default App
64
+ export default App
0 commit comments