import React from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import AppContentContainer from './AppContent/AppContentContainer'; import AppMenuContainer from './AppMenu/AppMenuContainer'; import CIDetailViewContainer from './AppContent/CIDetailView/CIDetailViewContainer'; import reduxLang from '../middleware/lang'; import StartScreenContainer from './StartScreenContainer'; import { useSelector } from 'react-redux' import { getLocaleFromURL, defineLocale, shouldDisplayDynamicComponent, getDjangoView, routePathForDynamicComponent } from '../utils'; import BurgerBtnContainer from './AppMenu/BurgerBtnContainer'; const App = ({ pending, menuOpen, setLocale, isPreLaunch }) => { // set initial language setLocale(defineLocale(isPreLaunch)); let localeFromURL = getLocaleFromURL(window.location.pathname); if (localeFromURL === undefined) { localeFromURL = '' } const basename = '/' + localeFromURL + useSelector(state => state.urls.site); const activeSite = useSelector(state => state.urls.site); const urls = useSelector(state => state.urls.allSites[activeSite].urls); const DynamicComponent = React.memo(() => (