Skip to content

Commit

Permalink
refactor: 온보딩 결과 텍스트 및 애니메 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
enebin committed Oct 6, 2023
1 parent fa1a963 commit 2381b66
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Projects/Domain/Sources/Model/TestResultModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ import Network

public struct TestResultModel: Equatable, Hashable {
public let title: String
public let nickname: String = "키미" // TODO: 추후에 수정
public let keyword: String
public let score: Int
public let icon: IconModel

public static let EMPTY: TestResultModel = .init(
title: "",
keyword: "",
score: 0,
icon: IconModel.EMPTY)
}

public extension ResultDTO {
func toModel() -> TestResultModel {
return TestResultModel(
title: keyword,
title: title,
keyword: keyword,
score: score,
icon: IconModel(imageURL: category.iconUrl,
color: Color.hex(category.color))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import DSKit
import Domain

public struct KeymeCardView: View {
private let nickname: String
private let testResult: TestResultModel

public init(testResult: TestResultModel) {
public init(nickname: String, testResult: TestResultModel) {
self.nickname = nickname
self.testResult = testResult
}

Expand Down Expand Up @@ -49,13 +51,13 @@ public struct KeymeCardView: View {
// 카드 상단 뷰 (키워드, 타이틀, 점수)
func cardTopView() -> some View {
VStack(alignment: .leading) {
Text.keyme(testResult.title, font: .body4)
Text.keyme(testResult.keyword, font: .body4)
.foregroundColor(.white.opacity(0.3))

Spacer()
.frame(height: 8)

Text.keyme("\(testResult.nickname)\(testResult.title) 정도는?", font: .heading1)
Text.keyme(nickname + testResult.title, font: .heading1)
.foregroundColor(.white)
.multilineTextAlignment(.leading)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import Domain
public struct TestResultFeature: Reducer {
public struct State: Equatable {
@BindingState var testResult: TestResultModel = .EMPTY
public let nickname: String
public var testResultId: Int
public var testResults: [TestResultModel] = []
public var testId: Int

public init(testResultId: Int, testId: Int) {
public init(testResultId: Int, testId: Int, nickname: String) {
self.testResultId = testResultId
self.testId = testId
self.nickname = nickname
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ public struct TestResultView: View {
}

// 결과 확인 카드 뷰
@MainActor func resultCardView(_ viewStore: ViewStore<TestResultFeature.State, TestResultFeature.Action>) -> some View {
@MainActor func resultCardView(
_ viewStore: ViewStore<TestResultFeature.State, TestResultFeature.Action>
) -> some View {
ZStack {
TabView(selection: viewStore.$testResult) {
ForEach(viewStore.testResults, id:\.self) {
KeymeCardView(testResult: $0)
KeymeCardView(nickname: viewStore.nickname, testResult: $0)
.tag($0)
}
}
Expand Down
3 changes: 2 additions & 1 deletion Projects/Features/Sources/Onboarding/OnboardingFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public struct OnboardingFeature: Reducer {
case .showResult(data: let data):
state.testResultState = TestResultFeature.State(
testResultId: data.testResultId,
testId: state.testId
testId: state.testId,
nickname: state.nickname
)

case .succeeded, .failed:
Expand Down
6 changes: 2 additions & 4 deletions Projects/Features/Sources/Onboarding/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ public struct OnboardingView: View {
KeymeTestsView(store: store)
.ignoresSafeArea(.all)
.environmentObject(webViewSetup)
.transition(
.scale.combined(with: .opacity)
.animation(Animation.customInteractiveSpring(duration: 1)))
.transition(.opacity.animation(Animation.customInteractiveSpring(duration: 1)))
},
else: {
splashLottieView(viewStore)
Expand Down Expand Up @@ -81,7 +79,7 @@ public struct OnboardingView: View {
splashFrontView(viewStore)
}
.transition(
.asymmetric(insertion: .identity, removal: .scale)
.asymmetric(insertion: .identity, removal: .scale(scale: 2))
.animation(Animation.customInteractiveSpring(duration: 1)))
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>

<div align="center">
<h3>지금 Keyme를 만나보세요 🚀</h3>
<h4>지금 Keyme를 만나보세요</h4>
<br>
<a href="https://apps.apple.com/your-app-link" target="_blank">
<img src="Assets/appstore.png" height="60">
Expand All @@ -26,7 +26,7 @@
#### 👀 친구들과 함께풀기
성격테스트를 친구들과 공유하고, 당신의 첫인상과 새로운 모습에 대해 알아보세요.

#### 🎨 성격 공유하기
#### 🎨 자랑하기
**Keyme**의 성격 그래프를 SNS에 공유해 당신의 유니크한 성격을 자랑해보세요.

## :computer: Environment
Expand Down

0 comments on commit 2381b66

Please sign in to comment.