|
8 | 8 | Legend, |
9 | 9 | LabelList, |
10 | 10 | ResponsiveContainer, |
11 | | - CartesianGrid, |
12 | 11 | } from 'recharts'; |
13 | 12 | import Select from 'react-select'; |
14 | 13 | import DatePicker from 'react-datepicker'; |
@@ -142,39 +141,38 @@ function InjuryCategoryBarChart() { |
142 | 141 | '#38BDF8', // cyan |
143 | 142 | ]; |
144 | 143 |
|
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 | + // : {}; |
175 | 173 |
|
176 | 174 | return ( |
177 | | - <div className={`injury-chart-container ${darkMode ? 'darkMode' : ''}`}> |
| 175 | + <div className={`injury-chart-container ${darkMode && 'darkMode'}`}> |
178 | 176 | <div className="injury-chart-header"> |
179 | 177 | <h3 className="injury-chart-title">Injury Severity by Category of Worker Injured</h3> |
180 | 178 |
|
@@ -298,7 +296,6 @@ function InjuryCategoryBarChart() { |
298 | 296 | backgroundColor: darkMode ? '#2b3e59' : '#fff', |
299 | 297 | border: `1px solid ${darkMode ? '#4a5568' : '#cccccc'}`, |
300 | 298 | color: darkMode ? '#fff' : '#000', |
301 | | - border: 'none', |
302 | 299 | }} |
303 | 300 | labelStyle={{ |
304 | 301 | color: darkMode ? '#fff' : '#000', |
|
0 commit comments