-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from YAPP-Github/TNT-208-mainTab
[TNT-208] νΈλ μ΄λ/νΈλ μ΄λ λ©μΈ ν μμ±
- Loading branch information
Showing
24 changed files
with
640 additions
and
292 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ts/DesignSystem/Resources/Assets.xcassets/Icons/icn_feedback_empty.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
...em/Resources/Assets.xcassets/Icons/icn_feedback_empty.imageset/icn_feedback.svg
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ources/Assets.xcassets/Icons/icn_feedback_empty.imageset/icn_feedback_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...ojects/DesignSystem/Resources/Assets.xcassets/Icons/icn_home_empty.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icn_home.svg", | ||
"filename" : "icn_home_empty.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
2 changes: 1 addition & 1 deletion
2
...cons/icn_home_empty.imageset/icn_home.svg β ...cn_home_empty.imageset/icn_home_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...ojects/DesignSystem/Resources/Assets.xcassets/Icons/icn_list_empty.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icn_list.svg", | ||
"filename" : "icn_list_empty.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
6 changes: 0 additions & 6 deletions
6
...signSystem/Resources/Assets.xcassets/Icons/icn_list_empty.imageset/icn_list.svg
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...stem/Resources/Assets.xcassets/Icons/icn_list_empty.imageset/icn_list_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...ects/DesignSystem/Resources/Assets.xcassets/Icons/icn_mypage_empty.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icn_mypage.svg", | ||
"filename" : "icn_mypage_empty.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
|
4 changes: 0 additions & 4 deletions
4
...System/Resources/Assets.xcassets/Icons/icn_mypage_empty.imageset/icn_mypage.svg
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
.../Resources/Assets.xcassets/Icons/icn_mypage_empty.imageset/icn_mypage_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
TnT/Projects/DesignSystem/Sources/Button/TMainTabButton.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// TMainTabButton.swift | ||
// DesignSystem | ||
// | ||
// Created by λ°λ―Όμ on 2/5/25. | ||
// Copyright Β© 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
/// TnT μ± λ΄μμ λ°ν νμ μ¬μ©λλ λ²νΌ μ»΄ν¬λνΈ μ λλ€ | ||
public struct TMainTabButton: View { | ||
let unselectedIcon: ImageResource | ||
let selectedIcon: ImageResource | ||
let text: String | ||
let isSelected: Bool | ||
let action: () -> Void | ||
|
||
public init( | ||
unselectedIcon: ImageResource, | ||
selectedIcon: ImageResource, | ||
text: String, | ||
isSelected: Bool, | ||
action: @escaping () -> Void | ||
) { | ||
self.unselectedIcon = unselectedIcon | ||
self.selectedIcon = selectedIcon | ||
self.text = text | ||
self.isSelected = isSelected | ||
self.action = action | ||
} | ||
|
||
public var body: some View { | ||
Button(action: action) { | ||
VStack(spacing: 4) { | ||
Image(isSelected ? selectedIcon : unselectedIcon) | ||
.resizable() | ||
.frame(width: 24, height: 24) | ||
Text(text) | ||
.typographyStyle( | ||
isSelected ? .label2Bold : .label1Medium, | ||
with: isSelected ? .neutral900 : .neutral400 | ||
) | ||
} | ||
} | ||
.padding(.vertical, 8) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
TnT/Projects/Presentation/Sources/MainTab/Trainee/TraineeMainTabFeature.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// | ||
// TraineeMainTabNavigationFeature.swift | ||
// Presentation | ||
// | ||
// Created by λ°λ―Όμ on 2/4/25. | ||
// Copyright Β© 2025 yapp25thTeamTnT. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import ComposableArchitecture | ||
|
||
@Reducer | ||
public struct TraineeMainTabFeature { | ||
@ObservableState | ||
public enum State: Equatable { | ||
case home(TraineeHomeFeature.State) | ||
case myPage(TraineeMyPageFeature.State) | ||
|
||
/// state caseμ tabinfo μ°κ²° | ||
var tabInfo: TraineeTabInfo { | ||
switch self { | ||
case .home: | ||
return .home | ||
case .myPage: | ||
return .mypage | ||
} | ||
} | ||
|
||
public init() { | ||
self = .home(TraineeHomeFeature.State()) | ||
} | ||
} | ||
|
||
public enum Action: Sendable, ViewAction { | ||
/// λ·°μμ μΌμ΄λλ μ‘μ μ μ²λ¦¬ν©λλ€. | ||
case view(View) | ||
/// νμ νλ©΄μμ μΌμ΄λλ μ‘μ μ μ²λ¦¬ν©λλ€ | ||
case subFeature(SubFeatureAction) | ||
/// νλ©΄ λ€λΉκ²μ΄μ μ€μ | ||
case setNavigating(RoutingScreen) | ||
|
||
@CasePathable | ||
public enum View: Sendable { | ||
/// νλ° μ ν | ||
case selectTab(TraineeTabInfo) | ||
} | ||
|
||
@CasePathable | ||
public enum SubFeatureAction: Sendable { | ||
/// ν νλ©΄μμ λ°μνλ μ‘μ μ²λ¦¬ | ||
case homeAction(TraineeHomeFeature.Action) | ||
/// λ§μ΄νμ΄μ§ νλ©΄μμ λ°μνλ μ‘μ μ²λ¦¬ | ||
case myPageAction(TraineeMyPageFeature.Action) | ||
} | ||
} | ||
|
||
public init() {} | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce { state, action in | ||
switch action { | ||
case let .view(view): | ||
switch view { | ||
case .selectTab(let tab): | ||
switch tab { | ||
case .home: | ||
state = .home(.init()) | ||
return .none | ||
case .mypage: | ||
state = .myPage(.init()) | ||
return .none | ||
} | ||
} | ||
|
||
case .subFeature(let internalAction): | ||
switch internalAction { | ||
case .homeAction(.setNavigating(let screen)): | ||
return .send(.setNavigating(.traineeHome(screen))) | ||
case .myPageAction(.setNavigating(let screen)): | ||
return .send(.setNavigating(.traineeMyPage(screen))) | ||
default: | ||
return .none | ||
} | ||
|
||
case .setNavigating: | ||
return .none | ||
} | ||
} | ||
.ifCaseLet(\.home, action: \.subFeature.homeAction) { | ||
TraineeHomeFeature() | ||
} | ||
.ifCaseLet(\.myPage, action: \.subFeature.myPageAction) { | ||
TraineeMyPageFeature() | ||
} | ||
} | ||
} | ||
|
||
extension TraineeMainTabFeature { | ||
/// νμ νλ©΄μμ νμλλ λΌμ°ν μ μ λ¬ν©λλ€ | ||
public enum RoutingScreen: Sendable { | ||
/// νΈλ μ΄λ ν | ||
case traineeHome(TraineeHomeFeature.RoutingScreen) | ||
/// νΈλ μ΄λ λ§μ΄νμ΄μ§ | ||
case traineeMyPage(TraineeMyPageFeature.RoutingScreen) | ||
} | ||
} |
Oops, something went wrong.