fix(datePicker): hide next button for inactive months on larger screens

This commit is contained in:
hamed
2026-07-23 19:43:02 +03:30
parent cd32f6c8bd
commit 0a2a2bfba3
2 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -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"))}
/>
+4 -2
View File
@@ -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="ماه قبل"
>