File tree Expand file tree Collapse file tree 5 files changed +46
-19
lines changed
components/DateRangePicker Expand file tree Collapse file tree 5 files changed +46
-19
lines changed Original file line number Diff line number Diff line change @@ -574,18 +574,29 @@ function DateRangePicker(props) {
574
574
preview = { preview }
575
575
onPreviewChange = { onPreviewChange }
576
576
/>
577
- < button
578
- type = "button"
579
- styleName = "reset-button"
580
- onClick = { ( ) => {
581
- onDateRangePickerChange ( {
582
- startDate : null ,
583
- endDate : null ,
584
- } ) ;
585
- } }
586
- >
587
- Reset
588
- </ button >
577
+ < div styleName = "calendar-footer" >
578
+ < button
579
+ type = "button"
580
+ styleName = "calendar-button"
581
+ onClick = { ( ) => {
582
+ onDateRangePickerChange ( {
583
+ startDate : null ,
584
+ endDate : null ,
585
+ } ) ;
586
+ } }
587
+ >
588
+ Reset
589
+ </ button >
590
+ < button
591
+ type = "button"
592
+ styleName = "calendar-button"
593
+ onClick = { ( ) => {
594
+ setIsComponentVisible ( false ) ;
595
+ } }
596
+ >
597
+ Close
598
+ </ button >
599
+ </ div >
589
600
</ div >
590
601
) }
591
602
</ div >
Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ $darkGreen: #0AB88A;;
391
391
z-index : 10 ;
392
392
393
393
@include phone {
394
+ width : 100vw ;
394
395
position : fixed ;
395
396
top : 0 ;
396
397
left : 0 ;
@@ -402,7 +403,15 @@ $darkGreen: #0AB88A;;
402
403
border-radius : 0 ;
403
404
}
404
405
405
- .reset-button {
406
+ .calendar-footer {
407
+ width : 100% ;
408
+
409
+ @include phone {
410
+ padding : 0 20px ;
411
+ }
412
+ }
413
+
414
+ .calendar-button {
406
415
@include roboto-bold ;
407
416
408
417
width : 71px ;
@@ -421,7 +430,7 @@ $darkGreen: #0AB88A;;
421
430
height : 26px ;
422
431
line-height : 27px ;
423
432
font-size : 12px ;
424
- margin : 20 px 12px 0 ;
433
+ margin : 0 12px 0 ;
425
434
}
426
435
}
427
436
}
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ const App = () => {
45
45
return ;
46
46
}
47
47
48
- const params = utils . url . parseUrlQuery ( location . search ) ;
48
+ let search = location . href . split ( '?' ) . length ? '?' + location . href . split ( '?' ) [ 1 ] : ''
49
+ const params = utils . url . parseUrlQuery ( search ) ;
49
50
const toUpdate = utils . challenge . createChallengeFilter ( params ) ;
50
51
51
52
if ( ! toUpdate . types ) toUpdate . types = [ ] ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import { getService as getSubmissionsService } from "./submissions";
17
17
* @return {Array<Object> } challenges
18
18
*/
19
19
async function getChallenges ( filter , cancellationSignal ) {
20
- const challengeQuery = util . buildQueryString ( filter ) ;
20
+ const challengeQuery = util . buildQueryString ( filter , true ) ;
21
21
return api . get (
22
22
`/challenges/${ challengeQuery } ` ,
23
23
undefined ,
Original file line number Diff line number Diff line change @@ -15,9 +15,11 @@ import qs from "qs";
15
15
* @params {Object<{[key: string]: any}> } params Query string parameters
16
16
* @return {String }
17
17
*/
18
- export function buildQueryString ( params ) {
18
+ export function buildQueryString ( params , disableEncode ) {
19
19
params = _ . omitBy ( params , ( p ) => p == null || p === "" || p . length === 0 ) ;
20
-
20
+ if ( ! disableEncode ) {
21
+ params . tags = _ . map ( params . tags , ( t ) => encodeURIComponent ( t ) )
22
+ }
21
23
let queryString = qs . stringify ( params , {
22
24
encode : false ,
23
25
arrayFormat : "brackets" ,
@@ -28,7 +30,11 @@ export function buildQueryString(params) {
28
30
}
29
31
30
32
export function parseUrlQuery ( queryString ) {
31
- return qs . parse ( queryString , { ignoreQueryPrefix : true } ) ;
33
+ let params = qs . parse ( queryString , { ignoreQueryPrefix : true } ) ;
34
+ if ( params . tags ) {
35
+ params . tags = _ . map ( params . tags , ( t ) => decodeURIComponent ( t ) )
36
+ }
37
+ return params
32
38
}
33
39
34
40
export function updateQuery ( params , replace = false ) {
You can’t perform that action at this time.
0 commit comments