Skip to content

Commit c6cdde8

Browse files
authored
[docs][material-ui][Menu] Replace PaperProps with slotProps.paper in demos (#43354)
1 parent b66a718 commit c6cdde8

File tree

4 files changed

+62
-54
lines changed

4 files changed

+62
-54
lines changed

docs/data/material/components/menus/AccountMenu.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,31 @@ export default function AccountMenu() {
4545
open={open}
4646
onClose={handleClose}
4747
onClick={handleClose}
48-
PaperProps={{
49-
elevation: 0,
50-
sx: {
51-
overflow: 'visible',
52-
filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
53-
mt: 1.5,
54-
'& .MuiAvatar-root': {
55-
width: 32,
56-
height: 32,
57-
ml: -0.5,
58-
mr: 1,
59-
},
60-
'&::before': {
61-
content: '""',
62-
display: 'block',
63-
position: 'absolute',
64-
top: 0,
65-
right: 14,
66-
width: 10,
67-
height: 10,
68-
bgcolor: 'background.paper',
69-
transform: 'translateY(-50%) rotate(45deg)',
70-
zIndex: 0,
48+
slotProps={{
49+
paper: {
50+
elevation: 0,
51+
sx: {
52+
overflow: 'visible',
53+
filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
54+
mt: 1.5,
55+
'& .MuiAvatar-root': {
56+
width: 32,
57+
height: 32,
58+
ml: -0.5,
59+
mr: 1,
60+
},
61+
'&::before': {
62+
content: '""',
63+
display: 'block',
64+
position: 'absolute',
65+
top: 0,
66+
right: 14,
67+
width: 10,
68+
height: 10,
69+
bgcolor: 'background.paper',
70+
transform: 'translateY(-50%) rotate(45deg)',
71+
zIndex: 0,
72+
},
7173
},
7274
},
7375
}}

docs/data/material/components/menus/AccountMenu.tsx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,31 @@ export default function AccountMenu() {
4545
open={open}
4646
onClose={handleClose}
4747
onClick={handleClose}
48-
PaperProps={{
49-
elevation: 0,
50-
sx: {
51-
overflow: 'visible',
52-
filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
53-
mt: 1.5,
54-
'& .MuiAvatar-root': {
55-
width: 32,
56-
height: 32,
57-
ml: -0.5,
58-
mr: 1,
59-
},
60-
'&::before': {
61-
content: '""',
62-
display: 'block',
63-
position: 'absolute',
64-
top: 0,
65-
right: 14,
66-
width: 10,
67-
height: 10,
68-
bgcolor: 'background.paper',
69-
transform: 'translateY(-50%) rotate(45deg)',
70-
zIndex: 0,
48+
slotProps={{
49+
paper: {
50+
elevation: 0,
51+
sx: {
52+
overflow: 'visible',
53+
filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
54+
mt: 1.5,
55+
'& .MuiAvatar-root': {
56+
width: 32,
57+
height: 32,
58+
ml: -0.5,
59+
mr: 1,
60+
},
61+
'&::before': {
62+
content: '""',
63+
display: 'block',
64+
position: 'absolute',
65+
top: 0,
66+
right: 14,
67+
width: 10,
68+
height: 10,
69+
bgcolor: 'background.paper',
70+
transform: 'translateY(-50%) rotate(45deg)',
71+
zIndex: 0,
72+
},
7173
},
7274
},
7375
}}

docs/data/material/components/menus/LongMenu.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ export default function LongMenu() {
5353
anchorEl={anchorEl}
5454
open={open}
5555
onClose={handleClose}
56-
PaperProps={{
57-
style: {
58-
maxHeight: ITEM_HEIGHT * 4.5,
59-
width: '20ch',
56+
slotProps={{
57+
paper: {
58+
style: {
59+
maxHeight: ITEM_HEIGHT * 4.5,
60+
width: '20ch',
61+
},
6062
},
6163
}}
6264
>

docs/data/material/components/menus/LongMenu.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ export default function LongMenu() {
5353
anchorEl={anchorEl}
5454
open={open}
5555
onClose={handleClose}
56-
PaperProps={{
57-
style: {
58-
maxHeight: ITEM_HEIGHT * 4.5,
59-
width: '20ch',
56+
slotProps={{
57+
paper: {
58+
style: {
59+
maxHeight: ITEM_HEIGHT * 4.5,
60+
width: '20ch',
61+
},
6062
},
6163
}}
6264
>

0 commit comments

Comments
 (0)