1- import React , { useEffect } from 'react' ;
1+ /* eslint-disable max-lines-per-function */
2+ import React , { useEffect , useState } from 'react' ;
23import { BrowserRouter , Redirect , Route , Switch } from 'react-router-dom' ;
34import { QueryParamProvider } from 'use-query-params' ;
45import Layout from './components/common/Layout' ;
@@ -17,44 +18,96 @@ import SearchProjects from './pages/SearchProjects';
1718import TagGenerator from './pages/TagGenerator' ;
1819import Error404 from './pages/Error404' ;
1920import ShareTheCti from './pages/Share' ;
20- import Privacy from './pages/Privacy'
21+ import Privacy from './pages/Privacy' ;
22+ import PopUp from './pages/Privacy/PopUp' ;
2123import Guides from './guides/' ;
2224import useStyles from './styles' ;
2325
2426const RouteTitled = ( { title, ...rest } ) => {
2527 useEffect ( ( ) => {
2628 if ( title ) {
27- document . title = `Civic Tech Index — ${ title } `
29+ document . title = `Civic Tech Index — ${ title } ` ;
2830 }
2931 } ) ;
3032
3133 return < Route { ...rest } /> ;
3234} ;
3335
3436const App = ( ) => {
37+ const [ showModal , setShowModal ] = useState ( false ) ;
3538 useStyles ( ) ;
3639 return (
3740 < BrowserRouter >
3841 < ScrollToTop />
42+ < PopUp showModal = { showModal } setShowModal = { setShowModal } />
3943 < QueryParamProvider ReactRouterRoute = { Route } >
4044 < Layout >
4145 < Switch >
4246 < Route exact path = '/' component = { Landing } />
4347 < RouteTitled exact path = '/about' component = { About } title = 'About' />
44- < RouteTitled exact path = '/about/contact' component = { Contact } title = 'Contact Us' />
48+ < RouteTitled
49+ exact
50+ path = '/about/contact'
51+ component = { Contact }
52+ title = 'Contact Us'
53+ />
4554 < RouteTitled exact path = '/about/faq' component = { Faq } title = 'FAQ' />
46- < RouteTitled exact path = { '/organizations' } component = { Contributors } title = 'Organizations' />
55+ < RouteTitled
56+ exact
57+ path = { '/organizations' }
58+ component = { Contributors }
59+ title = 'Organizations'
60+ />
4761 < RouteTitled exact path = '/home' component = { Home } title = 'Home' />
48- < RouteTitled exact path = '/projects' component = { SearchProjects } title = 'Search Projects' />
49- < RouteTitled exact path = '/join-index' component = { TagGenerator } title = 'Join the Index' />
50- < RouteTitled exact path = '/join-index/how-to-add' component = { HowToAdd } title = 'How to Add Your Project' />
51- < RouteTitled exact path = '/support/collaborate' component = { Collaborate } title = 'Collaborate with Us' />
52- < RouteTitled exact path = '/support/donate' component = { Donate } title = 'Donate' />
53- < RouteTitled exact path = '/support/share' component = { ShareTheCti } title = 'Share the CTI' />
54- < RouteTitled exact path = '/privacy' component = { Privacy } title = 'Privacy' />
62+ < RouteTitled
63+ exact
64+ path = '/projects'
65+ component = { SearchProjects }
66+ title = 'Search Projects'
67+ />
68+ < RouteTitled
69+ exact
70+ path = '/join-index'
71+ component = { TagGenerator }
72+ title = 'Join the Index'
73+ />
74+ < RouteTitled
75+ exact
76+ path = '/join-index/how-to-add'
77+ component = { HowToAdd }
78+ title = 'How to Add Your Project'
79+ />
80+ < RouteTitled
81+ exact
82+ path = '/support/collaborate'
83+ component = { Collaborate }
84+ title = 'Collaborate with Us'
85+ />
86+ < RouteTitled
87+ exact
88+ path = '/support/donate'
89+ component = { Donate }
90+ title = 'Donate'
91+ />
92+ < RouteTitled
93+ exact
94+ path = '/support/share'
95+ component = { ShareTheCti }
96+ title = 'Share the CTI'
97+ />
98+ < RouteTitled
99+ exact
100+ path = '/privacy'
101+ component = { Privacy }
102+ title = 'Privacy'
103+ />
55104 < Route exact path = '/organization/:name' component = { IndvOrgPage } />
56105 { /* test and error page routes begin */ }
57- < RouteTitled path = '/guides/:guide' component = { Guides } title = 'Guides' />
106+ < RouteTitled
107+ path = '/guides/:guide'
108+ component = { Guides }
109+ title = 'Guides'
110+ />
58111 < RouteTitled path = '/404' component = { Error404 } title = '404' />
59112 { /* test and error page routes end */ }
60113 < Redirect from = '/add' to = '/join-index/how-to-add' />
0 commit comments