@@ -3,7 +3,7 @@ import { useParams } from 'react-router-dom';
33import { QueryContext } from '../context/QueryContext' ;
44import { HealthContext } from '../context/HealthContext' ;
55import { EventContext } from '../context/EventContext' ;
6- import { DataGrid } from '@mui/x-data-grid' ;
6+ import { GridColDef , DataGrid } from '@mui/x-data-grid' ;
77import { GridToolbar } from '@mui/x-data-grid/components' ;
88import * as DashboardContext from '../context/DashboardContext' ;
99import lightAndDark from './Styling' ;
@@ -32,6 +32,7 @@ const TransferColumns = React.memo(() => {
3232 const [ searchTerm , setSearchTerm ] = useState < string > ( '' ) ;
3333
3434 const currentMode = mode === 'light' ? lightAndDark . lightModeText : lightAndDark . darkModeText ;
35+ const currentStyle = mode === 'light' ? lightAndDark . lightModeData : lightAndDark . darkModeData ;
3536
3637 useEffect ( ( ) => {
3738 if ( healthData ) {
@@ -150,19 +151,21 @@ const TransferColumns = React.memo(() => {
150151 } ;
151152
152153 // makes the column titles for the selection grid
153- const columns = [
154- { field : 'id' , headerName : 'ID' , flex : 1 } ,
154+ const columns : GridColDef [ ] = [
155+ { field : 'id' , headerName : 'ID' , flex : 1 , headerClassName : 'style' , } ,
155156 {
156157 field : 'tag' ,
157158 headerName : 'Category' ,
158159 flex : 1 ,
159160 editable : true ,
161+ headerClassName : 'style' ,
160162 } ,
161163 {
162164 field : 'title' ,
163165 headerName : 'Metric' ,
164166 flex : 3 ,
165167 editable : true ,
168+ headerClassName : 'style' ,
166169 } ,
167170 ] ;
168171
@@ -203,7 +206,7 @@ const TransferColumns = React.memo(() => {
203206 < div style = { { height : '500px' , width : '100%' } } >
204207
205208 < DataGrid
206- style = { currentMode }
209+ style = { currentStyle }
207210 rows = { rows }
208211 columns = { columns }
209212 slots = { { toolbar : GridToolbar } }
@@ -227,7 +230,7 @@ const TransferColumns = React.memo(() => {
227230
228231 </ div >
229232 { selectedRows . length > 0 && (
230- < h3 style = { { marginTop : '20px' , color : currentMode . color } } > Selected Rows:</ h3 >
233+ < h3 style = { { marginTop : '20px' , color : currentStyle . color } } > Selected Rows:</ h3 >
231234 ) }
232235 < ol id = "selectedRows" > { selectedRows } </ ol >
233236 </ div >
0 commit comments