Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TNT-158] 트레이너 회원가입 UI 및 네비게이션 구현 #30

Merged
merged 12 commits into from
Jan 26, 2025
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "IcnApple.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" : "_Icons Responsive.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "_Icons [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "_Icons [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
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" : "Boom.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" : "ConnectionCompleteBackground.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct TBottomButton: View {
.typographyStyle(.heading4, with: isEnable ? ButtonState.true.textColor : ButtonState.false.textColor)
.padding(.vertical, 20)
.frame(maxWidth: .infinity)
.background(isEnable ? ButtonState.true.textColor : ButtonState.false.textColor)
.background(isEnable ? ButtonState.true.background : ButtonState.false.background)
}
}

Expand Down
8 changes: 6 additions & 2 deletions TnT/Projects/DesignSystem/Sources/Button/TButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ public extension TButton {

var horizontalSize: CGFloat {
switch self {
case .xLarge, .large, .medium, .small, .xSmall:
case .xLarge, .large, .medium:
return 20
case .small:
return 12
case .xSmall:
return 8
}
}

Expand All @@ -236,7 +240,7 @@ public extension TButton {
case .large, .medium:
return .body1Medium
case .small:
return .label1Medium
return .label2Medium
case .xSmall:
return .label2Medium
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public extension ImageResource {
static let icnStarFilled: ImageResource = DesignSystemAsset.icnStarFilled.imageResource
static let icnHeartEmpty: ImageResource = DesignSystemAsset.icnHeartEmpty.imageResource
static let icnHeartFilled: ImageResource = DesignSystemAsset.icnHeartFilled.imageResource
static let icnKakao: ImageResource = DesignSystemAsset.icnKakao.imageResource
static let icnApple: ImageResource = DesignSystemAsset.icnApple.imageResource
}

// MARK: Image
Expand All @@ -50,4 +52,6 @@ public extension ImageResource {
static let imgOnboardingLogin: ImageResource = DesignSystemAsset.imgOnboardingLogin.imageResource
static let imgOnboardingTrainee: ImageResource = DesignSystemAsset.imgOnboardingTrainee.imageResource
static let imgOnboardingTrainer: ImageResource = DesignSystemAsset.imgOnboardingTrainer.imageResource
static let imgBoom: ImageResource = DesignSystemAsset.imgBoom.imageResource
static let imgConnectionCompleteBackground: ImageResource = DesignSystemAsset.imgConnectioncompletebackground.imageResource
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public struct TNavigation: View {
leftAction?()
}

case .Title:
case .Title, .RTextWithTitle:
Rectangle()
.fill(Color.clear)
.frame(width: 32, height: 32)
Expand All @@ -73,6 +73,7 @@ public struct TNavigation: View {
case .LButtonWithTitle(_, let centerTitle),
.LRButtonWithTitle(_, let centerTitle, _),
.LButtonRTextWithTitle(_, let centerTitle, _),
.RTextWithTitle(let centerTitle, _),
.Title(let centerTitle):
Text(centerTitle)
.typographyStyle(.heading4, with: .neutral900)
Expand All @@ -93,7 +94,7 @@ public struct TNavigation: View {
rightAction?()
}

case .LButtonRTextWithTitle(_, _, let rightText):
case .LButtonRTextWithTitle(_, _, let rightText), .RTextWithTitle(_, let rightText):
Text(rightText)
.typographyStyle(.body2Medium, with: .neutral400)
.onTapGesture {
Expand Down Expand Up @@ -136,6 +137,8 @@ public enum TNavigationCase {
case LRButtonWithTitle(leftImage: ImageResource, centerTitle: String, rightImage: ImageResource)
/// 왼쪽 이미지 버튼, 센터 타이틀, 오른쪽 텍스트 버튼
case LButtonRTextWithTitle(leftImage: ImageResource, centerTitle: String, rightText: String)
/// 오른쪽 텍스트 버튼, 센터 타이틀
case RTextWithTitle(centerTitle: String, rightText: String)
/// 타이틀
case Title(centerTitle: String)
/// 왼쪽 이미지
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
//
// OnboardingFeature.swift
// Presentation
//
// Created by 박서연 on 1/24/25.
// Copyright © 2025 yapp25thTeamTnT. All rights reserved.
//

import ComposableArchitecture
import SwiftUI

@Reducer
public struct OnboardingFeature {
@ObservableState
public struct State: Equatable {
public var path = StackState<Path.State>()

public init(path: StackState<Path.State> = StackState<Path.State>()) {
self.path = path
}
}

public enum Action: ViewAction {
/// 뷰에서 일어나는 액션을 처리합니다.(카카오,애플로그인 실행)
case view(View)
/// 뷰를 이동할때 일어나는 액션을 처리합니다.
/// 기존 ViewAction을 Root임을 고려하여 MoveAction으로 구현하였습니다.
case move(MoveAction)
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋네요! 👍👍

case path(StackActionOf<Path>)

@CasePathable
public enum View: Equatable {
case tappedAppleLogin
case tappedKakaoLogin
}

@CasePathable
public enum MoveAction: Equatable {
/// 약관 동의 화면으로 이동
case toTermview
/// 역할 선택화면으로 이동
case toselectRole
/// 이름 입력 화면으로 이동(트레이너/트레이니 공통 화면)
case toRegisterNickname
/// 회원가입 완료 화면으로 이동(트레이너/트레이니 공통 화면)
case toCompleteSignup
/// 트레이너의 초대코드 발급 화면으로 이동
case toMakeInvitationCode
/// 트레이니의 기본 정보 입력 화면으로 이동
case toRegisterUserInfo
/// 트레이니의 pt 수강 목적 입력화면으로 이동
case toRegisterPtPurpose
/// 트레이니의 주의사항 입력화면으로 이동
case toRegisterprecautions
/// 트레이니의 초대코드 입력화면으로 이동
case toRegisterInvitationCode
/// 트레이니의 pt 횟수 및 정보 입력화면으로 이동
case toRegisterPtClassInfo
}
}

public init() {}

public var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case let .view(view):
switch view {
case .tappedAppleLogin:
state.path.append(.term(TermFeature.State()))
return .none
case .tappedKakaoLogin:
state.path.append(.term(TermFeature.State()))
return .none
}

case let .move(move):
switch move {
case .toTermview:
state.path.append(.term(TermFeature.State()))
return .none
case .toselectRole:
state.path.append(.selectRole)
return .none
case .toRegisterNickname:
state.path.append(.registerNickname)
return .none
case .toCompleteSignup:
state.path.append(.completeSignup(TrainerSignUpCompleteFeature.State()))
return .none
case .toMakeInvitationCode:
state.path.append(.makeInvitationCode(MakeInvitationCodeFeature.State()))
return .none
default:
return .none
}

case let .path(action):
switch action {

/// 트레이너 프로필 생성 완료 -> 다음 버튼 tapped
case .element(id: _, action: .completeSignup(.setNavigating)):
state.path.append(.makeInvitationCode(MakeInvitationCodeFeature.State()))
return .none

/// 트레이너의 초대코드 화면 -> 건너뛰기 버튼 tapped
case .element(id: _, action: .makeInvitationCode(.setNavigation)):
// 추후에 홈과 연결
return .none

/// 약관 화면 -> 트레이너/트레이니 선택 화면 이동
case .element(id: _, action: .selectRole):
return .none

default:
return .none
}

default:
return .none
}
}
.forEach(\.path, action: \.path)
}

@Reducer(state: .equatable)
public enum Path {
/// 약관동의뷰
case term(TermFeature)
/// 트레이너/트레이니 선택 뷰
case selectRole
/// 트레이너/트레이니의 이름 입력 뷰
case registerNickname
/// 트레이너/트레이니 회원가입 완료 뷰
case completeSignup(TrainerSignUpCompleteFeature)
/// 트레이너의 초대코드 발급 뷰
case makeInvitationCode(MakeInvitationCodeFeature)
/// 트레이니 기본 정보 입력
case registerUserInfo
/// 트레이니 PT 목적 입력
case registerPtPurpose
/// 트레이니 주의사항 입력
case registerPrecautions
/// 트레이니 코드입력
case registerInvitationCode
/// 트레이니 수업 정보 입력
case registerPtClassInfo
}
}
Loading