Skip to content

Commit

Permalink
Merge branch 'release-1.0.58'
Browse files Browse the repository at this point in the history
  • Loading branch information
entrotech committed Jun 15, 2021
2 parents fa730f5 + e31ab96 commit 84378b7
Show file tree
Hide file tree
Showing 18 changed files with 46,551 additions and 7,680 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"type": "node",
"request": "launch",
"name": "Launch Web API Server",
"program": "${workspaceFolder}\\server\\server.js",
"envFile": "${workspaceFolder}\\server\\.env"
"program": "${workspaceFolder}/server/server.js",
"envFile": "${workspaceFolder}/server/.env"
}
]
}
35,376 changes: 29,689 additions & 5,687 deletions client/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "foodoasis-client",
"description": "React Client for Food Oasis",
"version": "1.0.57",
"version": "1.0.58",
"author": "Hack for LA",
"license": "GPL-2.0",
"private": true,
Expand Down
298 changes: 151 additions & 147 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { Grid, CssBaseline } from "@material-ui/core";
import theme from "theme/clientTheme";
import { logout } from "services/account-service";
import { tenantId, defaultViewport } from "helpers/Configuration";
import useGeolocation from "hooks/useGeolocation";
// import useGeolocation from "hooks/useGeolocation";

// Components
import { UserContext } from "contexts/user-context";
import { OriginCoordinatesContext } from "contexts/origin-coordinates-context";
import Toast from "components/UI/Toast";
import Header from "components/Layout/Header";
import HeaderHome from "components/Layout/HeaderHome";
Expand Down Expand Up @@ -97,7 +98,8 @@ function App() {

// userCoordinates is the user's location if geolocation is enabled,
// otherwise null.
const userCoordinates = useGeolocation();
//const userCoordinates = useGeolocation();
const [userCoordinates, setUserCoordinates] = useState(null);

const [toast, setToast] = useState({ message: "" });
const [bgImg, setBgImg] = useState("");
Expand Down Expand Up @@ -142,173 +144,175 @@ function App() {

return (
<UserContext.Provider value={user}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Router>
<Grid
container
direction="column"
wrap="nowrap"
alignContent="stretch"
spacing={0}
classes={{
container: classes.app,
}}
>
<Switch>
<Route exact path="/">
<HeaderHome user={user} setUser={onLogin} setToast={setToast} />
</Route>
<Route>
<Header user={user} setUser={onLogin} setToast={setToast} />
</Route>
</Switch>
<Switch className={classes.mainContent}>
<Route exact path="/">
<div
className={classes.homeWrapper}
style={{ backgroundImage: bgImg }}
>
<OriginCoordinatesContext.Provider value={origin}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Router>
<Grid
container
direction="column"
wrap="nowrap"
alignContent="stretch"
spacing={0}
classes={{
container: classes.app,
}}
>
<Switch>
<Route exact path="/">
<HeaderHome
user={user}
setUser={onLogin}
setToast={setToast}
/>
</Route>
<Route>
<Header user={user} setUser={onLogin} setToast={setToast} />
</Route>
</Switch>
<Switch className={classes.mainContent}>
<Route exact path="/">
<div
className={classes.homeWrapper}
style={{ backgroundImage: bgImg }}
>
<Home
userCoordinates={userCoordinates}
setUserCoordinates={setUserCoordinates}
origin={origin}
setOrigin={setOrigin}
/>
</div>
</div>
</Route>
{/*
</Route>
{/*
Following route provides backward-compatibilty for the
http"//foodoasis.la/search Link that has been published at
http://publichealth.lacounty.gov/eh/LACFRI/ShareAndDonate.htm
*/}
<Redirect from="/search" to="/organizations" />
<Route path="/organizations">
<SearchResults
origin={origin}
setOrigin={setOrigin}
userCoordinates={userCoordinates}
setToast={setToast}
/>
</Route>
<Route path="/suggestion">
<Suggestion setToast={setToast} />
</Route>
<Route path="/organizationedit/:id?">
<ThemeProvider theme={adminTheme}>
<div className={classes.OrganizationEditWrapper}>
<OrganizationEdit setToast={setToast} user={user} />
</div>
</ThemeProvider>
</Route>
<Route path="/verificationdashboard">
<div className={classes.verificationAdminWrapper}>
<VerificationDashboard
user={user}
<Redirect from="/search" to="/organizations" />
<Route path="/organizations">
<SearchResults
origin={origin}
setOrigin={setOrigin}
userCoordinates={userCoordinates}
setToast={setToast}
/>
</div>
</Route>
<Route path="/verificationadmin">
<ThemeProvider theme={adminTheme}>
</Route>
<Route path="/suggestion">
<Suggestion setToast={setToast} />
</Route>
<Route path="/organizationedit/:id?">
<ThemeProvider theme={adminTheme}>
<div className={classes.OrganizationEditWrapper}>
<OrganizationEdit setToast={setToast} user={user} />
</div>
</ThemeProvider>
</Route>
<Route path="/verificationdashboard">
<div className={classes.verificationAdminWrapper}>
<VerificationAdmin
<VerificationDashboard
user={user}
userCoordinates={userCoordinates}
origin={origin}
/>
</div>
</ThemeProvider>
</Route>
<Route path="/securityadmindashboard">
<div className={classes.verificationAdminWrapper}>
<SecurityAdminDashboard
user={user}
userCoordinates={userCoordinates}
/>
</div>
</Route>
<Route path="/organizationimport">
<ImportFile user={user} setToast={setToast} />
</Route>
<Route path="/faqs/add">
<FaqAdd />
</Route>
<Route path="/faqs/:identifier">
<FaqEdit setToast={setToast} />
</Route>
<Route path="/resources">
<Resources />
</Route>
<Route path="/register">
<Register setToast={setToast} />
</Route>
<Route path="/confirm/:token">
<ConfirmEmail setToast={setToast} />
</Route>
<Route path="/login/:email?">
<Login user={user} setUser={onLogin} setToast={setToast} />
</Route>
<Route path="/forgotpassword/:email?">
<ForgotPassword setToast={setToast} />
</Route>
<Route path="/resetPassword/:token">
<ResetPassword setToast={setToast} />
</Route>
<Route path="/donate">
{tenantId === 6 ? (
<DonateSB />
) : tenantId === 5 ? (
<DonateMCK />
) : tenantId === 4 ? (
<DonatePDX />
) : tenantId === 3 ? (
<DonateHI />
) : tenantId === 2 ? (
<DonateCA />
) : (
<Donate />
)}
</Route>
<Route path="/about">
{tenantId === 6 ? (
<AboutSB />
) : tenantId === 5 ? (
<AboutMCK />
) : tenantId === 4 ? (
<AboutPDX />
) : tenantId === 3 ? (
<AboutHI />
) : tenantId === 2 ? (
<AboutCA />
) : (
<About />
)}
</Route>
<Route exact path="/faqs">
{tenantId === 6 ? (
<FaqSB />
) : tenantId === 5 ? (
<FaqMCK />
) : tenantId === 4 ? (
<FaqPDX />
) : tenantId === 3 ? (
<FaqHI />
) : tenantId === 2 ? (
<FaqCA />
) : (
<Faq />
)}
</Route>
</Switch>
<Toast toast={toast} setToast={setToast} />
</Grid>
</Router>
</ThemeProvider>
</Route>
<Route path="/verificationadmin">
<ThemeProvider theme={adminTheme}>
<div className={classes.verificationAdminWrapper}>
<VerificationAdmin
user={user}
userCoordinates={userCoordinates}
/>
</div>
</ThemeProvider>
</Route>
<Route path="/securityadmindashboard">
<div className={classes.verificationAdminWrapper}>
<SecurityAdminDashboard
user={user}
userCoordinates={userCoordinates}
/>
</div>
</Route>
<Route path="/organizationimport">
<ImportFile user={user} setToast={setToast} />
</Route>
<Route path="/faqs/add">
<FaqAdd />
</Route>
<Route path="/faqs/:identifier">
<FaqEdit setToast={setToast} />
</Route>
<Route path="/resources">
<Resources />
</Route>
<Route path="/register">
<Register setToast={setToast} />
</Route>
<Route path="/confirm/:token">
<ConfirmEmail setToast={setToast} />
</Route>
<Route path="/login/:email?">
<Login user={user} setUser={onLogin} setToast={setToast} />
</Route>
<Route path="/forgotpassword/:email?">
<ForgotPassword setToast={setToast} />
</Route>
<Route path="/resetPassword/:token">
<ResetPassword setToast={setToast} />
</Route>
<Route path="/donate">
{tenantId === 6 ? (
<DonateSB />
) : tenantId === 5 ? (
<DonateMCK />
) : tenantId === 4 ? (
<DonatePDX />
) : tenantId === 3 ? (
<DonateHI />
) : tenantId === 2 ? (
<DonateCA />
) : (
<Donate />
)}
</Route>
<Route path="/about">
{tenantId === 6 ? (
<AboutSB />
) : tenantId === 5 ? (
<AboutMCK />
) : tenantId === 4 ? (
<AboutPDX />
) : tenantId === 3 ? (
<AboutHI />
) : tenantId === 2 ? (
<AboutCA />
) : (
<About />
)}
</Route>
<Route exact path="/faqs">
{tenantId === 6 ? (
<FaqSB />
) : tenantId === 5 ? (
<FaqMCK />
) : tenantId === 4 ? (
<FaqPDX />
) : tenantId === 3 ? (
<FaqHI />
) : tenantId === 2 ? (
<FaqCA />
) : (
<Faq />
)}
</Route>
</Switch>
<Toast toast={toast} setToast={setToast} />
</Grid>
</Router>
</ThemeProvider>
</OriginCoordinatesContext.Provider>
</UserContext.Provider>
);
}
Expand Down
Loading

0 comments on commit 84378b7

Please sign in to comment.