-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/#149 1์ฐจ QA #154
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
Fix/#149 1์ฐจ QA #154
Changes from 5 commits
ce593b1
1406d9d
540c737
e2ce49c
a59ff84
967c20a
2183fc2
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 |
|---|---|---|
|
|
@@ -48,10 +48,11 @@ enum CherryLevel: Int { | |
| } | ||
|
|
||
| struct ChallengeProgressView: View { | ||
| @EnvironmentObject private var challengeCoordinator: ChallengeCoordinator | ||
| @StateObject var viewModel: ChallengeProgressViewModel | ||
|
|
||
|
Comment on lines
+51
to
53
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. ๐งน Nitpick | ๐ต Trivial EnvironmentObject ์ฃผ์
๋ณด์ฅ ๋ฐ ์๋ก ์ถ๊ฐ๋ โป๏ธ `@StateObject` ์ ๊ทผ์ฑ ์ ๋ฆฌ ์ ์- `@StateObject` var viewModel: ChallengeProgressViewModel
+ `@StateObject` private var viewModel: ChallengeProgressViewModel
+
+ init(viewModel: ChallengeProgressViewModel) {
+ _viewModel = StateObject(wrappedValue: viewModel)
+ }#!/bin/bash
# ChallengeProgressView ์์ฑ ์์น์ EnvironmentObject ์ฃผ์
์ฌ๋ถ ํ์ธ
rg -n --type=swift -C3 '\bChallengeProgressView\b'
rg -n --type=swift -C3 '\.environmentObject\([^)]*ChallengeCoordinator'๐งฐ Tools๐ช SwiftLint (0.57.0)[Warning] 52-52: SwiftUI state properties should be private (private_swiftui_state) ๐ค Prompt for AI Agents |
||
| let buttonState: ButtonState = .active | ||
|
|
||
| var body: some View { | ||
| ScrollView { | ||
| VStack { | ||
|
|
@@ -82,22 +83,30 @@ struct ChallengeProgressView: View { | |
|
|
||
| extension ChallengeProgressView { | ||
| private var CherryGrowthView: some View { | ||
| VStack { | ||
| VStack { | ||
| VStack(spacing: 0) { | ||
| VStack(spacing: 0) { | ||
| HStack { | ||
| TypographyText("Lv.\(viewModel.cherryLevel.levelNumber) \(viewModel.cherryLevel.name)", style: .body1_m_14, color: .gray900) | ||
| TypographyText("Lv.\(viewModel.cherryLevel.levelNumber)", style: .body1_m_14, color: .gray900) | ||
| TypographyText("\(viewModel.cherryLevel.name)", style: .body1_m_14, color: .gray900) | ||
| .padding(.leading, 6.adjustedW) | ||
| Spacer() | ||
| } | ||
| viewModel.cherryLevel.cherryImage | ||
| .padding(.top, 14.adjustedH) | ||
| TypographyText("์ฒด๋ฆฌ๊ฐ ํฌ๋ ค๋ฉด \(viewModel.remainMissions)๊ฐ์ ๋ฏธ์ ์ ์ํํด์ผ ํด์!", style: .body2_r_13, color: .gray800) | ||
| .padding(.top, 14.adjustedH) | ||
| .frame(width: 154.adjustedW, height: 154.adjustedW) | ||
| .padding(.bottom, 5.adjustedH) | ||
| if viewModel.cherryLevel.levelNumber == 4 { | ||
| TypographyText("์ฑ๋ฆฐ์ง ์๋ฃ๊น์ง \(viewModel.remainMissions)๊ฐ์ ๋ฏธ์ ์ ์ํํด์ผ ํด์!", style: .body2_r_13, color: .gray800) | ||
| .padding(.bottom, 14.adjustedH) | ||
| }else { | ||
| TypographyText("์ฒด๋ฆฌ๊ฐ ํฌ๋ ค๋ฉด \(viewModel.remainMissions)๊ฐ์ ๋ฏธ์ ์ ์ํํด์ผ ํด์!", style: .body2_r_13, color: .gray800) | ||
| .padding(.bottom, 14.adjustedH) | ||
| } | ||
| } | ||
| .padding(.horizontal, 25.adjustedW) | ||
| Rectangle() | ||
| .fill(.gray300) | ||
| .frame(height: 1) | ||
| .padding(.vertical, 14.adjustedH) | ||
| .padding(.bottom, 14.adjustedH) | ||
| VStack { | ||
| HStack { | ||
| TypographyText("์ฑ๋ฆฐ์ง ๋ฌ์ฑ๋ฅ \(viewModel.progressRate)%", style: .body1_m_14, color: .gray900) | ||
|
|
@@ -149,14 +158,21 @@ extension ChallengeProgressView { | |
| } | ||
|
|
||
| CherrishButton( | ||
| title: "์ค๋ ๋ฏธ์ ์ข ๋ฃํ๊ธฐ", | ||
| title: viewModel.isChallengeCompleted ? "์ฑ๋ฆฐ์ง ์ข ๋ฃํ๊ธฐ":"์ค๋ ๋ฏธ์ ์ข ๋ฃํ๊ธฐ", | ||
| type: .small, | ||
| state: .constant(buttonState), | ||
| leadingIcon: nil, | ||
| trailingIcon: nil | ||
| ) { | ||
| Task { | ||
| await viewModel.advanceDay() | ||
| if viewModel.isChallengeCompleted { | ||
| Task { | ||
| await viewModel.advanceDay() | ||
| challengeCoordinator.push(.startChallenge) | ||
| } | ||
| }else { | ||
| Task { | ||
| await viewModel.advanceDay() | ||
| } | ||
|
Comment on lines
168
to
+183
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. ์๋ฃ ๋ถ๊ธฐ์์ advanceDay ์คํจ ์์๋ ๋ค๋น๊ฒ์ด์
๋ฉ๋๋ค. โ ์์ ์ ์- if viewModel.isChallengeCompleted {
- Task {
- await viewModel.advanceDay()
- challengeCoordinator.push(.startChallenge)
- }
- }else {
- Task {
- await viewModel.advanceDay()
- }
- }
+ if viewModel.isChallengeCompleted {
+ Task {
+ await viewModel.advanceDay()
+ guard viewModel.errorMessage == nil else { return }
+ challengeCoordinator.push(.startChallenge)
+ }
+ } else {
+ Task {
+ await viewModel.advanceDay()
+ }
+ }๐ค Prompt for AI Agents |
||
| } | ||
| } | ||
| .padding(.top, 10.adjustedH) | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
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.
๐งน Nitpick | ๐ต Trivial
์๋ฃ ๊ธฐ์ค(7์ผ) ํ๋์ฝ๋ฉ ํ์ธ ํ์.
์ฑ๋ฆฐ์ง ๊ธฐ๊ฐ์ด ๊ณ ์ 7์ผ์ด ์๋๋ผ๋ฉด ๋ฐ์ดํฐ/์์๋ก ๋ถ๋ฆฌํด ๊ธฐ์ค์ ๋ง์ถ๋ ํธ์ด ์์ ํฉ๋๋ค.
๐ค Prompt for AI Agents