Skip to content

Commit d0eb4dc

Browse files
fikzzzymfikria
authored andcommitted
Add Close Button in Calendar
1 parent a418a7d commit d0eb4dc

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

src/components/DateRangePicker/index.jsx

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,18 +574,29 @@ function DateRangePicker(props) {
574574
preview={preview}
575575
onPreviewChange={onPreviewChange}
576576
/>
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>
589600
</div>
590601
)}
591602
</div>

src/components/DateRangePicker/style.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ $darkGreen: #0AB88A;;
391391
z-index: 10;
392392

393393
@include phone {
394+
width: 100vw;
394395
position: fixed;
395396
top: 0;
396397
left: 0;
@@ -402,7 +403,15 @@ $darkGreen: #0AB88A;;
402403
border-radius: 0;
403404
}
404405

405-
.reset-button {
406+
.calendar-footer {
407+
width: 100%;
408+
409+
@include phone {
410+
padding: 0 20px;
411+
}
412+
}
413+
414+
.calendar-button {
406415
@include roboto-bold;
407416

408417
width: 71px;
@@ -421,7 +430,7 @@ $darkGreen: #0AB88A;;
421430
height: 26px;
422431
line-height: 27px;
423432
font-size: 12px;
424-
margin: 20px 12px 0;
433+
margin: 0 12px 0;
425434
}
426435
}
427436
}

0 commit comments

Comments
 (0)