Skip to content

Commit b2afa56

Browse files
Check styles declaration against MUI Theme with TypeScript (#133)
1 parent 9a529ef commit b2afa56

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/components/App/PageNotFound.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import Container from '@mui/material/Container';
8+
import { Container } from '@mui/material';
99
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
1010
import { ReactNode } from 'react';
11+
import { type MuiStyles } from '@gridsuite/commons-ui';
1112

1213
const styles = {
1314
error: {
@@ -18,7 +19,7 @@ const styles = {
1819
container: {
1920
marginTop: '70px',
2021
},
21-
};
22+
} as const as MuiStyles;
2223

2324
const PageNotFound = ({ message }: { message: ReactNode }) => {
2425
return (

src/components/Grid/AgGrid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
useRef,
1818
} from 'react';
1919
import { AgGridReact } from 'ag-grid-react';
20-
import { CustomAGGrid, type CustomAGGridProps } from '@gridsuite/commons-ui';
20+
import { CustomAGGrid, type CustomAGGridProps, type SxStyle } from '@gridsuite/commons-ui';
2121
import { useDebugRender } from '../../utils/hooks';
2222

2323
type AccessibleAgGridReact<TData> = Omit<
@@ -50,7 +50,7 @@ const style = {
5050
'@media print': {
5151
pageBreakInside: 'avoid',
5252
},
53-
};
53+
} as const satisfies SxStyle;
5454

5555
// TODO move type generic restoration to commons-ui
5656
// TODO move useDebug feature from env to commons-ui

src/pages/common/multi-chip-cell-renderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import React, { useRef, useState, useEffect } from 'react';
99
import { Chip, Grid, Tooltip } from '@mui/material';
10-
import { mergeSx } from '@gridsuite/commons-ui';
10+
import { mergeSx, type MuiStyles } from '@gridsuite/commons-ui';
1111

1212
const maxChipWidth = 100;
1313
const counterChipWidth = 25;
@@ -23,7 +23,7 @@ const chipStyles = {
2323
fontWeight: 'bold',
2424
},
2525
},
26-
};
26+
} as const satisfies MuiStyles;
2727

2828
export interface MultiChipCellRendererProps {
2929
value: string[];

0 commit comments

Comments
 (0)