File tree 4 files changed +76
-22
lines changed
Resources/components/ResourceSharingForm
4 files changed +76
-22
lines changed Original file line number Diff line number Diff line change @@ -124,17 +124,17 @@ function Ques(props) {
124
124
body : JSON . stringify ( formdata ) ,
125
125
} ) ;
126
126
const data = await response . json ( ) ;
127
- if ( data . errStack ) {
127
+ if ( data . errStack ) {
128
128
setToastMessage ( `${ data . errStack } ` ) ;
129
129
setOpenToast ( true ) ;
130
130
setSeverity ( "error" ) ;
131
- } else {
131
+ } else {
132
132
setToastMessage ( "Q&A added successfully!" ) ;
133
133
setOpenToast ( true ) ;
134
134
setSeverity ( "success" ) ;
135
135
}
136
136
setIsUploadingData ( false ) ;
137
-
137
+
138
138
setFormData ( {
139
139
title : "" ,
140
140
description : "" ,
@@ -385,7 +385,11 @@ function Ques(props) {
385
385
? `mb-3 ${ style [ "level-of-trust" ] } ${ style [ "level-of-trust-dark" ] } `
386
386
: `mb-3 ${ style [ "level-of-trust" ] } ${ style [ "level-of-trust-dark" ] } `
387
387
}
388
- style = { { color : "#69a9dd" , fontSize : "25px" } }
388
+ style = { {
389
+ color : "#69a9dd" ,
390
+ fontSize : "25px" ,
391
+ textAlign : "center" ,
392
+ } }
389
393
>
390
394
Tags
391
395
</ label >
@@ -425,15 +429,19 @@ function Ques(props) {
425
429
426
430
< div
427
431
className = { style [ "submit-btn" ] }
428
- style = { { justifyContent : "space-around" } }
432
+ style = { { justifyContent : "space-around" , marginBottom : "1rem" } }
429
433
>
430
434
< div className = "data-loader" >
431
- { isUploadingData ? < Loader /> : < Button2
432
- style = { { marginRight : "3%" } }
433
- className = { style [ "submit-btn-text" ] }
434
- label = "Submit"
435
- type = "submit"
436
- /> }
435
+ { isUploadingData ? (
436
+ < Loader />
437
+ ) : (
438
+ < Button2
439
+ style = { { marginRight : "3%" } }
440
+ className = { style [ "submit-btn-text" ] }
441
+ label = "Submit"
442
+ type = "submit"
443
+ />
444
+ ) }
437
445
</ div >
438
446
</ div >
439
447
</ div >
Original file line number Diff line number Diff line change 4
4
}
5
5
6
6
.question_form {
7
+ padding : 2rem ;
7
8
width : 50% ;
8
9
border : 2px solid #2a4886 ;
9
- border-radius : 7px ;
10
- margin : 5% 5% 5% 25% ;
10
+ border-radius : 1rem ;
11
+ margin : 5rem auto ;
12
+ display : flex ;
13
+ flex-direction : column ;
14
+ justify-content : center ;
15
+ align-items : center ;
16
+ align-content : center ;
11
17
}
12
18
13
19
.close-popup {
14
- position : relative ;
15
- margin-top : 1% ;
16
- background : black ;
17
- color : #69a9dd ;
20
+ color : black ;
21
+ background : #69a9dd ;
18
22
margin-left : 96.5% ;
19
23
width : 25px ;
20
24
height : 25px ;
21
25
border-radius : 50% ;
22
- border : 1px solid #69a9dd ;
26
+ border : none ;
27
+ }
28
+
29
+ .toppings-list {
30
+ display : grid ;
31
+ grid-template-columns : repeat (4 , 1fr );
32
+ grid-gap : 2rem ;
33
+ li {
34
+ width : 8rem ;
35
+ }
23
36
}
24
37
25
38
.question-cards {
75
88
cursor : pointer ;
76
89
}
77
90
91
+ @media screen and (max-width : 1200px ) {
92
+ .toppings-list {
93
+ grid-template-columns : repeat (2 , 1fr );
94
+ }
95
+ }
96
+
97
+ @media (max-width : 650px ) {
98
+ .question_form {
99
+ width : 85% ;
100
+ margin : auto ;
101
+ }
102
+ }
103
+
78
104
@media (max-width : 650px ) {
79
105
.question_form {
80
106
width : 85% ;
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ import { SimpleToast } from "../../../../components/util/Toast";
9
9
10
10
export function ResourceSharingForm ( props ) {
11
11
const [ resourceToast , setResourceToast ] = useState ( "" ) ;
12
- const [ openSubmitResourceSuccess , setOpenSubmitResourceSuccess ] = useState (
13
- false
14
- ) ;
12
+ const [ openSubmitResourceSuccess , setOpenSubmitResourceSuccess ] =
13
+ useState ( false ) ;
15
14
const [ isLoading , setIsLoading ] = useState ( false ) ;
16
15
const [ resourceToastStatus , setResourceToastStatus ] = useState ( "" ) ;
17
16
Original file line number Diff line number Diff line change 81
81
.resource-input {
82
82
position : relative ;
83
83
margin-bottom : 30px !important ;
84
+ width : 35rem ;
84
85
}
85
86
86
87
.resource-input input ,
217
218
}
218
219
219
220
.inside-resource {
221
+ display : flex ;
222
+ flex-direction : column ;
223
+ justify-content : center ;
224
+ align-items : center ;
220
225
width : 85% ;
221
- margin : 0 auto ;
222
226
}
223
227
224
228
[type = " radio" ] {
@@ -354,6 +358,23 @@ input[type="date"]:not(:valid):before {
354
358
align-items : center ;
355
359
}
356
360
361
+ @media screen and (max-width : 1200px ) {
362
+ .resource-input {
363
+ width : 23rem ;
364
+ }
365
+
366
+ .toppings-list {
367
+ display : flex ;
368
+ grid-template-columns : repeat (2 , 1fr );
369
+ }
370
+ }
371
+
372
+ @media screen and (max-width : 750px ) {
373
+ .resource-input {
374
+ width : auto ;
375
+ }
376
+ }
377
+
357
378
@media screen and (max-width : 750px ) {
358
379
.resource-section {
359
380
flex-direction : column ;
You canβt perform that action at this time.
0 commit comments