Skip to content

Commit cae5966

Browse files
committed
Merge branch 'release-1.0.61'
2 parents b7b1201 + 215c351 commit cae5966

File tree

26 files changed

+254
-222
lines changed

26 files changed

+254
-222
lines changed

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "foodoasis-client",
33
"description": "React Client for Food Oasis",
4-
"version": "1.0.60",
4+
"version": "1.0.61",
55
"author": "Hack for LA",
66
"license": "GPL-2.0",
77
"private": true,

client/src/App.js

Lines changed: 175 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from "helpers/Configuration";
1717
// import useGeolocation from "hooks/useGeolocation";
1818
// Components
19+
import { ToasterProvider } from "contexts/toaster-context";
1920
import { UserProvider } from "contexts/user-context";
2021
import { OriginCoordinatesContext } from "contexts/origin-coordinates-context";
2122
import Toast from "components/UI/Toast";
@@ -108,7 +109,6 @@ function App() {
108109
//const userCoordinates = useGeolocation();
109110
const [userCoordinates, setUserCoordinates] = useState(null);
110111

111-
const [toast, setToast] = useState({ message: "" });
112112
const [bgImg, setBgImg] = useState(`url("/landing-page/bg-LA.jpeg")`);
113113

114114
useEffect(() => {
@@ -138,200 +138,197 @@ function App() {
138138
const classes = useStyles();
139139

140140
return (
141-
<UserProvider setToast={setToast}>
142-
<OriginCoordinatesContext.Provider value={origin}>
143-
<ThemeProvider theme={theme}>
144-
<CssBaseline />
145-
<Router>
146-
<Grid
147-
container
148-
direction="column"
149-
wrap="nowrap"
150-
alignContent="stretch"
151-
spacing={0}
152-
classes={{
153-
container: classes.app,
154-
}}
155-
>
156-
<Switch>
157-
<Route exact path="/">
158-
<HeaderHome setToast={setToast} />
159-
</Route>
160-
<Route path="/widget"></Route>
161-
<Route>
162-
<Header
163-
tenantId={tenantId}
164-
taglineText={tenantDetails.taglineText}
165-
setToast={setToast}
166-
/>
167-
</Route>
168-
</Switch>
169-
<Switch className={classes.mainContent}>
170-
<Route exact path="/">
171-
<div
172-
className={classes.homeWrapper}
173-
style={{ backgroundImage: bgImg }}
174-
>
175-
<Home
176-
userCoordinates={userCoordinates}
177-
setUserCoordinates={setUserCoordinates}
178-
origin={origin}
179-
setOrigin={setOrigin}
141+
<ToasterProvider>
142+
<UserProvider>
143+
<OriginCoordinatesContext.Provider value={origin}>
144+
<ThemeProvider theme={theme}>
145+
<CssBaseline />
146+
<Router>
147+
<Grid
148+
container
149+
direction="column"
150+
wrap="nowrap"
151+
alignContent="stretch"
152+
spacing={0}
153+
classes={{
154+
container: classes.app,
155+
}}
156+
>
157+
<Switch>
158+
<Route exact path="/">
159+
<HeaderHome />
160+
</Route>
161+
<Route path="/widget"></Route>
162+
<Route>
163+
<Header
180164
tenantId={tenantId}
181165
taglineText={tenantDetails.taglineText}
182166
/>
183-
</div>
184-
</Route>
185-
{/*
167+
</Route>
168+
</Switch>
169+
<Switch className={classes.mainContent}>
170+
<Route exact path="/">
171+
<div
172+
className={classes.homeWrapper}
173+
style={{ backgroundImage: bgImg }}
174+
>
175+
<Home
176+
userCoordinates={userCoordinates}
177+
setUserCoordinates={setUserCoordinates}
178+
origin={origin}
179+
setOrigin={setOrigin}
180+
tenantId={tenantId}
181+
taglineText={tenantDetails.taglineText}
182+
/>
183+
</div>
184+
</Route>
185+
{/*
186186
Following route provides backward-compatibilty for the
187187
http"//foodoasis.la/search Link that has been published at
188188
http://publichealth.lacounty.gov/eh/LACFRI/ShareAndDonate.htm
189189
*/}
190-
<Redirect from="/search" to="/widget" />
191-
<Route path="/widget">
192-
<>
190+
<Redirect from="/search" to="/widget" />
191+
<Route path="/widget">
192+
<>
193+
<SearchResults
194+
origin={origin}
195+
setOrigin={setOrigin}
196+
userCoordinates={userCoordinates}
197+
taglineText={tenantDetails.taglineText}
198+
/>
199+
<WidgetFooter tenantId={tenantId} />
200+
</>
201+
</Route>
202+
<Route path="/organizations">
193203
<SearchResults
194204
origin={origin}
195205
setOrigin={setOrigin}
196206
userCoordinates={userCoordinates}
197-
setToast={setToast}
198207
taglineText={tenantDetails.taglineText}
199208
/>
200-
<WidgetFooter tenantId={tenantId} />
201-
</>
202-
</Route>
203-
<Route path="/organizations">
204-
<SearchResults
205-
origin={origin}
206-
setOrigin={setOrigin}
207-
userCoordinates={userCoordinates}
208-
setToast={setToast}
209-
taglineText={tenantDetails.taglineText}
210-
/>
211-
</Route>
212-
<Route path="/suggestion">
213-
<Suggestion setToast={setToast} />
214-
</Route>
215-
<Route path="/organizationedit/:id?">
216-
<ThemeProvider theme={adminTheme}>
209+
</Route>
210+
<Route path="/suggestion">
211+
<Suggestion />
212+
</Route>
213+
<Route path="/organizationedit/:id?">
214+
<ThemeProvider theme={adminTheme}>
215+
<div className={classes.organizationEditWrapper}>
216+
<OrganizationEdit />
217+
</div>
218+
</ThemeProvider>
219+
</Route>
220+
<Route path="/verificationdashboard">
221+
<div className={classes.verificationAdminWrapper}>
222+
<VerificationDashboard
223+
userCoordinates={userCoordinates}
224+
origin={origin}
225+
/>
226+
</div>
227+
</Route>
228+
<Route path="/verificationadmin">
229+
<ThemeProvider theme={adminTheme}>
230+
<div className={classes.verificationAdminWrapper}>
231+
<VerificationAdmin userCoordinates={userCoordinates} />
232+
</div>
233+
</ThemeProvider>
234+
</Route>
235+
<Route path="/parentorganizations">
217236
<div className={classes.organizationEditWrapper}>
218-
<OrganizationEdit setToast={setToast} />
237+
<ParentOrganizations />
219238
</div>
220-
</ThemeProvider>
221-
</Route>
222-
<Route path="/verificationdashboard">
223-
<div className={classes.verificationAdminWrapper}>
224-
<VerificationDashboard
225-
userCoordinates={userCoordinates}
226-
origin={origin}
227-
/>
228-
</div>
229-
</Route>
230-
<Route path="/verificationadmin">
231-
<ThemeProvider theme={adminTheme}>
239+
</Route>
240+
<Route path="/suggestions">
241+
<div className={classes.organizationEditWrapper}>
242+
<Suggestions />
243+
</div>
244+
</Route>
245+
<Route path="/securityadmindashboard">
232246
<div className={classes.verificationAdminWrapper}>
233-
<VerificationAdmin userCoordinates={userCoordinates} />
247+
<SecurityAdminDashboard
248+
userCoordinates={userCoordinates}
249+
/>
234250
</div>
235-
</ThemeProvider>
236-
</Route>
237-
<Route path="/parentorganizations">
238-
<div className={classes.organizationEditWrapper}>
239-
<ParentOrganizations setToast={setToast} />
240-
</div>
241-
</Route>
242-
<Route path="/suggestions">
243-
<div className={classes.organizationEditWrapper}>
244-
<Suggestions setToast={setToast} />
245-
</div>
246-
</Route>
247-
<Route path="/securityadmindashboard">
248-
<div className={classes.verificationAdminWrapper}>
249-
<SecurityAdminDashboard userCoordinates={userCoordinates} />
250-
</div>
251-
</Route>
252-
<Route path="/organizationimport">
253-
<ImportFile
254-
setToast={setToast}
255-
tenantId={tenantId}
256-
tenantName={tenantName}
257-
/>
258-
</Route>
259-
<Route path="/faqs/add">
260-
<FaqAdd />
261-
</Route>
262-
<Route path="/faqs/:identifier">
263-
<FaqEdit setToast={setToast} />
264-
</Route>
265-
<Route path="/resources">
266-
<Resources />
267-
</Route>
268-
<Route path="/register">
269-
<Register setToast={setToast} />
270-
</Route>
271-
<Route path="/confirm/:token">
272-
<ConfirmEmail setToast={setToast} />
273-
</Route>
274-
<Route path="/login/:email?">
275-
<Login setToast={setToast} />
276-
</Route>
277-
<Route path="/forgotpassword/:email?">
278-
<ForgotPassword setToast={setToast} />
279-
</Route>
280-
<Route path="/resetPassword/:token">
281-
<ResetPassword setToast={setToast} />
282-
</Route>
283-
<Route path="/donate">
284-
{tenantId === 6 ? (
285-
<DonateSB />
286-
) : tenantId === 5 ? (
287-
<DonateMCK />
288-
) : tenantId === 4 ? (
289-
<DonatePDX />
290-
) : tenantId === 3 ? (
291-
<DonateHI />
292-
) : tenantId === 2 ? (
293-
<DonateCA />
294-
) : (
295-
<Donate />
296-
)}
297-
</Route>
298-
<Route path="/about">
299-
{tenantId === 6 ? (
300-
<AboutSB />
301-
) : tenantId === 5 ? (
302-
<AboutMCK />
303-
) : tenantId === 4 ? (
304-
<AboutPDX />
305-
) : tenantId === 3 ? (
306-
<AboutHI />
307-
) : tenantId === 2 ? (
308-
<AboutCA />
309-
) : (
310-
<About />
311-
)}
312-
</Route>
313-
<Route exact path="/faqs">
314-
{tenantId === 6 ? (
315-
<FaqSB />
316-
) : tenantId === 5 ? (
317-
<FaqMCK />
318-
) : tenantId === 4 ? (
319-
<FaqPDX />
320-
) : tenantId === 3 ? (
321-
<FaqHI />
322-
) : tenantId === 2 ? (
323-
<FaqCA />
324-
) : (
325-
<Faq />
326-
)}
327-
</Route>
328-
</Switch>
329-
<Toast toast={toast} setToast={setToast} />
330-
</Grid>
331-
</Router>
332-
</ThemeProvider>
333-
</OriginCoordinatesContext.Provider>
334-
</UserProvider>
251+
</Route>
252+
<Route path="/organizationimport">
253+
<ImportFile tenantId={tenantId} tenantName={tenantName} />
254+
</Route>
255+
<Route path="/faqs/add">
256+
<FaqAdd />
257+
</Route>
258+
<Route path="/faqs/:identifier">
259+
<FaqEdit />
260+
</Route>
261+
<Route path="/resources">
262+
<Resources />
263+
</Route>
264+
<Route path="/register">
265+
<Register />
266+
</Route>
267+
<Route path="/confirm/:token">
268+
<ConfirmEmail />
269+
</Route>
270+
<Route path="/login/:email?">
271+
<Login />
272+
</Route>
273+
<Route path="/forgotpassword/:email?">
274+
<ForgotPassword />
275+
</Route>
276+
<Route path="/resetPassword/:token">
277+
<ResetPassword />
278+
</Route>
279+
<Route path="/donate">
280+
{tenantId === 6 ? (
281+
<DonateSB />
282+
) : tenantId === 5 ? (
283+
<DonateMCK />
284+
) : tenantId === 4 ? (
285+
<DonatePDX />
286+
) : tenantId === 3 ? (
287+
<DonateHI />
288+
) : tenantId === 2 ? (
289+
<DonateCA />
290+
) : (
291+
<Donate />
292+
)}
293+
</Route>
294+
<Route path="/about">
295+
{tenantId === 6 ? (
296+
<AboutSB />
297+
) : tenantId === 5 ? (
298+
<AboutMCK />
299+
) : tenantId === 4 ? (
300+
<AboutPDX />
301+
) : tenantId === 3 ? (
302+
<AboutHI />
303+
) : tenantId === 2 ? (
304+
<AboutCA />
305+
) : (
306+
<About />
307+
)}
308+
</Route>
309+
<Route exact path="/faqs">
310+
{tenantId === 6 ? (
311+
<FaqSB />
312+
) : tenantId === 5 ? (
313+
<FaqMCK />
314+
) : tenantId === 4 ? (
315+
<FaqPDX />
316+
) : tenantId === 3 ? (
317+
<FaqHI />
318+
) : tenantId === 2 ? (
319+
<FaqCA />
320+
) : (
321+
<Faq />
322+
)}
323+
</Route>
324+
</Switch>
325+
<Toast />
326+
</Grid>
327+
</Router>
328+
</ThemeProvider>
329+
</OriginCoordinatesContext.Provider>
330+
</UserProvider>
331+
</ToasterProvider>
335332
);
336333
}
337334

0 commit comments

Comments
 (0)