@@ -27,11 +27,7 @@ const ThemeModal: React.FC<{
27
27
onClose : ( ) => void ;
28
28
theme : Theme ;
29
29
updateFavorites : ( theme : Theme , isFavoriting : boolean ) => void ;
30
- } > = ( {
31
- onClose,
32
- theme,
33
- updateFavorites
34
- } ) => {
30
+ } > = ( { onClose, theme, updateFavorites } ) => {
35
31
const { t } = useTranslation ( "components/themes" ) ;
36
32
const modalRef = useRef < HTMLDivElement > ( null ) ;
37
33
@@ -64,24 +60,38 @@ const ThemeModal: React.FC<{
64
60
backgroundColor : "background.paper" ,
65
61
borderRadius : 2 ,
66
62
boxShadow : 24 ,
67
- p : 4 ,
63
+ p : 2 ,
64
+ paddingTop : 1 ,
68
65
maxWidth : "800px" ,
66
+ maxHeight : "80vh" ,
67
+ overflow : "auto" ,
69
68
width : "90%" ,
69
+ marginTop : { xs : 4 , md : 0 } ,
70
70
} }
71
71
>
72
- < IconButton
73
- onClick = { onClose }
72
+ < Box sx = { { display : "flex" , justifyContent : "flex-end" } } >
73
+ < IconButton onClick = { onClose } >
74
+ < CloseIcon />
75
+ </ IconButton >
76
+ </ Box >
77
+
78
+ < Grid
79
+ container
80
+ spacing = { 2 }
74
81
sx = { {
75
- position : "absolute" ,
76
- top : 16 ,
77
- right : 16 ,
82
+ p : 2 ,
83
+ flexDirection : { xs : "column-reverse" , md : "row" } ,
78
84
} }
79
85
>
80
- < CloseIcon />
81
- </ IconButton >
82
-
83
- < Grid container spacing = { 4 } >
84
- < Grid item xs = { 12 } md = { 6 } >
86
+ < Grid
87
+ item
88
+ xs = { 12 }
89
+ md = { 6 }
90
+ sx = { {
91
+ paddingRight : { xs : 0 , md : 2 } ,
92
+ } }
93
+ spacing = { 0 }
94
+ >
85
95
< Typography
86
96
id = "theme-modal-title"
87
97
variant = "h5"
@@ -179,42 +189,51 @@ const ThemeModal: React.FC<{
179
189
sx = { {
180
190
display : "flex" ,
181
191
alignItems : "center" ,
182
- gap : 3 ,
192
+ gap : 1 ,
183
193
width : { xs : "100%" , md : "auto" } ,
194
+ py : 2 ,
184
195
} }
185
196
>
186
197
< Button
187
198
onClick = { onDownload }
188
199
variant = "contained"
189
200
color = "primary"
190
201
sx = { {
191
- width : { xs : "100%" , md : "auto" } ,
202
+ width : "auto" ,
203
+ flexGrow : 1 ,
192
204
} }
193
205
>
194
206
{ t ( "theme_modal.download_theme" ) }
195
207
</ Button >
196
208
197
- < Box sx = { { display : "flex" , alignItems : "center" , gap : 0 } } >
198
- < IconButton
209
+ < Box
210
+ sx = { {
211
+ display : "flex" ,
212
+ alignItems : "center" ,
213
+ alignSelf : { xs : "flex-start" , md : "flex-end" } ,
214
+ gap : 0 ,
215
+ } }
216
+ >
217
+ < IconButton
199
218
aria-label = "favorite"
200
219
onClick = { handleFavoriteClick }
201
220
sx = { {
202
221
padding : 1 ,
203
- ' &:hover' : {
204
- backgroundColor : ' action.hover'
205
- }
222
+ " &:hover" : {
223
+ backgroundColor : " action.hover" ,
224
+ } ,
206
225
} }
207
226
>
208
227
< Heart
209
228
size = { 20 }
210
- color = { theme . isFavorite ? ' red' : ' currentColor' }
211
- fill = { theme . isFavorite ? ' red' : ' none' }
229
+ color = { theme . isFavorite ? " red" : " currentColor" }
230
+ fill = { theme . isFavorite ? " red" : " none" }
212
231
/>
213
232
</ IconButton >
214
233
< Typography
215
234
sx = { {
216
- color : ' text.primary' ,
217
- fontSize : ' 1rem'
235
+ color : " text.primary" ,
236
+ fontSize : " 1rem" ,
218
237
} }
219
238
>
220
239
{ theme . favoritesCount } { t ( "theme_modal.likes" ) }
@@ -223,7 +242,16 @@ const ThemeModal: React.FC<{
223
242
</ Box >
224
243
</ Grid >
225
244
226
- < Grid item xs = { 12 } md = { 6 } display = "flex" justifyContent = "center" >
245
+ < Grid
246
+ item
247
+ xs = { 12 }
248
+ md = { 6 }
249
+ display = "flex"
250
+ justifyContent = "center"
251
+ sx = { {
252
+ paddingRight : { xs : 0 , md : 2 } ,
253
+ } }
254
+ >
227
255
< Box
228
256
component = "img"
229
257
src = { theme . themeImg }
@@ -248,4 +276,4 @@ const ThemeModal: React.FC<{
248
276
) ;
249
277
} ;
250
278
251
- export default ThemeModal ;
279
+ export default ThemeModal ;
0 commit comments