diff --git a/components/common/Calendar.js b/components/common/Calendar.js index 9ad1be88..0414ff7f 100644 --- a/components/common/Calendar.js +++ b/components/common/Calendar.js @@ -70,34 +70,36 @@ export default function Calendar({ date, minDate, maxDate, onChange }) { : } size="small" /> - {!selectMonth && !selectYear && ( - - )} - {selectMonth && ( - - )} - {selectYear && ( - - )} +
+ {!selectMonth && !selectYear && ( + + )} + {selectMonth && ( + + )} + {selectYear && ( + + )} +
); } @@ -220,42 +222,46 @@ const YearSelector = ({ date, minDate, maxDate, onSelect }) => { return (
-
+
+ + + {chunk(years, 5).map((row, i) => ( + + {row.map((n, j) => ( + + ))} + + ))} + +
maxYear, + })} + onClick={() => (n < minYear || n > maxYear ? null : handleSelect(n))} + > + {n} +
+
+
+
); }; diff --git a/components/common/Calendar.module.css b/components/common/Calendar.module.css index b7e56df1..eb07431b 100644 --- a/components/common/Calendar.module.css +++ b/components/common/Calendar.module.css @@ -3,11 +3,11 @@ flex-direction: column; font-size: var(--font-size-small); flex: 1; - min-height: 285px; + min-height: 306px; } .calendar table { - flex: 1; + width: 100%; border-spacing: 5px; } @@ -64,18 +64,34 @@ font-size: var(--font-size-normal); } +.body { + display: flex; +} + .selector { cursor: pointer; } .pager { display: flex; + flex: 1; } .pager button { align-self: center; } +.middle { + flex: 1; +} + +.left, +.right { + display: flex; + justify-content: center; + align-items: center; +} + .left svg { transform: rotate(90deg); }