Skip to content

Commit ce92828

Browse files
committed
fixed missing function invocation, added BarGraphComparisonProps typescript to BarGraphComparison.tsx
1 parent 7b3c383 commit ce92828

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/app/components/BarGraph.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ interface BarGraphProps {
4848
height: number,
4949
data: Record<string, unknown>,
5050
comparison: unknown,
51-
setRoute: unknown,
51+
setRoute: () => void,
5252
allRoutes: unknown,
5353
filteredSnapshots: unknown,
5454
snapshot: unknown,
55-
setSnapshot: unknown
55+
setSnapshot: () => void
5656
}
5757

5858
/* DEFAULTS */

src/app/components/BarGraphComparison.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ interface TooltipData {
4545
color: string;
4646
}
4747

48+
interface BarGraphComparisonProps {
49+
width: number,
50+
height: number,
51+
data: Record<string, unknown>,
52+
comparison: string | [],
53+
setSeries: () => void,
54+
series: unknown,
55+
setAction: () => void,
56+
}
57+
4858
/* DEFAULTS */
4959
const margin = {
5060
top: 30, right: 30, bottom: 0, left: 50,
@@ -61,10 +71,10 @@ const tooltipStyles = {
6171
fontFamily: 'Roboto',
6272
};
6373

64-
const BarGraphComparison = props => {
74+
const BarGraphComparison = (props: BarGraphComparisonProps): unknown => {
6575
const [{ tabs, currentTab }, dispatch] = useStoreContext();
6676
const {
67-
width, height, data, comparison, setSeries, series, setAction
77+
width, height, data, comparison, setSeries, series, setAction,
6878
} = props;
6979
const [snapshots] = React.useState(0);
7080
const [open, setOpen] = React.useState(false);
@@ -201,7 +211,7 @@ const BarGraphComparison = props => {
201211
return data.barStack;
202212
}
203213
const animateButton = e => {
204-
e.preventDefault;
214+
e.preventDefault();
205215
e.target.classList.add('animate');
206216
e.target.innerHTML = 'Deleted!';
207217
setTimeout(() => {

0 commit comments

Comments
 (0)