From 3c82e5ab22dd67a08041d0fdc4801c15719a3170 Mon Sep 17 00:00:00 2001 From: Miles Thompson Date: Fri, 22 May 2020 14:39:22 +1200 Subject: [PATCH 1/2] Switch 'prefered' to 'suggested'. Spelling fix but also Im just taking an executive decision on this one instead of opening a long slack thread - 'suggested' much more generic than 'prefered'. --- src/app/component/MissionComponent/MissionCard.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/component/MissionComponent/MissionCard.jsx b/src/app/component/MissionComponent/MissionCard.jsx index e7d97b54..db08fe87 100644 --- a/src/app/component/MissionComponent/MissionCard.jsx +++ b/src/app/component/MissionComponent/MissionCard.jsx @@ -231,7 +231,7 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => { - You are the prefer volunteer! + You are the suggested volunteer! No Thanks @@ -244,7 +244,7 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => { - Prefered volunteer:
+ Suggested volunteer:
{mission.tentativeVolunteerDisplayName}
From 708b5ef182dca937abc4db3cea3a8b3b0576fd56 Mon Sep 17 00:00:00 2001 From: Miles Thompson Date: Fri, 22 May 2020 15:14:16 +1200 Subject: [PATCH 2/2] Tidy up code to remove all warnings. Sometimes had to make some hard decisions but if it looks like people may want to reuse this code soon used comments instead of outright delete --- .../MissionComponent/MissionCard.jsx | 13 ++- .../MissionComponent/MissionList.jsx | 6 +- .../dashboard/Missions/MissionEditView.jsx | 80 +++++++++---------- .../NavigationDrawer/NavigationDrawer.js | 1 - src/app/page/Home/Home.js | 2 +- src/app/page/Home/VolunteerHome.jsx | 1 - src/app/page/Recipient/Dashboard.jsx | 2 +- src/app/page/Request/foodbox/ConfirmStep.jsx | 2 +- src/app/page/Signup/SignupScene.jsx | 1 - 9 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/app/component/MissionComponent/MissionCard.jsx b/src/app/component/MissionComponent/MissionCard.jsx index db08fe87..70b7fa5f 100644 --- a/src/app/component/MissionComponent/MissionCard.jsx +++ b/src/app/component/MissionComponent/MissionCard.jsx @@ -152,6 +152,14 @@ const styles = (theme) => ({ borderColor: theme.color.lightgrey, padding: theme.spacing(1), }, + secondaryButton: { + color: "red", + fontWeight: "normal", + fontStyle: "italic", + fontSize: "0.6rem", + padding: "0", + textDecoration: "underline", + }, }); /** @@ -180,7 +188,6 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => { const onCloseModal = () => setModalOpen(false); const primaryButtonProps = { variant: "contained", color: "primary", fullWidth: true }; - const secondaryButtonProps = { color: "secondary", fullWidth: true }; const ActionButtons = () => ( @@ -232,7 +239,9 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => { You are the suggested volunteer! - No Thanks + diff --git a/src/app/component/MissionComponent/MissionList.jsx b/src/app/component/MissionComponent/MissionList.jsx index c127393f..67c60663 100644 --- a/src/app/component/MissionComponent/MissionList.jsx +++ b/src/app/component/MissionComponent/MissionList.jsx @@ -1,4 +1,4 @@ -import { Button, CircularProgress } from "@material-ui/core"; +import { CircularProgress } from "@material-ui/core"; import PropTypes from "prop-types"; import React from "react"; import styled from "styled-components"; @@ -11,10 +11,6 @@ import MissionCard from "./MissionCard"; * @param {array} missions - Mission objects to display * */ -const StyledButton = styled(Button)` - flex-grow: 1; -`; - const MissionListContainer = styled.div` width: 100%; `; diff --git a/src/app/dashboard/Missions/MissionEditView.jsx b/src/app/dashboard/Missions/MissionEditView.jsx index 97902393..4ce85258 100644 --- a/src/app/dashboard/Missions/MissionEditView.jsx +++ b/src/app/dashboard/Missions/MissionEditView.jsx @@ -1,9 +1,7 @@ import { Box, Container, Grid, Paper, TextField } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; import ArrowBackIcon from "@material-ui/icons/ArrowBack"; -import AttachMoneyIcon from "@material-ui/icons/AttachMoney"; import LocationOnIcon from "@material-ui/icons/LocationOn"; -import PanToolIcon from "@material-ui/icons/PanTool"; import CancelIcon from "@material-ui/icons/Cancel"; import PersonIcon from "@material-ui/icons/Person"; import React, { useState } from "react"; @@ -12,7 +10,6 @@ import { Button, Body2, H3 } from "../../component"; import DateTimeInput from "../../component/DateTimeInput"; import ScheduleIcon from "@material-ui/icons/Schedule"; import { Mission } from "../../model"; -import _ from "../../utils/lodash"; import AddressInput from "../../component/AddressInput"; import { useForm } from "../../hooks"; @@ -134,43 +131,44 @@ const MissionTypeRow = ({ classes, mission }) => { ); }; -const MissionStatusRow = ({ classes, mission }) => { - let status = mission?.status; - let missionStatusText; - switch (status) { - case Mission.Status.unassigned: - missionStatusText = "Looking for volunteer"; - break; - default: - missionStatusText = status; - break; - } - return ( - - {missionStatusText} - - ); -}; -const MissionFundedStatusRow = ({ classes, mission }) => { - let missionFundedStatusText; - switch (mission?.fundedStatus) { - case Mission.FundedStatus.fundedbydonation: - missionFundedStatusText = "Funded By Donation"; - break; - case Mission.FundedStatus.fundedbyrecipient: - missionFundedStatusText = "Funded By Recipient"; - break; - case Mission.FundedStatus.notfunded: - default: - missionFundedStatusText = "Not Yet Funded"; - } - return ( - - {missionFundedStatusText} - - ); -}; +// const MissionStatusRow = ({ classes, mission }) => { +// let status = mission?.status; +// let missionStatusText; +// switch (status) { +// case Mission.Status.unassigned: +// missionStatusText = "Looking for volunteer"; +// break; +// default: +// missionStatusText = status; +// break; +// } +// return ( +// +// {missionStatusText} +// +// ); +// }; + +// const MissionFundedStatusRow = ({ classes, mission }) => { +// let missionFundedStatusText; +// switch (mission?.fundedStatus) { +// case Mission.FundedStatus.fundedbydonation: +// missionFundedStatusText = "Funded By Donation"; +// break; +// case Mission.FundedStatus.fundedbyrecipient: +// missionFundedStatusText = "Funded By Recipient"; +// break; +// case Mission.FundedStatus.notfunded: +// default: +// missionFundedStatusText = "Not Yet Funded"; +// } +// return ( +// +// {missionFundedStatusText} +// +// ); +// }; const FoodBoxDetailsRow = ({ details }) => { return ( @@ -201,12 +199,12 @@ const MissionEditView = ({ mission, toDetailsView, toListView }) => { const classes = useStyles(); const { handleChange, values } = useForm(mission); - const [pickUp, setPickUp] = React.useState({ + const [pickUp, setPickUp] = useState({ time: new Date(), date: values.pickUpWindow.startTime, location: "", }); - const [deliveryTime, setDeliveryTime] = React.useState({ + const [deliveryTime, setDeliveryTime] = useState({ time: new Date(), date: values.deliveryWindow.startTime, location: "", diff --git a/src/app/layout/NavigationDrawer/NavigationDrawer.js b/src/app/layout/NavigationDrawer/NavigationDrawer.js index 4e7cee06..dbdcbb28 100644 --- a/src/app/layout/NavigationDrawer/NavigationDrawer.js +++ b/src/app/layout/NavigationDrawer/NavigationDrawer.js @@ -13,7 +13,6 @@ import DashboardIcon from "@material-ui/icons/Dashboard"; import DoubleArrowIcon from "@material-ui/icons/DoubleArrow"; import ExitToApp from "@material-ui/icons/ExitToApp"; import MenuIcon from "@material-ui/icons/Menu"; -import MoveToInboxIcon from "@material-ui/icons/MoveToInbox"; import FavoriteIcon from "@material-ui/icons/Favorite"; import PeopleIcon from "@material-ui/icons/People"; import clsx from "clsx"; diff --git a/src/app/page/Home/Home.js b/src/app/page/Home/Home.js index 6a8b7ad0..5920c45b 100644 --- a/src/app/page/Home/Home.js +++ b/src/app/page/Home/Home.js @@ -21,7 +21,7 @@ import { User, useOrganization } from "../../model"; import Mission from "../../model/Mission"; import { routes } from "../../routing"; import { useFirestoreConnect } from "react-redux-firebase"; -import FoodBoxDeliveryIcon from "../../component/icons/FoodBoxDeliveryIcon"; +//import FoodBoxDeliveryIcon from "../../component/icons/FoodBoxDeliveryIcon"; import EventNoteIcon from "@material-ui/icons/EventNote"; import LocalPharmacyIcon from "@material-ui/icons/LocalPharmacy"; diff --git a/src/app/page/Home/VolunteerHome.jsx b/src/app/page/Home/VolunteerHome.jsx index 6937caba..38a133c1 100644 --- a/src/app/page/Home/VolunteerHome.jsx +++ b/src/app/page/Home/VolunteerHome.jsx @@ -8,7 +8,6 @@ import MuiPlayCircleFilledIcon from "@material-ui/icons/PlayCircleFilled"; import { useOrganization } from "../../model"; import Mission from "../../model/Mission"; -import User from "../../model/User"; import { getAllAvailableMissions, diff --git a/src/app/page/Recipient/Dashboard.jsx b/src/app/page/Recipient/Dashboard.jsx index e319ffbd..96668994 100644 --- a/src/app/page/Recipient/Dashboard.jsx +++ b/src/app/page/Recipient/Dashboard.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import { Typography, Box, Button, makeStyles, Tabs, Tab } from "@material-ui/core"; import { Add } from "@material-ui/icons"; -import { Link, useLocation, Redirect, Switch, Route } from "react-router-dom"; +import { Link, useLocation, Redirect, Switch } from "react-router-dom"; import { useSelector } from "react-redux"; import { Page } from "../../layout"; diff --git a/src/app/page/Request/foodbox/ConfirmStep.jsx b/src/app/page/Request/foodbox/ConfirmStep.jsx index 00b9ed85..3683cb93 100644 --- a/src/app/page/Request/foodbox/ConfirmStep.jsx +++ b/src/app/page/Request/foodbox/ConfirmStep.jsx @@ -90,7 +90,7 @@ function ConfirmStep({ dispatch, state }) { }; } try { - const createdMission = await Mission.create(mission); + await Mission.create(mission); const redirect = isDonationRequest ? routes.request.success.donation : routes.request.success.payment; diff --git a/src/app/page/Signup/SignupScene.jsx b/src/app/page/Signup/SignupScene.jsx index 5c9ea497..552d7fd8 100644 --- a/src/app/page/Signup/SignupScene.jsx +++ b/src/app/page/Signup/SignupScene.jsx @@ -29,7 +29,6 @@ function SignupScene(props) { const { handleChange, setValues, values } = useForm(User.defaultData); const [activeTab, setActiveTab] = useState(Tabs.GET_STARTED); const [errorSnackbarMessage, setErrorSnackbarMessage] = useState(false); - const [loading, setLoading] = useState(false); const org = useOrganization(); function getPayload() {