fix(datePicker): hide next button for inactive months on larger screens
This commit is contained in:
@@ -119,7 +119,10 @@ function DatePicker({ setDate, clinicUuid = null }) {
|
||||
selectedDate={selectedDate}
|
||||
onSelectDay={selectDay}
|
||||
isDisabled={isDisabled}
|
||||
showNext={false}
|
||||
// وقتی تقویم ماه بعد در کنار این نمایش داده میشود (md و xl) دکمهٔ «بعد»
|
||||
// این تقویم پنهان میماند تا دوتا نشود؛ در موبایل و lg که تنها همین تقویم
|
||||
// دیده میشود، دکمهٔ «بعد» فعال است تا کاربر بتواند به ماه بعد برود.
|
||||
nextBtnClass="md:invisible lg:visible xl:invisible"
|
||||
onPrev={() => setBaseMonth(moment(baseMonth).subtract(1, "jMonth"))}
|
||||
onNext={() => setBaseMonth(moment(baseMonth).add(1, "jMonth"))}
|
||||
/>
|
||||
|
||||
@@ -42,6 +42,8 @@ function InlineJalaliMonth({
|
||||
onNext,
|
||||
showPrev = true,
|
||||
showNext = true,
|
||||
prevBtnClass = "",
|
||||
nextBtnClass = "",
|
||||
}) {
|
||||
const days = buildDays(displayDate);
|
||||
|
||||
@@ -51,7 +53,7 @@ function InlineJalaliMonth({
|
||||
<button
|
||||
type="button"
|
||||
onClick={onNext}
|
||||
className={`p-1 text-[#525252] ${showNext ? "" : "invisible"}`}
|
||||
className={`p-1 text-[#525252] ${showNext ? "" : "invisible"} ${nextBtnClass}`}
|
||||
aria-label="ماه بعد"
|
||||
>
|
||||
‹
|
||||
@@ -62,7 +64,7 @@ function InlineJalaliMonth({
|
||||
<button
|
||||
type="button"
|
||||
onClick={onPrev}
|
||||
className={`p-1 text-[#525252] ${showPrev ? "" : "invisible"}`}
|
||||
className={`p-1 text-[#525252] ${showPrev ? "" : "invisible"} ${prevBtnClass}`}
|
||||
aria-label="ماه قبل"
|
||||
>
|
||||
›
|
||||
|
||||
Reference in New Issue
Block a user