Skip to content

Commit be569ba

Browse files
sonar issues fixed
1 parent 323a2c4 commit be569ba

1 file changed

Lines changed: 30 additions & 33 deletions

File tree

src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.jsx

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
Legend,
99
LabelList,
1010
ResponsiveContainer,
11-
CartesianGrid,
1211
} from 'recharts';
1312
import Select from 'react-select';
1413
import DatePicker from 'react-datepicker';
@@ -142,39 +141,38 @@ function InjuryCategoryBarChart() {
142141
'#38BDF8', // cyan
143142
];
144143

145-
const selectStyles = darkMode
146-
? {
147-
control: base => ({
148-
...base,
149-
backgroundColor: '#2b3e59',
150-
color: 'white',
151-
}),
152-
menu: base => ({
153-
...base,
154-
backgroundColor: '#2b3e59',
155-
color: 'white',
156-
}),
157-
option: (base, state) => ({
158-
...base,
159-
color: 'white',
160-
backgroundColor: state.isSelected
161-
? 'rgba(255, 255, 255, 0.15)'
162-
: state.isFocused
163-
? 'rgba(255, 255, 255, 0.1)'
164-
: 'transparent',
165-
'&:active': {
166-
backgroundColor: 'rgba(255, 255, 255, 0.2)',
167-
},
168-
}),
169-
singleValue: base => ({
170-
...base,
171-
color: 'white',
172-
}),
173-
}
174-
: {};
144+
const selectStyles = darkMode && {
145+
control: base => ({
146+
...base,
147+
backgroundColor: '#2b3e59',
148+
color: 'white',
149+
}),
150+
menu: base => ({
151+
...base,
152+
backgroundColor: '#2b3e59',
153+
color: 'white',
154+
}),
155+
option: (base, state) => ({
156+
...base,
157+
color: 'white',
158+
backgroundColor: state.isSelected
159+
? 'rgba(255, 255, 255, 0.15)'
160+
: state.isFocused
161+
? 'rgba(255, 255, 255, 0.1)'
162+
: 'transparent',
163+
'&:active': {
164+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
165+
},
166+
}),
167+
singleValue: base => ({
168+
...base,
169+
color: 'white',
170+
}),
171+
};
172+
// : {};
175173

176174
return (
177-
<div className={`injury-chart-container ${darkMode ? 'darkMode' : ''}`}>
175+
<div className={`injury-chart-container ${darkMode && 'darkMode'}`}>
178176
<div className="injury-chart-header">
179177
<h3 className="injury-chart-title">Injury Severity by Category of Worker Injured</h3>
180178

@@ -298,7 +296,6 @@ function InjuryCategoryBarChart() {
298296
backgroundColor: darkMode ? '#2b3e59' : '#fff',
299297
border: `1px solid ${darkMode ? '#4a5568' : '#cccccc'}`,
300298
color: darkMode ? '#fff' : '#000',
301-
border: 'none',
302299
}}
303300
labelStyle={{
304301
color: darkMode ? '#fff' : '#000',

0 commit comments

Comments
 (0)