1
1
import React from 'react'
2
- import { Box , Grid , Modal , Typography } from '@mui/material'
2
+ import { Box , Grid , Modal , Typography , useMediaQuery } from '@mui/material'
3
3
import i18n from 'src/locale/allTranslations'
4
4
5
5
interface DonateModalProps {
6
6
isVisible : boolean
7
7
onClose : ( ) => void
8
8
}
9
9
10
- const style = {
10
+ const boxStyle = {
11
11
position : 'fixed' ,
12
12
top : '50%' ,
13
13
left : '50%' ,
14
14
transform : 'translate(-50%, -50%)' ,
15
- maxWidth : 1000 ,
16
- width : '90%' ,
15
+ maxWidth : '1250px' ,
16
+ maxHeight : 'calc(100vh - 210px)' ,
17
+ overflowY : 'auto' ,
18
+ width : '80%' ,
17
19
bgcolor : 'background.paper' ,
20
+ textAlign : 'left' ,
18
21
boxShadow : 24 ,
19
22
p : 4 ,
20
23
} as const
21
24
22
25
export const DonateModal : React . FC < DonateModalProps > = ( { isVisible, onClose } ) => {
26
+ /**
27
+ * @description This hook is used to determine if the image should collapse or not based on if the user is a mobile, tablet user or not.
28
+ */
29
+ const shouldImgCollapse = useMediaQuery ( '(max-width: 950px)' )
30
+
23
31
return (
24
32
< Modal
25
33
open = { isVisible }
@@ -31,7 +39,7 @@ export const DonateModal: React.FC<DonateModalProps> = ({ isVisible, onClose })
31
39
sx = { {
32
40
color : 'text.primary' , // Dynamically uses the theme’s text color
33
41
} } >
34
- < Box dir = { i18n . dir ( ) } sx = { style } >
42
+ < Box dir = { i18n . dir ( ) } sx = { boxStyle } >
35
43
< button onClick = { onClose } className = "close-modal-icon" >
36
44
X
37
45
</ button >
@@ -45,7 +53,7 @@ export const DonateModal: React.FC<DonateModalProps> = ({ isVisible, onClose })
45
53
ועושה עוד המון עבודה שוטפת כדי שהפרוייקטים שלנו ייצרו שינוי בעולם. אנחנו זקוקים לתמיכה של
46
54
הקהילה כדי להמשיך ולפעול למען ממשל פתוח יותר. היו אבירי שקיפות והצטרפו בתמיכה חודשית.
47
55
</ p >
48
- < Grid container spacing = { 2 } >
56
+ < Grid container spacing = { 2 } direction = { shouldImgCollapse ? 'column-reverse' : 'row' } >
49
57
< Grid item xs = { 6 } >
50
58
< Typography id = "modal-modal-description" sx = { { mt : 2 } } >
51
59
< h2 > תרומה דרך אתר jgive.com</ h2 >
@@ -56,10 +64,15 @@ export const DonateModal: React.FC<DonateModalProps> = ({ isVisible, onClose })
56
64
< img
57
65
src = "https://www.hasadna.org.il/wp-content/uploads/2017/12/%D7%AA%D7%A8%D7%95%D7%9E%D7%95%D7%AA.jpg"
58
66
alt = "קישור לתרומה"
67
+ width = { '90%' }
68
+ style = { { maxWidth : '420px' } }
59
69
/>
60
70
< img
71
+ width = { '90%' }
61
72
src = "https://www.hasadna.org.il/wp-content/uploads/2018/08/button-300x73.png"
62
73
alt = "תרום עכשיו"
74
+ // style={{ margin: shouldImgCollapse ? 'auto' : '', display: 'block' }}
75
+ style = { { display : 'block' , maxWidth : '300px' } }
63
76
/>
64
77
</ a >
65
78
</ Typography >
0 commit comments