Skip to content

Commit

Permalink
[WEAV-79] 이름 입력 뷰 구현 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim authored Oct 2, 2024
1 parent cbcd5cc commit 6416c65
Show file tree
Hide file tree
Showing 14 changed files with 150 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Projects/App/Sources/Navigation/NavigationStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ extension PathType {
AuthProfileGenderInputView()
case .authProfileAge:
AuthProfileAgeInputView()
case .authName:
AuthNameInputView()
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Projects/Core/CommonKit/Sources/Path/PathTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public enum PathType: Hashable {
case .authGreeting: return "가입 후 환영"
case .authProfileGender: return "성별 입력"
case .authProfileAge: return "나이 입력"
case .authName: return "이름 입력"
}
}
}
Expand All @@ -47,4 +48,5 @@ public enum SignUpSubViewType: Hashable {
case authGreeting
case authProfileGender
case authProfileAge
case authName
}
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// AuthNameInputView.swift
// DesignPreview
//
// Created by 김지수 on 10/2/24.
// Copyright © 2024 com.weave. All rights reserved.
//

import SwiftUI
import DesignCore
import CommonKit
import UIKit

public struct AuthNameInputView: View {

@State var inputText = String()

public init() {

}

@ViewBuilder
var backgroundView: some View {
ZStack {
DesignCore.Images.namePaper.image
.resizable()
.aspectRatio(contentMode: .fit)
.padding(.horizontal, 72)
DesignCore.Images.pencil.image
.resizable()
.frame(width: 68, height: 68)
.offset(x: 100, y: 12)
}
}

public var body: some View {
VStack(spacing: 44) {
VStack(spacing: 0) {
Text("이제 마지막이에요.")
.typography(.regular_14)
.foregroundStyle(DesignCore.Colors.grey200)
Text("당신의 이름은 무엇인가요?")
.typography(.semibold_24)
.foregroundStyle(DesignCore.Colors.grey500)
}

ZStack {
backgroundView
TextField(
"김위브",
text: $inputText
)
.keyboardType(.namePhonePad)
.interactiveDismissDisabled()
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
.speechAnnouncementsQueued(false)
.speechSpellsOutCharacters(false)
.multilineTextAlignment(.center)
.pretendard(weight: ._400, size: 28)
.foregroundStyle(DesignCore.Colors.grey500)
.offset(y: -4)
}

Spacer()

CTABottomButton(
title: "다음",
backgroundStyle: LinearGradient.gradientA,
isActive: inputText.count >= 2
) {

}
}
.ignoresSafeArea()
.padding(.top, 10)
.textureBackground()
.setNavigation {
AppCoordinator.shared.pop()
}
}
}

#Preview {
NavigationView {
AuthNameInputView()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public struct AuthProfileAgeInputView: View {
title: "다음",
isActive: birthYear.count > 3
) {

// TODO: 순서 재정의
AppCoordinator.shared.push(.signUp(.authName))
}
}
.ignoresSafeArea()
Expand Down

0 comments on commit 6416c65

Please sign in to comment.