File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import ButtonWithLoading, {
1010 type ButtonWithLoadingProps ,
1111} from '../common/ButtonWithLoading' ;
1212import DialogTransition from '../common/DialogTransition' ;
13+ import { useAppContext } from '@/hooks/useAppContext' ;
1314
1415export interface DialogProps extends MuiDialogProps {
1516 dialogContentProps ?: DialogContentProps ;
@@ -23,8 +24,44 @@ const Dialog: FC<DialogProps> = ({
2324 closeButtonDisabled = false ,
2425 ...props
2526} ) => {
27+ const { isMobile } = useAppContext ( ) ;
2628 return (
27- < MuiDialog TransitionComponent = { DialogTransition } { ...props } >
29+ < MuiDialog
30+ TransitionComponent = { DialogTransition }
31+ { ...props }
32+ PaperProps = { {
33+ ...props . PaperProps ,
34+ sx : {
35+ ...props ?. PaperProps ?. sx ,
36+ ...( isMobile
37+ ? {
38+ margin : 0 ,
39+ width : '100%' ,
40+ maxWidth : '100%' ,
41+ }
42+ : { } ) ,
43+ } ,
44+ } }
45+ slotProps = { {
46+ root : isMobile
47+ ? {
48+ style : {
49+ zIndex : 2000 ,
50+ } ,
51+ }
52+ : { } ,
53+ } }
54+ sx = { {
55+ ...props . sx ,
56+ ...( isMobile
57+ ? {
58+ '& .MuiDialog-container' : {
59+ alignItems : 'flex-end' ,
60+ } ,
61+ }
62+ : { } ) ,
63+ } }
64+ >
2865 < DialogTitle
2966 sx = { {
3067 display : 'flex' ,
You can’t perform that action at this time.
0 commit comments