Skip to content

Commit 5a47ea8

Browse files
Update BarGraphComparison.tsx
deleted duplicate code
1 parent 5160c30 commit 5a47ea8

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

src/app/components/StateRoute/PerformanceVisx/BarGraphComparison.tsx

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// <reference lib="dom" />
33
/* eslint-disable no-param-reassign */
44
import React, { useEffect, useState } from 'react';
5-
import React, { useEffect, useState } from 'react';
5+
66
import { BarStack } from '@visx/shape';
77
import { Group } from '@visx/group';
88
import { Grid } from '@visx/grid';
@@ -53,18 +53,10 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
5353
const { width, height, data, comparison, setSeries, series, setAction } = props;
5454
const [snapshots] = useState(0);
5555
const [open, setOpen] = useState(false);
56-
const [picOpen, setPicOpen] = useState(false);
57-
//tracking whether or not the clear series button is clicked
58-
const [buttonLoad, setButtonLoad] = useState(false);
59-
56+
const [picOpen, setPicOpen] = useState(false);
57+
const [buttonLoad, setButtonLoad] = useState(false); //tracking whether or not the clear series button is clicked
6058
const theme = useTheme();
61-
const [snapshots] = useState(0);
62-
const [open, setOpen] = useState(false);
63-
const [picOpen, setPicOpen] = useState(false);
64-
//tracking whether or not the clear series button is clicked
65-
const [buttonLoad, setButtonLoad] = useState(false);
6659

67-
const theme = useTheme();
6860
useEffect(() => {
6961
dispatch(setCurrentTabInApp('performance-comparison'));
7062
}, [dispatch]);
@@ -206,11 +198,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
206198
<div>
207199
<div className='series-options-container'>
208200
<div className='dropdown-and-delete-series-container'>
209-
<Button
210-
variant='contained'
211-
sx={{ p: 2, color: 'white' }}
212-
// type='button'
213-
>
201+
214202
<Button
215203
variant='contained'
216204
sx={{ p: 2, color: 'white' }}
@@ -224,21 +212,13 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
224212
setTimeout(() => {
225213
setButtonLoad(false);
226214
}, 1000);
227-
228-
setTimeout(() => {
229-
setButtonLoad(false);
230-
}, 1000);
231215
}}
232-
style={
233-
buttonLoad
234-
? { backgroundColor: theme.palette.primary.main }
216+
style={ buttonLoad ? { backgroundColor: theme.palette.primary.main }
235217
: { backgroundColor: theme.palette.secondary.main }
236-
}
237-
>
238-
{buttonLoad ? 'Deleted' : 'Clear Series'}
239-
</Button>
218+
}>
240219
{buttonLoad ? 'Deleted' : 'Clear Series'}
241220
</Button>
221+
242222
<h4 className='compare-series-box' style={{ padding: '0 1rem' }}>
243223
Compare Series:{' '}
244224
</h4>

0 commit comments

Comments
 (0)