From 2450360ed02adce6503558a01ef4b9c9ffc511cd Mon Sep 17 00:00:00 2001 From: JungDohyeon Date: Tue, 17 Mar 2026 22:55:55 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20calendar=20=EB=8B=A4=EC=9D=8C?= =?UTF-8?q?=EB=8B=AC=20=EC=A1=B0=ED=9A=8C=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Calendar/CalendarDataSource.swift | 9 +-------- .../Components/Calendar/CalendarDayIndicatorView.swift | 8 ++++---- .../Components/Calendar/CalendarNavigationBar.swift | 7 ------- .../Calendar/Components/Calendar/CalendarView.swift | 2 -- .../Components/DatePicker/DatePickerCalendarView.swift | 2 -- 5 files changed, 5 insertions(+), 23 deletions(-) diff --git a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDataSource.swift b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDataSource.swift index b048600..887e072 100644 --- a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDataSource.swift +++ b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDataSource.swift @@ -63,7 +63,6 @@ final class CalendarDataSource { } @discardableResult func moveToNextMonth() -> Date { - guard canMoveToNextMonth() else { return currentDate } currentDate = calendar.date(byAdding: .month, value: 1, to: currentDate) ?? currentDate return currentDate } @@ -96,13 +95,7 @@ final class CalendarDataSource { return formatter.string(from: date) } - func canMoveToNextMonth() -> Bool { - let now = Date() - let currentMonthStart = startOfMonth(for: currentDate) - let todayMonthStart = startOfMonth(for: now) - return currentMonthStart < todayMonthStart - } - + // MARK: - Private private func startOfMonth(for date: Date) -> Date { diff --git a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDayIndicatorView.swift b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDayIndicatorView.swift index 8150405..2db954c 100644 --- a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDayIndicatorView.swift +++ b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarDayIndicatorView.swift @@ -11,10 +11,10 @@ import SnapKit final class CalendarDayIndicatorView: UIView { private let dotView: UIView = { - let v = UIView() - v.layer.cornerRadius = 3 - v.isHidden = true - return v + let view = UIView() + view.layer.cornerRadius = 3 + view.isHidden = true + return view }() private let labelStack: UIStackView = { diff --git a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarNavigationBar.swift b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarNavigationBar.swift index c3742c0..e5f7c3e 100644 --- a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarNavigationBar.swift +++ b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarNavigationBar.swift @@ -126,13 +126,6 @@ final class CalendarNavigationBar: UIView { monthLabel.setText(title) } - func setNextEnabled(_ enabled: Bool) { - nextButton.isEnabled = enabled - nextButton.tintColor = enabled - ? AppColor.IconAndText.highEmphasis - : AppColor.IconAndText.disabled - } - // MARK: - Actions @objc private func tappedPrev() { delegate?.navigationBarDidTapPrev() } diff --git a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarView.swift b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarView.swift index 043e7e4..d28588c 100644 --- a/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarView.swift +++ b/Moa/Moa/Features/Home/History/Calendar/Components/Calendar/CalendarView.swift @@ -103,7 +103,6 @@ final class CalendarView: UIView { private func reloadAll() { navBar.setTitle(dataSource.monthTitle(for: dataSource.currentDate)) - navBar.setNextEnabled(dataSource.canMoveToNextMonth()) reloadGrid() } @@ -130,7 +129,6 @@ final class CalendarView: UIView { @objc private func handleSwipe(_ gesture: UISwipeGestureRecognizer) { if gesture.direction == .left { - guard dataSource.canMoveToNextMonth() else { return } dataSource.moveToNextMonth() slide(.left) } else { diff --git a/Moa/Moa/Presentation/Components/DatePicker/DatePickerCalendarView.swift b/Moa/Moa/Presentation/Components/DatePicker/DatePickerCalendarView.swift index 3e87419..8add761 100644 --- a/Moa/Moa/Presentation/Components/DatePicker/DatePickerCalendarView.swift +++ b/Moa/Moa/Presentation/Components/DatePicker/DatePickerCalendarView.swift @@ -91,7 +91,6 @@ final class DatePickerCalendarView: UIView { private func reloadAll() { navBar.setTitle(dataSource.monthTitle(for: dataSource.currentDate)) - navBar.setNextEnabled(dataSource.canMoveToNextMonth()) reloadGrid() } @@ -104,7 +103,6 @@ final class DatePickerCalendarView: UIView { @objc private func handleSwipe(_ gesture: UISwipeGestureRecognizer) { if gesture.direction == .left { - guard dataSource.canMoveToNextMonth() else { return } dataSource.moveToNextMonth() slide(.left) } else { From aa0800d117f5f7649a7b8860f1e990493c75805c Mon Sep 17 00:00:00 2001 From: JungDohyeon Date: Tue, 17 Mar 2026 23:01:43 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20Loading=20=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Moa/Moa/Presentation/Loading/MoaLoadingView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moa/Moa/Presentation/Loading/MoaLoadingView.swift b/Moa/Moa/Presentation/Loading/MoaLoadingView.swift index aab70f1..c6b1013 100644 --- a/Moa/Moa/Presentation/Loading/MoaLoadingView.swift +++ b/Moa/Moa/Presentation/Loading/MoaLoadingView.swift @@ -47,7 +47,7 @@ final class MoaLoadingView: UIView { lottieView.snp.makeConstraints { $0.center.equalToSuperview() - $0.width.height.equalTo(160) + $0.width.height.equalTo(52) } } From 68be4b40740fed2e5d13c36cc75334f2ef20c8f2 Mon Sep 17 00:00:00 2001 From: JungDohyeon Date: Tue, 17 Mar 2026 23:28:41 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EA=B3=B5=ED=9C=B4=EC=9D=BC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/WorkMainSummaryView.swift | 63 +++++++++++++++++-- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/Moa/Moa/Features/Home/Work/WorkMain/Components/WorkMainSummaryView.swift b/Moa/Moa/Features/Home/Work/WorkMain/Components/WorkMainSummaryView.swift index fe24a09..c443b83 100644 --- a/Moa/Moa/Features/Home/Work/WorkMain/Components/WorkMainSummaryView.swift +++ b/Moa/Moa/Features/Home/Work/WorkMain/Components/WorkMainSummaryView.swift @@ -49,9 +49,15 @@ final class WorkMainSummaryView: UIView { showsChevron: false ) + /// 공휴일(NONE): "근무 예정 없음" 고정, 단일 행, chevron X, 탭 불가 + private lazy var holidayRowView = KeyValueRowView( + type: .customRow(key: "근무 시간", value: "근무 예정 없음"), + showsChevron: false + ) + // MARK: - State - private enum LayoutVariant { case twoRow, finishedRow, vacationRow } + private enum LayoutVariant { case twoRow, finishedRow, vacationRow, holidayRow } private var currentVariant: LayoutVariant = .twoRow // MARK: - Init @@ -71,7 +77,10 @@ final class WorkMainSummaryView: UIView { func configure(status: WorkStatusEntity, data: HomeEntity) { switch (data.type, status) { - case (.none, .finished), (.vacation, .finished): + case (.none, _): + renderHolidayRow() + + case (.vacation, .finished): renderVacationRow(dailyPay: data.dailyPay) // 최종완료 — 근무일: chevron O, 탭 불가 @@ -84,7 +93,7 @@ final class WorkMainSummaryView: UIView { tappable: false ) - case (.none, _), (.vacation, _): + case (.vacation, _): renderVacationRow(dailyPay: data.dailyPay) default: @@ -104,7 +113,9 @@ final class WorkMainSummaryView: UIView { containerView.backgroundColor = AppColor.Container.primary.withAlphaComponent(0.6) switch data.type { - case .none, .vacation: + case .none: + renderHolidayRow() + case .vacation: renderVacationRow(dailyPay: data.dailyPay) case .work: let clockInStr = data.clockInTime?.displayString ?? "--:--" @@ -154,6 +165,19 @@ final class WorkMainSummaryView: UIView { applyBottomRowConstraints(bottomRow: finishedTimeRowView) } + private func renderHolidayRow() { + wageRowView.isHidden = true + dividerView.isHidden = true + timeRowView.isHidden = true + finishedTimeRowView.isHidden = true + vacationTimeRowView.isHidden = true + holidayRowView.isHidden = false + + guard currentVariant != .holidayRow else { return } + currentVariant = .holidayRow + applyOneRowConstraints(row: holidayRowView) + } + private func renderVacationRow(dailyPay: Int) { wageRowView.isHidden = false dividerView.isHidden = false @@ -181,12 +205,16 @@ final class WorkMainSummaryView: UIView { containerView.snp.makeConstraints { $0.edges.equalToSuperview() } containerView.addSubViews([ wageRowView, dividerView, - timeRowView, finishedTimeRowView, vacationTimeRowView + timeRowView, finishedTimeRowView, vacationTimeRowView, holidayRowView ]) applyBottomRowConstraints(bottomRow: timeRowView) } private func applyBottomRowConstraints(bottomRow: UIView) { + holidayRowView.snp.remakeConstraints { + $0.top.horizontalEdges.equalToSuperview().inset(16) + $0.height.equalTo(0) + } wageRowView.snp.remakeConstraints { $0.top.horizontalEdges.equalToSuperview().inset(16) } @@ -203,4 +231,29 @@ final class WorkMainSummaryView: UIView { } } } + + // MARK: - One Row Layout (공휴일 전용) + + private func applyOneRowConstraints(row: UIView) { + // hidden 뷰들: 높이 0 고정 → 내부 subview 제약과 충돌 없이 레이아웃에서 배제 + wageRowView.snp.remakeConstraints { + $0.top.horizontalEdges.equalToSuperview().inset(16) + $0.height.equalTo(0) + } + dividerView.snp.remakeConstraints { + $0.top.equalTo(wageRowView.snp.bottom) + $0.horizontalEdges.equalToSuperview() + $0.height.equalTo(0) + } + [timeRowView, finishedTimeRowView, vacationTimeRowView].forEach { + $0.snp.remakeConstraints { + $0.top.equalTo(dividerView.snp.bottom) + $0.horizontalEdges.equalToSuperview().inset(16) + $0.height.equalTo(0) + } + } + row.snp.remakeConstraints { + $0.edges.equalToSuperview().inset(16) + } + } }