Skip to content

Commit 8af02ea

Browse files
committed
Fix warnings and remove deepmerge where not needed.
1 parent b2e1a50 commit 8af02ea

18 files changed

+37
-52
lines changed

packages/ra-ui-materialui/src/input/BooleanInput.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,6 @@ describe('<BooleanInput />', () => {
189189

190190
it('should be customized by a theme', async () => {
191191
render(<Themed />);
192-
const input = await screen.findByTestId('themed');
192+
await screen.findByTestId('themed');
193193
});
194194
});

packages/ra-ui-materialui/src/input/BooleanInput.stories.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ import polyglotI18nProvider from 'ra-i18n-polyglot';
33
import englishMessages from 'ra-language-english';
44
import { useFormContext } from 'react-hook-form';
55
import FavoriteIcon from '@mui/icons-material/Favorite';
6+
import { createTheme } from '@mui/material/styles';
67

78
import { AdminContext } from '../AdminContext';
89
import { Create } from '../detail';
910
import { SimpleForm } from '../form';
1011
import { BooleanInput } from './BooleanInput';
1112
import { TextInput } from './TextInput';
12-
import { deepmerge } from '@mui/utils';
13-
import { createTheme } from '@mui/material/styles';
14-
import { ThemeOptions } from '@mui/material';
1513

1614
export default { title: 'ra-ui-materialui/input/BooleanInput' };
1715

@@ -80,20 +78,20 @@ export const SetFocus = () => (
8078

8179
export const Themed = () => (
8280
<Wrapper
83-
theme={deepmerge(createTheme(), {
81+
theme={createTheme({
8482
components: {
8583
RaBooleanInput: {
8684
defaultProps: {
8785
'data-testid': 'themed',
88-
},
86+
} as any,
8987
styleOverrides: {
9088
root: {
9189
color: 'red',
9290
},
9391
},
9492
},
9593
},
96-
} as ThemeOptions)}
94+
})}
9795
>
9896
<BooleanInput source="published" />
9997
</Wrapper>

packages/ra-ui-materialui/src/input/DatagridInput.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import { Themed } from './DatagridInput.stories';
66
describe('<DatagridInput />', () => {
77
it('should be customized by a theme', async () => {
88
render(<Themed />);
9-
const input = await screen.findByTestId('themed');
9+
await screen.findByTestId('themed');
1010
});
1111
});

packages/ra-ui-materialui/src/input/DatagridInput.stories.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as React from 'react';
22
import { Admin } from 'react-admin';
33
import { Resource, TestMemoryRouter } from 'ra-core';
4-
import { deepmerge } from '@mui/utils';
5-
import { createTheme, ThemeOptions } from '@mui/material/styles';
4+
import { createTheme } from '@mui/material/styles';
65

76
import { Edit } from '../detail';
87
import { SimpleForm } from '../form';
@@ -164,12 +163,12 @@ export const Themed = () => (
164163
<TestMemoryRouter initialEntries={['/books/1']}>
165164
<Admin
166165
dataProvider={dataProvider}
167-
theme={deepmerge(createTheme(), {
166+
theme={createTheme({
168167
components: {
169168
RaDatagridInput: {
170169
defaultProps: {
171170
'data-testid': 'themed',
172-
},
171+
} as any,
173172
styleOverrides: {
174173
root: {
175174
['& .MuiTypography-root']: {
@@ -180,7 +179,7 @@ export const Themed = () => (
180179
},
181180
},
182181
},
183-
} as ThemeOptions)}
182+
})}
184183
>
185184
<Resource name="books" edit={BookEdit} />
186185
</Admin>

packages/ra-ui-materialui/src/input/DateInput.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,6 @@ describe('<DateInput />', () => {
323323

324324
it('should be customized by a theme', async () => {
325325
render(<Themed />);
326-
const input = await screen.findByTestId('themed');
326+
await screen.findByTestId('themed');
327327
});
328328
});

packages/ra-ui-materialui/src/input/DateInput.stories.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { minValue, useRecordContext } from 'ra-core';
55
import { useFormContext, useWatch } from 'react-hook-form';
66
import { Box, Button, createTheme, Typography } from '@mui/material';
77
import { ThemeOptions } from '@mui/material/styles';
8-
import { deepmerge } from '@mui/utils';
98
import get from 'lodash/get';
109

1110
import { AdminContext } from '../AdminContext';
@@ -152,12 +151,12 @@ export const Themed = ({
152151
}) => (
153152
<Wrapper
154153
simpleFormProps={simpleFormProps}
155-
theme={deepmerge(createTheme(), {
154+
theme={createTheme({
156155
components: {
157156
RaDateInput: {
158157
defaultProps: {
159158
'data-testid': 'themed',
160-
},
159+
} as any,
161160
styleOverrides: {
162161
root: {
163162
['& input']: {
@@ -167,7 +166,7 @@ export const Themed = ({
167166
},
168167
},
169168
},
170-
} as ThemeOptions)}
169+
})}
171170
>
172171
<DateInput source="publishedAt" {...dateInputProps} />
173172
</Wrapper>

packages/ra-ui-materialui/src/input/DateTimeInput.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,6 @@ describe('<DateTimeInput />', () => {
332332

333333
it('should be customized by a theme', async () => {
334334
render(<Themed />);
335-
const input = await screen.findByTestId('themed');
335+
await screen.findByTestId('themed');
336336
});
337337
});

packages/ra-ui-materialui/src/input/DateTimeInput.stories.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useRecordContext } from 'ra-core';
55
import { useFormContext, useWatch } from 'react-hook-form';
66
import { Box, Button, createTheme, Typography } from '@mui/material';
77
import { ThemeOptions } from '@mui/material/styles';
8-
import { deepmerge } from '@mui/utils';
98
import get from 'lodash/get';
109

1110
import { AdminContext } from '../AdminContext';
@@ -100,12 +99,12 @@ export const AsDateObject = () => (
10099

101100
export const Themed = () => (
102101
<Wrapper
103-
theme={deepmerge(createTheme(), {
102+
theme={createTheme({
104103
components: {
105104
RaDateTimeInput: {
106105
defaultProps: {
107106
'data-testid': 'themed',
108-
},
107+
} as any,
109108
styleOverrides: {
110109
root: {
111110
['& input']: {
@@ -115,7 +114,7 @@ export const Themed = () => (
115114
},
116115
},
117116
},
118-
} as ThemeOptions)}
117+
})}
119118
>
120119
<DateTimeInput source="published" />
121120
</Wrapper>

packages/ra-ui-materialui/src/input/NumberInput.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,6 @@ describe('<NumberInput />', () => {
676676

677677
it('should be customized by a theme', async () => {
678678
render(<Themed />);
679-
const input = await screen.findByTestId('themed');
679+
await screen.findByTestId('themed');
680680
});
681681
});

packages/ra-ui-materialui/src/input/NumberInput.stories.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import * as React from 'react';
22
import { required } from 'ra-core';
33
import { useFormState, useFormContext } from 'react-hook-form';
4-
import { deepmerge } from '@mui/utils';
54
import { createTheme } from '@mui/material/styles';
6-
import { ThemeOptions } from '@mui/material';
75

86
import { NumberInput } from './NumberInput';
97
import { AdminContext } from '../AdminContext';
@@ -283,12 +281,12 @@ export const SetFocus = () => (
283281

284282
export const Themed = () => (
285283
<Wrapper
286-
theme={deepmerge(createTheme(), {
284+
theme={createTheme({
287285
components: {
288286
RaNumberInput: {
289287
defaultProps: {
290288
'data-testid': 'themed',
291-
},
289+
} as any,
292290
styleOverrides: {
293291
root: {
294292
['& input']: {
@@ -298,7 +296,7 @@ export const Themed = () => (
298296
},
299297
},
300298
},
301-
} as ThemeOptions)}
299+
})}
302300
>
303301
<NumberInput source="views" />
304302
<FormInspector name="views" />

0 commit comments

Comments
 (0)