Skip to content

Commit

Permalink
[WEAV-72] 내 프로필 입력 일부 UI 구현 (#26)
Browse files Browse the repository at this point in the history
* [WEAV-73] 프로필 입력 - 성별선택 뷰 구현 (#23)

* [WEAV-73] 프로필 입력 - 성별선택 뷰 구현
* [WEAV-73] 오타수정

* [WEAV-78] 나이 입력 뷰 구현 (#24)

* [WEAV-79] 이름 입력 뷰 구현 (#25)
  • Loading branch information
jisu15-kim authored Oct 3, 2024
1 parent 4c2f234 commit e3af915
Show file tree
Hide file tree
Showing 42 changed files with 633 additions and 31 deletions.
9 changes: 9 additions & 0 deletions Projects/App/Sources/Navigation/NavigationStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ extension PathType {
AuthPhoneVerifyView()
case .authAgreement:
AuthAgreementView()

case .authGreeting:
AuthGreetingView()
case .authProfileGender:
AuthProfileGenderInputView()
case .authProfileAge:
AuthProfileAgeInputView()
case .authName:
AuthNameInputView()
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Projects/Core/CommonKit/Sources/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
10 changes: 10 additions & 0 deletions Projects/Core/CommonKit/Sources/Path/PathTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public enum PathType: Hashable {
case .authPhoneInput: return "전화번호 입력"
case .authPhoneVerify: return "전화번호 인증"
case .authAgreement: return "이용 약관"

case .authGreeting: return "가입 후 환영"
case .authProfileGender: return "성별 입력"
case .authProfileAge: return "나이 입력"
case .authName: return "이름 입력"
}
}
}
Expand All @@ -39,4 +44,9 @@ public enum SignUpSubViewType: Hashable {
case authPhoneInput
case authPhoneVerify
case authAgreement

case authGreeting
case authProfileGender
case authProfileAge
case authName
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "female_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "female_unselected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "male_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "male_unselected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "icon-information.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "name-paper.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "pencil.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,32 @@
import SwiftUI
import Combine

public struct CTABottomButton<BackgroundStyle: ShapeStyle>: View {
public struct CTABottomButton: View {
private let title: String
private let backgroundStyle: BackgroundStyle
private let backgroundStyle: AnyShapeStyle
private let titleColor: Color = .white
private let isActive: Bool
private var handler: () -> Void

@State private var cancellables: Set<AnyCancellable> = []
@State private var keyboardHeight: CGFloat = 0

@State private var maxKeyboardHeight: CGFloat = 0

public init(
title: String,
backgroundStyle: BackgroundStyle = DesignCore.Colors.grey500,
backgroundStyle: some ShapeStyle = DesignCore.Colors.grey500,
isActive: Bool = true,
handler: @escaping () -> Void
) {
self.title = title
self.backgroundStyle = backgroundStyle
self.backgroundStyle = AnyShapeStyle(backgroundStyle)
self.isActive = isActive
self.handler = handler
}
private var buttonBackgroundColor: BackgroundStyle {

private var buttonBackgroundColor: AnyShapeStyle {
if !isActive {
return DesignCore.Colors.grey100 as! BackgroundStyle
return AnyShapeStyle(DesignCore.Colors.grey100)
}
return backgroundStyle
}
Expand Down
27 changes: 19 additions & 8 deletions Projects/DesignSystem/DesignCore/Sources/NavigationBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import SwiftUI

private struct NavigationBarViewModifier: ViewModifier {
var showLeftBackButton: Bool = true
var handler: () -> Void

func body(content: Content) -> some View {
Expand All @@ -17,20 +18,30 @@ private struct NavigationBarViewModifier: ViewModifier {
.toolbar(.visible, for: .navigationBar)
.toolbarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button {
handler()
} label: {
DesignCore.Images.leftArrow.image
if showLeftBackButton {
ToolbarItem(placement: .topBarLeading) {
Button {
handler()
} label: {
DesignCore.Images.leftArrow.image
}

}

}
}
}
}

public extension View {
func setNavigation(handler: @escaping () -> Void) -> some View {
return modifier(NavigationBarViewModifier(handler: handler))
func setNavigation(
showLeftBackButton: Bool = true,
handler: @escaping () -> Void
) -> some View {
return modifier(
NavigationBarViewModifier(
showLeftBackButton: showLeftBackButton,
handler: handler
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import CommonKit

public struct AuthAgreementView: View {

@State var isShowAlert = false

public init() {}

public var body: some View {
Expand All @@ -30,10 +28,9 @@ public struct AuthAgreementView: View {
Spacer()

CTABottomButton(title: "다음") {
isShowAlert = true
}
.alert("끝!!", isPresented: $isShowAlert) {

AppCoordinator.shared.changeRootView(
.signUp(.authGreeting)
)
}
}
.ignoresSafeArea(.all)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CommonKit

public struct AuthPhoneInputView: View {

@State var phoneTextInput = String()
@State var phoneTextInput = "010-"
@State var isPhoneValidated = false

public init() {}
Expand Down
Loading

0 comments on commit e3af915

Please sign in to comment.