22 * Main App component
33 */
44import React , { useLayoutEffect , useEffect , useRef } from "react" ;
5- import { Router , useLocation , Redirect } from "@reach/router" ;
5+ import { Router , useLocation } from "@reach/router" ;
66import { disableSidebarForRoute } from "@topcoder/micro-frontends-navbar-app" ;
77import _ from "lodash" ;
88import { usePreviousLocation } from "./utils/hooks" ;
9- import Parcel from ' single-spa-react/parcel'
10- import { useSelector } from ' react-redux'
11- import ReactDOM from ' react-dom'
9+ import Parcel from " single-spa-react/parcel" ;
10+ import { useSelector } from " react-redux" ;
11+ import ReactDOM from " react-dom" ;
1212
1313import "./styles/main.scss" ;
1414
15- import Menu from ' ./containers/Menu'
15+ import Menu from " ./containers/Menu" ;
1616
1717const App = ( ) => {
18- const menuVisible = useSelector ( state => state . menu . show )
18+ const menuVisible = useSelector ( ( state ) => state . menu . show ) ;
1919
2020 useLayoutEffect ( ( ) => {
2121 disableSidebarForRoute ( "/earn/*" ) ;
@@ -36,11 +36,19 @@ const App = () => {
3636
3737 return (
3838 < >
39- { menuVisible && ReactDOM . createPortal ( < Menu /> , document . querySelector ( '#menu-id' ) ) }
39+ { menuVisible &&
40+ ReactDOM . createPortal ( < Menu /> , document . querySelector ( "#menu-id" ) ) }
4041 < Router >
41- < Parcel path = "/earn/find/challenges" config = { ( ) => System . import ( '@topcoder/micro-frontends-challenges-app' ) } />
42- < Parcel path = "/earn/my-gigs" config = { ( ) => System . import ( '@topcoder/micro-frontends-gigs-app' ) } />
43- < Redirect from = "/earn/*" to = "/earn/find/challenges" noThrow />
42+ < Parcel
43+ path = "/earn/find/challenges/*"
44+ config = { ( ) =>
45+ System . import ( "@topcoder/micro-frontends-challenges-app" )
46+ }
47+ />
48+ < Parcel
49+ path = "/earn/my-gigs"
50+ config = { ( ) => System . import ( "@topcoder/micro-frontends-gigs-app" ) }
51+ />
4452 </ Router >
4553 </ >
4654 ) ;
0 commit comments