11import React , { useEffect } from 'react' ;
22import PropTypes from 'proptypes' ;
33import { connect } from 'react-redux' ;
4- import { BrowserRouter as Router , Switch , Route } from 'react-router-dom' ;
4+ import {
5+ BrowserRouter as Router , Switch , Route , Redirect ,
6+ } from 'react-router-dom' ;
57import 'focus-visible' ;
68import { getMetadataRequest } from '@reducers/metadata' ;
79
@@ -12,8 +14,11 @@ import Header from '@components/main/header/Header';
1214import Footer from '@components/main/footer/Footer' ;
1315import StaticFooter from '@components/main/footer/StaticFooter' ;
1416import { SnapshotRenderer } from '@components/export/SnapshotService' ;
17+ import MaintenanceMode from '@components/MaintenanceMode' ;
1518import Routes from './Routes' ;
1619
20+ const maintenanceMode = true ;
21+
1722const App = ( {
1823 getMetadata,
1924} ) => {
@@ -22,17 +27,28 @@ const App = ({
2227 } ) ;
2328
2429 return (
25- < Router >
26- < RouteChange actions = { actions } />
27- < Header />
28- < Routes />
29- < Switch >
30- < Route path = "/(about|contact|privacy|faq)" component = { StaticFooter } />
31- < Route path = "/" component = { Footer } />
32- </ Switch >
33- < SnapshotRenderer />
34- < CookieNotice />
35- </ Router >
30+ maintenanceMode === true
31+ ? (
32+ < Router >
33+ < Switch >
34+ < Route path = "/" component = { MaintenanceMode } />
35+ < Redirect to = "/" />
36+ </ Switch >
37+ </ Router >
38+ )
39+ : (
40+ < Router >
41+ < RouteChange actions = { actions } />
42+ < Header />
43+ < Routes />
44+ < Switch >
45+ < Route path = "/(about|contact|privacy|faq)" component = { StaticFooter } />
46+ < Route path = "/" component = { Footer } />
47+ </ Switch >
48+ < SnapshotRenderer />
49+ < CookieNotice />
50+ </ Router >
51+ )
3652 ) ;
3753} ;
3854
0 commit comments