Skip to content

Commit

Permalink
fix: bugs in reporting card
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Dec 18, 2021
1 parent 970accb commit 243d498
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import MenuItem from '@material-ui/core/MenuItem';
import MenuMui from '@material-ui/core/Menu';
import moment from 'moment';
import axios from 'axios';
import log from 'loglevel';

/**
* @function
Expand Down Expand Up @@ -62,9 +63,9 @@ function Home(props) {
}, []);
const timeRange = [
{ range: 30, text: 'Last Month' },
{ range: 30 * 60, text: 'Last 6 Months' },
{ range: 356, text: 'Last Year' },
{ range: 356 * 50, text: 'All' },
{ range: 30 * 6, text: 'Last 6 Months' },
{ range: 365, text: 'Last Year' },
{ range: 365 * 100, text: 'All' },
];
const [timeRangeIndex, setTimeRangeIndex] = React.useState(3);
const [startDate, setStartDate] = React.useState(
Expand All @@ -80,7 +81,9 @@ function Home(props) {
};

const handleTimeClose = (index) => {
log.warn("index: ", index);
setAnchorEl(null);
if(isNaN(index)) return;
setTimeRangeIndex(index);
setStartDate(
moment()
Expand Down
2 changes: 1 addition & 1 deletion src/components/reportingCards/ReportingCard4.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function component(props) {
return (
<ReportingCard
text={{
title: 'Top Planters',
title: 'Top Growers',
text1: 'Average',
}}
icon={Icon}
Expand Down
2 changes: 1 addition & 1 deletion src/components/reportingCards/ReportingCard6.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function component(props) {
return (
<ReportingCard
text={{
title: 'Average captures per planter per organization',
title: 'Average captures per grower per organization',
text1: 'Average',
}}
icon={Icon}
Expand Down

0 comments on commit 243d498

Please sign in to comment.