Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TNT-195] TCalendar, TraineeHome 화면 작성 #45

Merged
merged 16 commits into from
Feb 3, 2025

Conversation

FpRaArNkK
Copy link
Contributor

@FpRaArNkK FpRaArNkK commented Feb 1, 2025

📌 What is the PR?

  • TraineeHome UI 작성과, 이에 필요한 TCalendar를 작성했습니다.
  • PR 2개 Approve 받을 시간이 없을 것 같아서 하나로 올립니다

🪄 Changes

  • AutoSizingBottomSheet Modifier 작성
  • TCalendar 작성
  • TraineeHome 화면 작성 - 필요한 컴포넌트인 TWorkoutCard를 작성했습니다 (트레이니 전용입니다)

🌐 Common Changes

  • Calendar 작성을 위해 FSCalendar를 의존성으로 추가했습니다.
    • 이를 위해 Tuist Setting에 Obj-C 설정이 추가되었습니다.
  • 기존 디자인 시스템 컴포넌트의 UI 변동 사항을 반영했습니다

🔥 PR Point

  1. AutoSizingBottomSheet Modifier를 작성했습니다. 바텀시트에 표시될 컨텐츠의 높이를 동적으로 계산해서 바텀 표시의 detent를 잡아주는 친구입니다. 기존 BottomSheet 올릴 뷰에 다음과 같이 붙여주시면 됩니다
.sheet(isPresented: $ispresented) {
            SomeView
            .autoSizingBottomSheet()
}
  1. TCalendar를 작성했습니다. FSCalendar를 통해 구현한 캘린더를 UIViewRepresentable로 래핑하고, 이를 TCalendarView로 한 번 더 감싸서 동적인 높이 조절, 주간/월간 모드 변경 구현과 UIKit->SwiftUI 중 발생하는 UI 버그를 해결했습니다.
    캘린더엔 커스텀 셀인 TCalendarCell 이 사용되었으며, 구조는 일반적인 UICollectionViewCell과 같습니다.
    캘린더 상단의 헤더는 TCalendarHeader를 별도로 사용합니다. TCalendar와 TCalendarHeader 모두 currentPage를 기반으로 페이지를 표시하기 때문에, 하나의 State를 바인딩해서 사용하시면 됩니다.
    사용법은 아래와 같습니다.
TCalendarHeader(
                currentPage: $currentPage,
                formatter: { TDateFormatUtility.formatter(for: .yyyy년_MM월).string(from: $0) },
                rightView: {
                   // 필요 버튼 주입
                }
            )

TCalendarView(
                    selectedDate: $selectedDate,
                    currentPage: $currentPage,
                    events: events,
                    isWeekMode: true  // 모드 변경 필요시 state 넣으면 됩니다
                )

📸 Screenshot

기능 스크린샷
GIF

🙆🏻 To Reviewers

💭 Related Issues

@FpRaArNkK FpRaArNkK added the ✨Feat 새로운 기능 구현 (새로운 로직 추가, UI 구현 등) label Feb 1, 2025
@FpRaArNkK FpRaArNkK requested a review from syss220211 February 1, 2025 22:57
@FpRaArNkK FpRaArNkK self-assigned this Feb 1, 2025
@FpRaArNkK FpRaArNkK changed the title [TNT-195] TCalendar, TraineeHome UI 작성 [TNT-195] TCalendar, TraineeHome 화면 작성 Feb 2, 2025
@FpRaArNkK FpRaArNkK merged commit 9dcef4f into develop Feb 3, 2025
@FpRaArNkK FpRaArNkK deleted the TNT-195-traineeHome-main branch February 12, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feat 새로운 기능 구현 (새로운 로직 추가, UI 구현 등)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants