@@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom';
44import { QueryContext } from '../context/QueryContext' ;
55import { HealthContext } from '../context/HealthContext' ;
66import { EventContext } from '../context/EventContext' ;
7- import { DataGrid } from '@mui/x-data-grid' ;
7+ import { GridColDef , DataGrid } from '@mui/x-data-grid' ;
88import { GridToolbar } from '@mui/x-data-grid/components' ;
99import * as DashboardContext from '../context/DashboardContext' ;
1010import lightAndDark from './Styling' ;
@@ -37,6 +37,7 @@ const TransferColumns = React.memo(() => {
3737 const { savedMetrics } = useContext ( ApplicationContext )
3838
3939 const currentMode = mode === 'light' ? lightAndDark . lightModeText : lightAndDark . darkModeText ;
40+ const currentStyle = mode === 'light' ? lightAndDark . lightModeData : lightAndDark . darkModeData ;
4041
4142 useEffect ( ( ) => {
4243 if ( healthData ) {
@@ -157,22 +158,25 @@ const TransferColumns = React.memo(() => {
157158 } ;
158159
159160 // makes the column titles for the selection grid
160- const columns = [
161- { field : 'id' , headerName : 'ID' , flex : 1 } ,
161+ const columns : GridColDef [ ] = [
162+ { field : 'id' , headerName : 'ID' , flex : 1 , headerClassName : 'style' , } ,
162163 {
163164 field : 'tag' ,
164165 headerName : 'Category' ,
165166 flex : 1 ,
166167 editable : true ,
168+ headerClassName : 'style' ,
167169 } ,
168170 {
169171 field : 'title' ,
170172 headerName : 'Metric' ,
171173 flex : 3 ,
172174 editable : true ,
175+ headerClassName : 'style' ,
173176 } ,
174177 ] ;
175178
179+ // makes the rows needed for the selection grid
176180 const rows :any [ ] = [ ]
177181 let id = 0
178182 for ( let savedMetric of Object . keys ( savedMetrics ) ) {
@@ -219,9 +223,10 @@ const TransferColumns = React.memo(() => {
219223 < div style = { { height : '500px' , width : '100%' } } >
220224
221225 < DataGrid
222- style = { currentMode }
226+ // style={currentStyle }
223227 rows = { rows }
224228 columns = { columns }
229+ style = { currentStyle }
225230 slots = { { toolbar : GridToolbar } }
226231 slotProps = { {
227232 toolbar : {
@@ -240,15 +245,15 @@ const TransferColumns = React.memo(() => {
240245 setTargetKeys ( metrics ) ;
241246 } }
242247
243- />
248+ />
244249
245250 </ div >
246251 { selectedRows . length > 0 && (
247252 < h3
248253 style = { {
249- marginTop : '20px' ,
250- color : currentMode . color
251- } }
254+ marginTop : '20px' ,
255+ color : 'currentStyle'
256+ } }
252257 >
253258 Selected Rows:
254259 </ h3 >
0 commit comments