Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all those warnings #615

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/app/component/MissionComponent/MissionCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
});

/**
Expand Down Expand Up @@ -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 = () => (
<Grid container direction="row-reverse" className={classes.actionButtons}>
Expand Down Expand Up @@ -231,8 +238,10 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => {
</Box>
<Box display="flex" alignItems="center">
<Box>
You are the prefer volunteer!
<a onClick={unassignMeFromMission}>No Thanks</a>
You are the suggested volunteer!
<Button className={classes.secondaryButton} onClick={unassignMeFromMission}>
No Thanks
</Button>
</Box>
</Box>
</Grid>
Expand All @@ -244,7 +253,7 @@ const MissionCard = withStyles(styles)(({ classes, mission }) => {
</Box>
<Box display="flex" alignItems="center">
<Box>
Prefered volunteer: <br />
Suggested volunteer: <br />
<b>{mission.tentativeVolunteerDisplayName}</b>
</Box>
</Box>
Expand Down
6 changes: 1 addition & 5 deletions src/app/component/MissionComponent/MissionList.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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%;
`;
Expand Down
80 changes: 39 additions & 41 deletions src/app/dashboard/Missions/MissionEditView.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";

Expand Down Expand Up @@ -134,43 +131,44 @@ const MissionTypeRow = ({ classes, mission }) => {
</Box>
);
};
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 (
<Row Icon={PanToolIcon} classes={classes}>
{missionStatusText}
</Row>
);
};

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 (
<Row Icon={AttachMoneyIcon} classes={classes}>
{missionFundedStatusText}
</Row>
);
};
// const MissionStatusRow = ({ classes, mission }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used anymore? Should it just be removed?

// let status = mission?.status;
// let missionStatusText;
// switch (status) {
// case Mission.Status.unassigned:
// missionStatusText = "Looking for volunteer";
// break;
// default:
// missionStatusText = status;
// break;
// }
// return (
// <Row Icon={PanToolIcon} classes={classes}>
// {missionStatusText}
// </Row>
// );
// };

// 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 (
// <Row Icon={AttachMoneyIcon} classes={classes}>
// {missionFundedStatusText}
// </Row>
// );
// };

const FoodBoxDetailsRow = ({ details }) => {
return (
Expand Down Expand Up @@ -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: "",
Expand Down
1 change: 0 additions & 1 deletion src/app/layout/NavigationDrawer/NavigationDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest master uses this icon so need to add back

import FavoriteIcon from "@material-ui/icons/Favorite";
import PeopleIcon from "@material-ui/icons/People";
import clsx from "clsx";
Expand Down
2 changes: 1 addition & 1 deletion src/app/page/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just delete?

import EventNoteIcon from "@material-ui/icons/EventNote";
import LocalPharmacyIcon from "@material-ui/icons/LocalPharmacy";

Expand Down
1 change: 0 additions & 1 deletion src/app/page/Home/VolunteerHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/app/page/Recipient/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/app/page/Request/foodbox/ConfirmStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/app/page/Signup/SignupScene.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down