-
Notifications
You must be signed in to change notification settings - Fork 0
Style/#73 다운타임 바텀시트 UI 구현 #79
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
The head ref may contain hidden characters: "style/#73-\uB2E4\uC6B4\uD0C0\uC784-\uBC14\uD140\uC2DC\uD2B8"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "colors" : [ | ||
| { | ||
| "color" : { | ||
| "color-space" : "srgb", | ||
| "components" : { | ||
| "alpha" : "0.100", | ||
| "blue" : "0x52", | ||
| "green" : "0x4C", | ||
| "red" : "0x46" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| }, | ||
| { | ||
| "appearances" : [ | ||
| { | ||
| "appearance" : "luminosity", | ||
| "value" : "dark" | ||
| } | ||
| ], | ||
| "color" : { | ||
| "color-space" : "srgb", | ||
| "components" : { | ||
| "alpha" : "0.100", | ||
| "blue" : "0x52", | ||
| "green" : "0x4C", | ||
| "red" : "0x46" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "Group 2085667406.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "Group 2085667406@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "Group 2085667406@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,135 @@ | ||||||
| // | ||||||
| // DowntimeBottomSheetView.swift | ||||||
| // Cherrish-iOS | ||||||
| // | ||||||
| // Created by 이나연 on 1/16/26. | ||||||
| // | ||||||
|
|
||||||
| import SwiftUI | ||||||
|
|
||||||
| struct DowntimeBottomSheetView: View { | ||||||
| @State var selectedDowntime: Int = 5 | ||||||
| @State var rate: Double = 0.5 | ||||||
|
|
||||||
| var body: some View { | ||||||
| VStack(spacing: 0) { | ||||||
| Spacer() | ||||||
| .frame(height: 25.adjustedH) | ||||||
|
|
||||||
| TypographyText("개인 다운타임으로 설정해주세요.", style: .title1_sb_18, color: .gray1000) | ||||||
| .frame(height: 27.adjustedH) | ||||||
| .frame(maxWidth: .infinity, alignment: .leading) | ||||||
| .padding(.leading, 25.adjustedH) | ||||||
|
|
||||||
| Spacer() | ||||||
| .frame(height: 44.adjustedH) | ||||||
|
|
||||||
| speechBubble | ||||||
|
|
||||||
| downtimeProgressBar | ||||||
| .padding(.top, 8.adjustedH) | ||||||
|
|
||||||
| Spacer() | ||||||
| .frame(height: 25.adjustedH) | ||||||
|
|
||||||
| grayLineView | ||||||
| .padding(.horizontal, 25.adjustedW) | ||||||
|
|
||||||
| pickerView | ||||||
|
|
||||||
| grayLineView | ||||||
| .padding(.horizontal, 25.adjustedW) | ||||||
|
|
||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| extension DowntimeBottomSheetView { | ||||||
| private var speechBubble: some View { | ||||||
| ZStack { | ||||||
| Image(.speechBubble) | ||||||
| .resizable() | ||||||
| .scaledToFill() | ||||||
| .frame(height: 53.adjustedH) | ||||||
|
|
||||||
| TypographyText("회복 목표디데이로부터 약 7일 전에 안정될 수 있어요.", style: .body1_r_14, color: .gray1000) | ||||||
| .lineLimit(1) | ||||||
| .minimumScaleFactor(0.8) | ||||||
| .padding(.horizontal, 18.adjustedW) | ||||||
| .offset(y: -4.adjustedH) | ||||||
|
|
||||||
| } | ||||||
| .padding(.horizontal, 25.adjustedW) | ||||||
| .frame(height: 53.adjustedH) | ||||||
| } | ||||||
|
|
||||||
| private var downtimeProgressBar: some View { | ||||||
| VStack { | ||||||
| HStack { | ||||||
| Spacer() | ||||||
|
|
||||||
| TypographyText("다운타임 \(selectedDowntime)일", style: .title2_m_16, color: .red600) | ||||||
|
|
||||||
| Spacer () | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 타이포 수정: 괄호 앞에 불필요한 공백이 있습니다. 🔧 제안된 수정- Spacer ()
+ Spacer()📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요거 해줭 |
||||||
|
|
||||||
| TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800) | ||||||
|
|
||||||
|
Comment on lines
+71
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "DowntimeBottomSheetView.swift" | head -20Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 157 🏁 Script executed: cd Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar && wc -l DowntimeBottomSheetView.swiftRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 103 🏁 Script executed: cd Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar && sed -n '1,150p' DowntimeBottomSheetView.swift | cat -nRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 5031 여유기간 문자열과 날짜가 하드코딩되어 실제 데이터와 불일치할 수 있습니다. Line 75의 "여유기간 7일"과 Line 99-105의 "1월 2일", "1월 14일"은 하드코딩된 상태입니다. 버퍼 일수와 시작/종료 날짜를 프로퍼티로 주입받아 표시하세요. 제안된 수정- TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800)
+ TypographyText("여유기간 \(bufferDays)일", style: .title2_m_16, color: .gray800)
...
- TypographyText("1월 2일", style: .body2_r_13, color: .gray700)
+ TypographyText(dateText(startDate), style: .body2_r_13, color: .gray700)
...
- TypographyText("1월 14일", style: .body2_r_13, color: .gray700)
+ TypographyText(dateText(endDate), style: .body2_r_13, color: .gray700)구조체에 아래와 같이 추가하세요: let startDate: Date
let endDate: Date
let bufferDays: Int
private static let dateFormatter: DateFormatter = {
let f = DateFormatter()
f.locale = Locale(identifier: "ko_KR")
f.dateFormat = "M월 d일"
return f
}()
private func dateText(_ date: Date) -> String {
Self.dateFormatter.string(from: date)
}🤖 Prompt for AI Agents |
||||||
| Spacer() | ||||||
| } | ||||||
|
|
||||||
| GeometryReader { geometry in | ||||||
| ZStack(alignment: .leading) { | ||||||
| RoundedRectangle(cornerRadius: 24) | ||||||
| .fill(.gray400) | ||||||
| .frame(height: 8.adjustedH) | ||||||
|
|
||||||
| RoundedRectangle(cornerRadius: 24) | ||||||
| .fill(.red600) | ||||||
| .frame( | ||||||
| width: geometry.size.width * rate, | ||||||
| height: 8.adjustedH | ||||||
| ) | ||||||
| .animation(.easeOut(duration: 0.5), value: rate) | ||||||
| } | ||||||
| } | ||||||
| .frame(height: 8.adjustedH) | ||||||
| .padding(.horizontal, 25.adjustedW) | ||||||
|
|
||||||
| HStack { | ||||||
| TypographyText("1월 2일", style: .body2_r_13, color: .gray700) | ||||||
| .frame(height: 18.adjustedH) | ||||||
|
|
||||||
| Spacer() | ||||||
|
|
||||||
| TypographyText("1월 14일", style: .body2_r_13, color: .gray700) | ||||||
| .frame(height: 18.adjustedH) | ||||||
| } | ||||||
| .padding(.horizontal, 25.adjustedW) | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| private var grayLineView: some View { | ||||||
| Rectangle() | ||||||
| .frame(height: 1.adjustedH) | ||||||
| .foregroundColor(.gray400) | ||||||
| } | ||||||
|
|
||||||
| private var pickerView: some View { | ||||||
| HStack { | ||||||
| Spacer() | ||||||
|
|
||||||
| VStack(spacing: 0) { | ||||||
| TypographyText("다운타임", style: .headline_sb_20, color: .gray1000) | ||||||
| .frame(height: 30.adjustedH) | ||||||
|
|
||||||
| TypographyText("보통 3-5일", style: .title2_m_16, color: .gray600) | ||||||
| } | ||||||
|
|
||||||
| Spacer() | ||||||
|
|
||||||
| CherrishPicker(selection: $selectedDowntime, range: 1...30) | ||||||
|
|
||||||
| Spacer() | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rate값이selectedDowntime변경에 따라 갱신되지 않습니다.현재
rate는 0.5로 고정되어 있어, 사용자가 피커에서 다운타임 값을 변경해도 프로그레스 바가 업데이트되지 않습니다.rate를selectedDowntime기반으로 계산하거나onChange를 사용하여 동기화해야 합니다.🐛 제안된 수정 (computed property 사용)
또는
onChange를 사용하여 동기화:Also applies to: 86-92
🤖 Prompt for AI Agents
🧹 Nitpick | 🔵 Trivial
@State프로퍼티에private접근 제어자를 추가하세요.SwiftUI 모범 사례에 따르면,
@State프로퍼티는 뷰 내부에서만 관리되어야 하므로private으로 선언하는 것이 권장됩니다. 외부에서 직접 초기화하려면init을 통해 바인딩하거나 별도의 프로퍼티를 사용하세요.♻️ 제안된 수정
📝 Committable suggestion
🤖 Prompt for AI Agents