From cbcd5cc47ba745100891b9c45ce602b2bcc391e6 Mon Sep 17 00:00:00 2001 From: Jisu Kim <108998071+jisu15-kim@users.noreply.github.com> Date: Wed, 2 Oct 2024 01:03:18 +0900 Subject: [PATCH] =?UTF-8?q?[WEAV-78]=20=EB=82=98=EC=9D=B4=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EB=B7=B0=20=EA=B5=AC=ED=98=84=20(#24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Navigation/NavigationStack.swift | 2 + .../CommonKit/Sources/AppCoordinator.swift | 8 +- .../CommonKit/Sources/Path/PathTypes.swift | 2 + .../icon-information.imageset/Contents.json | 23 +++++ .../icon-information.png | Bin 0 -> 492 bytes .../icon-information@2x.png | Bin 0 -> 917 bytes .../icon-information@3x.png | Bin 0 -> 1335 bytes .../AuthAgreement/AuthAgreementView.swift | 2 +- .../AuthPhoneVerify/AuthPhoneVerifyView.swift | 31 +++++- .../AuthGreeting/AuthGreetingView.swift | 7 +- .../AuthProfileAgeInputView.swift | 96 ++++++++++++++++++ .../AuthProfileGenderInputView.swift | 4 +- 12 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/Contents.json create mode 100644 Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/icon-information.png create mode 100644 Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/icon-information@2x.png create mode 100644 Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/icon-information@3x.png create mode 100644 Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputView.swift diff --git a/Projects/App/Sources/Navigation/NavigationStack.swift b/Projects/App/Sources/Navigation/NavigationStack.swift index 1442fd3..da75bb7 100644 --- a/Projects/App/Sources/Navigation/NavigationStack.swift +++ b/Projects/App/Sources/Navigation/NavigationStack.swift @@ -32,6 +32,8 @@ extension PathType { AuthGreetingView() case .authProfileGender: AuthProfileGenderInputView() + case .authProfileAge: + AuthProfileAgeInputView() } } } diff --git a/Projects/Core/CommonKit/Sources/AppCoordinator.swift b/Projects/Core/CommonKit/Sources/AppCoordinator.swift index d804c3f..c76c9c9 100644 --- a/Projects/Core/CommonKit/Sources/AppCoordinator.swift +++ b/Projects/Core/CommonKit/Sources/AppCoordinator.swift @@ -17,11 +17,11 @@ public final class AppCoordinator: ObservableObject { @Published public var navigationStack: [PathType] = [.main] //MARK: - Methods + @MainActor public func changeRootView(_ path: PathType) { - Task { - await MainActor.run { - navigationStack = [path] - } + push(path) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { // 애니메이션 시간에 맞춰 조정 + self.navigationStack.removeFirst() } } diff --git a/Projects/Core/CommonKit/Sources/Path/PathTypes.swift b/Projects/Core/CommonKit/Sources/Path/PathTypes.swift index 7571f51..69ac051 100644 --- a/Projects/Core/CommonKit/Sources/Path/PathTypes.swift +++ b/Projects/Core/CommonKit/Sources/Path/PathTypes.swift @@ -33,6 +33,7 @@ public enum PathType: Hashable { case .authGreeting: return "가입 후 환영" case .authProfileGender: return "성별 입력" + case .authProfileAge: return "나이 입력" } } } @@ -45,4 +46,5 @@ public enum SignUpSubViewType: Hashable { case authGreeting case authProfileGender + case authProfileAge } diff --git a/Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/Contents.json b/Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/Contents.json new file mode 100644 index 0000000..f981d4e --- /dev/null +++ b/Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icon-information.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon-information@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icon-information@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/icon-information.png b/Projects/DesignSystem/DesignCore/Resources/Images/Images.xcassets/icon-information.imageset/icon-information.png new file mode 100644 index 0000000000000000000000000000000000000000..741f8325fbb019810e3004d635631201320a7499 GIT binary patch literal 492 zcmV|TCnhO_N;3|7aENoA5S6zvnDc#Pip?0vj?!o*EJ13uR5 z*@9gXVx@M&GK~#7F?O5TN z+As_id^Z3iq#Mu)noe-s1i%ExO>kj?g9!)|lupo$zy|dQY(VwsGYAt0JM_o>==;9l z5L@z#B+GI{{-YZM>50u|Q)n~R3+;%H4|+Mh_VfANNe^TZQWE80FnHG635j&U>D3&M z$7K$=Bto!;64~f&8FU@wVif?E8n>vZQ;FRrwB2rBRoTis+Ux(H+U|6MeVdHF07$`_ zuVO5z|EuYAx|BYIROv_+{E&-PoDxwE^F}hDdS<4j*XDysKbk$gCoBcy~O@C6M9P zt;*CLG7FXYi0K~$gRz=^b1+s#6;T?-R|pXM8ndd(uNd%{=Zjr^S1vO?b}=$$TuFs% zOwJ1~0f{2!5~32O3Wmo;w_$CqGmn}5o)xu!;>m<>AB-!xaD)Ng;Qnl(z&f?WVH4j? ze5veC{#pqrBRYfxd>)(l=hkH<*{-D`i!F;od3{ zZ~8$oP*?>4?pReeT}SERaQLj_@G|FgkmCO2j}6*@*tDhF7FifKlG{D8;laVl9prwF rDM;*_Bz%rBA0-+|#HagU_37{jNy74G5Y(SBSwJMBiRF3z9dFl;R}~8JgFcBJD?Gu> zk>nLPIt%kxi^bv=A`ncB8pj6i;J9~tn~iFR#_J6n6D+Zv%g{~>BF3a1bYo0t1tS34 zTroij>cm+HxmIExQigl4gb~rub}P9_OU36{@uRA^Ugu~z_!er; zY(0`3aQU_C`$>aPk3yi}K}&FSiWf0cxkIjsJKN}Qr=G@cL}5Go83=%f6luBO%g7hx zxnP+a2mr}I3%1BQcg&o79BGVu<+sSnvn*Re031EK?-abPr3t&%D(?9pvqUF>CX=}+ zJJa6Dk;ZfnuwX%OXqv{rN{>rg%xSq$#WM&5)vMZF=x=Jo*tN+-R;+teo05G4n?TxO z7tAYMLs>G(t;ouF_B}vrER~5EZ87AGbszA3%{kV>wIEmNOeSi?RIimW+9IK7VB5>l za0r5l@t7)X8fE_~-=9grKxj;)jdT-9M90x088B$RS8B@T8xOO0u-eN;b? zz}u8Q?G-A0;NT_JWpft;Ub_;TjD|}jelRdRd#j4~bp><;mj8?O+GJuM zrf>pyNRfB{ajda?1}A{SFB~nTU@;Yq{SnXaVOXT%*$hca&JARi_F0-@B|iQH0|CvD zrr<<09_yyH!8tcfU6~|Eq~F$rM5PND7B$D)K1gC^LxDc%tkTI#m5)z?)*Z|Eu|$dV$Vm zB4$^6YB+*8MeV&VfIX2*LhKzF=m-&Cr28)R)TE)##(Zw#DHy9#zpV+*n2zBEzl8(4S$0H=xc8b@o%kh)zKmuAK z)LqZVE|&wkMgcNtQmrRHjT=oiC0fmm$flG2hmK<|3bZrej@6`Et)_Jc&Erjz+pi;` zrzBlKbvvwOxHD*rSNYd~YIx;2lQMkBu, errorMessage: Binding, verifyCodeMaxCount: Int = 6, + boxHeight: CGFloat = 72, + textColor: Color = .black, + borderWidth: CGFloat = 0, + borderColor: Color = .white, + backColor: Color = .white, + cornerRadius: CGFloat = 10, focused: FocusState ) { self._verifyCode = verifyCode self._errorMessage = errorMessage self.verifyCodeMaxCount = verifyCodeMaxCount self._isTextFieldFocused = focused + self.boxHeight = boxHeight + self.textColor = textColor + self.borderWidth = borderWidth + self.borderColor = borderColor + self.backColor = backColor + self.cornerRadius = cornerRadius } public var body: some View { @@ -109,6 +127,7 @@ public struct VerifyCodeInputView: View { ForEach(0 ..< verifyCodeMaxCount, id: \.self) { index in let text = getCharFromString(index: index) getSingleTextBox(text: text) + .shadow(.default) } } } @@ -116,13 +135,17 @@ public struct VerifyCodeInputView: View { @ViewBuilder private func getSingleTextBox(text: String) -> some View { ZStack { - RoundedRectangle(cornerRadius: 10) - .foregroundStyle(.white) - .clipShape(RoundedRectangle(cornerRadius: 10)) + RoundedRectangle(cornerRadius: cornerRadius) + .stroke(borderColor, lineWidth: borderWidth) + .background(backColor) + .clipShape( + RoundedRectangle(cornerRadius: cornerRadius) + ) Text(text) .pretendard(weight: ._600, size: 32) + .foregroundStyle(textColor) } - .frame(height: 72) + .frame(height: boxHeight) } private var clearTextFieldView: some View { diff --git a/Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingView.swift b/Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingView.swift index 838a1e8..98f1d87 100644 --- a/Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingView.swift +++ b/Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingView.swift @@ -37,10 +37,15 @@ public struct AuthGreetingView: View { Spacer() } + .setNavigation( + showLeftBackButton: false, + handler: {} + ) .ignoresSafeArea() .padding(.top, 155) .textureBackground() - .onAppear { + .task { + try? await Task.sleep(nanoseconds: 500_000_000) withAnimation(.easeInOut(duration: 0.6)) { isAppeared = true } diff --git a/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputView.swift b/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputView.swift new file mode 100644 index 0000000..be82a55 --- /dev/null +++ b/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputView.swift @@ -0,0 +1,96 @@ +// +// AuthProfileAgeView.swift +// DesignPreview +// +// Created by 김지수 on 10/1/24. +// Copyright © 2024 com.weave. All rights reserved. +// + +import SwiftUI +import DesignCore +import CommonKit + +public struct AuthProfileAgeInputView: View { + + @State var birthYear = String() + @State var errorMessage: String? = "잘못 입력하셨어요" + @FocusState var isFocused + + public init() {} + + var targetGender: String { + let tempTarget = "여성" + return tempTarget + } + + public var body: some View { + VStack { + ProfileInputTemplatedView( + currentPage: 2, + maxPage: 5, + subMessage: "좋은 \(targetGender) 소개시켜 드릴께요!", + mainMessage: "당신의 나이는 무엇인가요?" + ) { + VStack { + HStack { + VerifyCodeInputView( + verifyCode: $birthYear, + errorMessage: $errorMessage, + verifyCodeMaxCount: 4, + boxHeight: 92, + textColor: .black, + borderWidth: 4, + borderColor: .white, + backColor: DesignCore.Colors.yellow50, + cornerRadius: 20, + focused: _isFocused + ) + .padding(.horizontal, 6) + + VStack { + Spacer() + Text("년생") + .typography(.semibold_18) + .foregroundStyle(DesignCore.Colors.grey300) + } + } + .frame(height: 92) + + Button(action: { + + }, label: { + HStack(spacing: 4) { + DesignCore.Images.iconInformation.image + Text("가입 연령 확인하기") + .typography(.regular_14) + .foregroundStyle(DesignCore.Colors.grey200) + } + }) + .padding(.top, 20) + } + .padding(.top, 8) + } + + Spacer() + + CTABottomButton( + title: "다음", + isActive: birthYear.count > 3 + ) { + + } + } + .ignoresSafeArea() + .padding(.top, 10) + .textureBackground() + .setNavigation(showLeftBackButton: false) { + + } + } +} + +#Preview { + NavigationView { + AuthProfileAgeInputView() + } +} diff --git a/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputView.swift b/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputView.swift index 50e4402..0c5382d 100644 --- a/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputView.swift +++ b/Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputView.swift @@ -70,7 +70,9 @@ public struct AuthProfileGenderInputView: View { title: "다음", isActive: selectedGender != nil ) { - + AppCoordinator.shared.push( + .signUp(.authProfileAge) + ) } } .padding(.top, 10)