1
1
import React from 'react'
2
- import { Box , Grid , Modal , Typography , useMediaQuery , useTheme } from '@mui/material'
2
+ import { Box , Button , Grid , Modal , Typography } from '@mui/material'
3
3
import { useTranslation } from 'react-i18next'
4
4
import styled from 'styled-components'
5
- import { ArrowBackIosNewRounded } from '@mui/icons-material'
5
+ import { ArrowBackIosNewRounded , CloseRounded } from '@mui/icons-material'
6
6
interface DonateModalProps {
7
7
isVisible : boolean
8
8
onClose : ( ) => void
@@ -19,21 +19,28 @@ const boxStyle = {
19
19
width : '80%' ,
20
20
bgcolor : 'background.paper' ,
21
21
boxShadow : 24 ,
22
+ borderRadius : '16px' ,
22
23
p : 4 ,
23
24
} as const
24
25
25
26
const ButtonDonate = styled . a `
27
+ margin-top: 32px;
26
28
direction: rtl;
27
29
display: inline-flex;
28
30
margin-left: auto;
29
31
margin-right: 0;
30
32
color: white;
33
+ flex-wrap: nowrap;
31
34
text-decoration: none;
32
35
font-weight: bold;
36
+ width: 100%;
37
+ max-width: 420px;
33
38
`
34
39
const ButtonDonateText = styled . span `
35
40
background-color: #16a9ff;
36
- padding: 8px 16px;
41
+ padding: 8px 32px;
42
+ width: 100%;
43
+ text-align: center;
37
44
border-radius: 0 1000px 1000px 0;
38
45
font-size: 32px;
39
46
`
@@ -47,9 +54,7 @@ const ButtonDonateIcon = styled.span`
47
54
`
48
55
49
56
export const DonateModal : React . FC < DonateModalProps > = ( { isVisible, onClose } ) => {
50
- const shouldImgCollapse = useMediaQuery ( '(max-width: 950px)' )
51
57
const { t } = useTranslation ( )
52
- const { direction } = useTheme ( )
53
58
54
59
return (
55
60
< Modal
@@ -59,47 +64,60 @@ export const DonateModal: React.FC<DonateModalProps> = ({ isVisible, onClose })
59
64
role = "dialog"
60
65
aria-labelledby = "modal-modal-title"
61
66
aria-describedby = "modal-modal-description"
62
- sx = { {
63
- textAlign : `${ direction === 'ltr' ? 'right' : 'left' } ` as const ,
64
- color : 'text.primary' , // Dynamically uses the theme’s text color
65
- } } >
67
+ sx = { { color : 'text.primary' } } // Dynamically uses the theme’s text color
68
+ >
66
69
< Box sx = { boxStyle } >
67
- < button onClick = { onClose } className = "close-modal-icon" >
68
- X
69
- </ button >
70
- < Typography id = "modal-modal-title" variant = "h6" component = "h2" >
71
- { t ( 'how_to_donate_title' ) }
70
+ < Typography sx = { { display : 'flex' , justifyContent : 'space-between' } } >
71
+ < h1 id = "modal-modal-title" style = { { margin : 0 } } >
72
+ { t ( 'how_to_donate_title' ) }
73
+ </ h1 >
74
+ < Button
75
+ color = "inherit"
76
+ sx = { {
77
+ borderRadius : 1000 ,
78
+ minWidth : '36px' ,
79
+ width : '36px' ,
80
+ height : '36px' ,
81
+
82
+ padding : '4px' ,
83
+ } }
84
+ onClick = { onClose } >
85
+ < CloseRounded sx = { { height : '100%' , width : '100%' } } />
86
+ </ Button >
72
87
</ Typography >
73
88
< p > { t ( 'how_to_donate_text' ) } </ p >
74
- < Grid container spacing = { 2 } direction = { shouldImgCollapse ? 'column-reverse' : 'row' } >
75
- < Grid size = { { xs : 6 } } >
89
+ < Grid container spacing = { 2 } >
90
+ < Grid size = { { xs : 12 , md : 6 } } >
76
91
< Typography id = "modal-modal-description" sx = { { mt : 2 } } >
77
92
< h2 > { t ( 'donate_through_jgive.com_title' ) } </ h2 >
78
- < a
79
- href = "https://www.jgive.com/new/he/ils/donation-targets/3268"
80
- target = "_blank"
81
- rel = "noreferrer"
82
- style = { { textDecoration : 'none' , color : 'inherit' } } >
83
- < img
84
- src = "https://www.hasadna.org.il/wp-content/uploads/2017/12/%D7%AA%D7%A8%D7%95%D7%9E%D7%95%D7%AA.jpg"
85
- alt = { t ( 'donation_link' ) }
86
- width = { '90%' }
87
- style = { { maxWidth : '420px' } }
88
- />
89
- </ a >
90
- < ButtonDonate
91
- href = "https://www.jgive.com/new/he/ils/donation-targets/3268"
92
- target = "_blank"
93
- rel = "noreferrer" >
94
- < ButtonDonateText > { t ( 'donate' ) } </ ButtonDonateText >
95
- < ButtonDonateIcon >
96
- < ArrowBackIosNewRounded sx = { { fontSize : 32 } } />
97
- </ ButtonDonateIcon >
98
- </ ButtonDonate >
99
93
</ Typography >
94
+ < a
95
+ href = "https://www.jgive.com/new/he/ils/donation-targets/3268"
96
+ target = "_blank"
97
+ rel = "noreferrer"
98
+ style = { { textDecoration : 'none' , color : 'inherit' } } >
99
+ < img
100
+ src = "https://www.hasadna.org.il/wp-content/uploads/2017/12/%D7%AA%D7%A8%D7%95%D7%9E%D7%95%D7%AA.jpg"
101
+ alt = { t ( 'donation_link' ) }
102
+ width = { '100%' }
103
+ style = { { maxWidth : '420px' } }
104
+ />
105
+ </ a >
106
+ < br />
107
+ < ButtonDonate
108
+ href = "https://www.jgive.com/new/he/ils/donation-targets/3268"
109
+ target = "_blank"
110
+ rel = "noreferrer" >
111
+ < ButtonDonateText > { t ( 'donate' ) } </ ButtonDonateText >
112
+ < ButtonDonateIcon >
113
+ < ArrowBackIosNewRounded sx = { { fontSize : 32 } } />
114
+ </ ButtonDonateIcon >
115
+ </ ButtonDonate >
100
116
</ Grid >
101
- < Grid dir = { direction } size = { { xs : 6 } } >
102
- < h2 > { t ( 'donation_through_bank_title' ) } </ h2 >
117
+ < Grid size = { { xs : 6 , md : 6 } } >
118
+ < Typography >
119
+ < h2 > { t ( 'donation_through_bank_title' ) } </ h2 >
120
+ </ Typography >
103
121
< p > { t ( 'donation_through_bank_reccomendation' ) } </ p >
104
122
< Typography id = "modal-modal-description" sx = { { mt : 2 } } >
105
123
{ t ( 'bank' ) } : { t ( 'donation_through_bank_details_bank' ) }
0 commit comments