Skip to content

Commit

Permalink
[WEAV-70] 전화번호 인증 뷰 UI 구현 (#22)
Browse files Browse the repository at this point in the history
* [WEAV-70] Project Navigation 구조 변경

* [WEAV-70] 전화번호 인증 뷰 구현

* [WEAV-70] 인증코드 입력 뷰 구현

* [WEAV-70] 인증 완료 뷰 구현

* [WEAV-70] AI 리뷰 반영
  • Loading branch information
jisu15-kim authored Sep 30, 2024
1 parent aeb2d17 commit 4c2f234
Show file tree
Hide file tree
Showing 27 changed files with 613 additions and 126 deletions.
1 change: 1 addition & 0 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let infoPlist = InfoPlist.extendingDefault(

let appDependencies: [TargetDependency] = [
.project(target: .main),
.project(target: .signUp),
.project(target: .designPreview)
]

Expand Down
4 changes: 0 additions & 4 deletions Projects/App/Sources/ContentView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import CoreKit
import NetworkKit
import ComponentsKit
import DesignCore
import Main

Expand All @@ -16,9 +15,6 @@ public struct ContentView: View {
.robotoSlab(size: 12)

MainView()

SampleComponent()
.foregroundStyle(DesignCore.Colors.red300)
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions Projects/App/Sources/Navigation/NavigationStack.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// NavigationStack.swift
// three-days-dev
//
// Created by 김지수 on 9/30/24.
// Copyright © 2024 com.weave. All rights reserved.
//

import SwiftUI
import CommonKit
import SignUp
import DesignPreview

extension PathType {
@ViewBuilder
var view: some View {
switch self {
case .designPreview:
DesignPreviewView()
case .main:
SplashAnimatedView()
case .signUp(let subView):
switch subView {
case .authPhoneInput:
AuthPhoneInputView()
case .authPhoneVerify:
AuthPhoneVerifyView()
case .authAgreement:
AuthAgreementView()
}
}
}
}

extension AppCoordinator {
@ViewBuilder
var rootView: some View {
navigationStack[0].view
}
}
7 changes: 6 additions & 1 deletion Projects/App/Sources/Splash/SplashAnimatedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import SwiftUI
import DesignCore
import CoreKit
import CommonKit

enum SplashAnimationStep: CaseIterable {
case first, second, third, fourth, fifth, sixth
Expand Down Expand Up @@ -113,14 +115,17 @@ struct SplashAnimatedView: View {
isActive: true,
isShowLetter: $showLetterAnimation
) {

AppCoordinator.shared.navigationStack.append(
.signUp(.authPhoneInput)
)
}
.frame(height: 70)
.padding(.horizontal, 50)
.opacity(otherViewOpacity)

Spacer()
}
.toolbar(.hidden, for: .navigationBar)
.textureBackground(animationStep.color)
.task {
await runSingleCycle()
Expand Down
20 changes: 12 additions & 8 deletions Projects/App/Sources/ThreeDaysApp.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import SwiftUI
import DesignCore
import DesignPreview
import CoreKit
import CommonKit
import Main

@main
struct ThreeDaysApp: App {
let coordinator = AppCoordinator.shared
@StateObject var coordinator = AppCoordinator.shared

var body: some Scene {
WindowGroup {
Expand All @@ -23,19 +23,23 @@ struct ThreeDaysApp: App {

@ViewBuilder
var rootView: some View {
switch coordinator.rootView {
case .designPreview:
DesignPreviewView()
case .main:
SplashAnimatedView()
NavigationStack(
path: $coordinator.navigationStack
) {
coordinator.rootView
.navigationDestination(
for: PathType.self
) { feature in
feature.view
}
}
}

#if STAGING || DEBUG
@ViewBuilder
var debugMenuPicker: some View {
Menu("🚀 개발모드") {
ForEach(FeatureType.allCases, id: \.self) { feature in
ForEach(PathType.debugPreviewTypes, id: \.self) { feature in
Button(feature.name) {
coordinator.changeRootView(feature)
}
Expand Down
38 changes: 38 additions & 0 deletions Projects/Core/CommonKit/Sources/AppCoordinator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// AppCoordinator.swift
// CommonKit
//
// Created by 김지수 on 9/18/24.
// Copyright © 2024 com.weave. All rights reserved.
//

import SwiftUI

public final class AppCoordinator: ObservableObject {
//MARK: - Lifecycle
public static var shared = AppCoordinator()
private init() {}

//MARK: - Properties
@Published public var navigationStack: [PathType] = [.main]

//MARK: - Methods
public func changeRootView(_ path: PathType) {
Task {
await MainActor.run {
navigationStack = [path]
}
}
}

@MainActor
public func push(_ path: PathType) {
navigationStack.append(path)
}

@MainActor
public func pop() {
guard navigationStack.count > 1 else { return }
navigationStack.removeLast()
}
}
42 changes: 42 additions & 0 deletions Projects/Core/CommonKit/Sources/Path/PathTypes.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// PathTypes.swift
// CommonKit
//
// Created by 김지수 on 9/18/24.
// Copyright © 2024 com.weave. All rights reserved.
//

import Foundation

public enum PathType: Hashable {
case designPreview
case main
case signUp(SignUpSubViewType)

#if STAGING || DEBUG
public static var debugPreviewTypes: [PathType] = [
.designPreview,
.main,
.signUp(.authPhoneInput)
]
#endif

public var name: String {
switch self {
case .designPreview: return "Design Preview"
case .main: return "메인"
case .signUp(let subType):
switch subType {
case .authPhoneInput: return "전화번호 입력"
case .authPhoneVerify: return "전화번호 인증"
case .authAgreement: return "이용 약관"
}
}
}
}

public enum SignUpSubViewType: Hashable {
case authPhoneInput
case authPhoneVerify
case authAgreement
}
23 changes: 0 additions & 23 deletions Projects/Core/CoreKit/Sources/AppCoordinator.swift

This file was deleted.

21 changes: 0 additions & 21 deletions Projects/Core/CoreKit/Sources/FeatureTypes.swift

This file was deleted.

10 changes: 8 additions & 2 deletions Projects/Core/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ let project: Project = .make(
.make(target: .coreKit),
.make(target: .model),
.make(
target: .networkKit,
target: .commonKit,
dependencies: [
.target(name: .coreKit),
.target(name: .model),
.target(name: .model)
]
),
.make(
target: .networkKit,
dependencies: [
.target(name: .commonKit),
.external(.alamofire),
.external(.openapiGenerated)
]
Expand Down
10 changes: 0 additions & 10 deletions Projects/DesignSystem/ComponentsKit/Sources/temp.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "left_arrow.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.
Loading

0 comments on commit 4c2f234

Please sign in to comment.