Skip to content

Commit 0659a10

Browse files
sai6855michaldudak
authored andcommitted
1 parent 9f7ed5c commit 0659a10

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

packages/mui-material/src/Typography/typography.spec.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
import * as React from 'react';
2-
import { Typography } from '@mui/material';
2+
import { Typography, TypographyProps } from '@mui/material';
33

44
const typographyTest = () => {
55
const CustomComponent: React.FC<{ prop1: string; prop2: number }> = function CustomComponent() {
66
return <div />;
77
};
8+
9+
const CustomComponent2 = ({
10+
maxLines,
11+
...props
12+
}: TypographyProps & {
13+
maxLines?: number;
14+
}): JSX.Element => {
15+
return (
16+
<Typography
17+
{...props}
18+
sx={{
19+
display: maxLines === 0 ? 'block' : '-webkit-box',
20+
}}
21+
/>
22+
);
23+
};
24+
825
return (
926
<div>
1027
<Typography />
28+
<CustomComponent2 component="span" />
29+
<CustomComponent2 component="div" />
1130
<Typography align="inherit" color="inherit" display="block" />
1231
<Typography align="left" color="initial" display="inline" />
1332
<Typography align="right" color="primary" display="initial" />

0 commit comments

Comments
 (0)