feat: 하단 탭 아이콘 변경
This commit is contained in:
@@ -13,27 +13,27 @@ struct BottomTabView: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
let tabWidth = width / 4
|
||||
let tabWidth = width / 3
|
||||
|
||||
TabButton(
|
||||
title: "콘텐츠",
|
||||
title: "홈",
|
||||
action: {
|
||||
if currentTab != .content {
|
||||
currentTab = .content
|
||||
if currentTab != .home {
|
||||
currentTab = .home
|
||||
}
|
||||
},
|
||||
image: {
|
||||
currentTab == .content ?
|
||||
"ic_tabbar_content_selected" :
|
||||
"ic_tabbar_content_normal"
|
||||
currentTab == .home ?
|
||||
"ic_home_selected" :
|
||||
"ic_home"
|
||||
},
|
||||
fontName: {
|
||||
currentTab == .content ?
|
||||
currentTab == .home ?
|
||||
Font.bold.rawValue :
|
||||
Font.medium.rawValue
|
||||
},
|
||||
color: {
|
||||
currentTab == .content ?
|
||||
currentTab == .home ?
|
||||
Color.button :
|
||||
Color.graybb
|
||||
},
|
||||
@@ -49,8 +49,8 @@ struct BottomTabView: View {
|
||||
},
|
||||
image: {
|
||||
currentTab == .live ?
|
||||
"ic_tabbar_live_selected" :
|
||||
"ic_tabbar_live_normal"
|
||||
"ic_live_selected" :
|
||||
"ic_live"
|
||||
},
|
||||
fontName: {
|
||||
currentTab == .live ?
|
||||
@@ -65,31 +65,6 @@ struct BottomTabView: View {
|
||||
width: tabWidth
|
||||
)
|
||||
|
||||
TabButton(
|
||||
title: "오디션",
|
||||
action: {
|
||||
if currentTab != .audition {
|
||||
currentTab = .audition
|
||||
}
|
||||
},
|
||||
image: {
|
||||
currentTab == .audition ?
|
||||
"ic_tabbar_audition_selected" :
|
||||
"ic_tabbar_audition_normal"
|
||||
},
|
||||
fontName: {
|
||||
currentTab == .audition ?
|
||||
Font.bold.rawValue :
|
||||
Font.medium.rawValue
|
||||
},
|
||||
color: {
|
||||
currentTab == .audition ?
|
||||
Color.button :
|
||||
Color.graybb
|
||||
},
|
||||
width: tabWidth
|
||||
)
|
||||
|
||||
TabButton(
|
||||
title: "마이",
|
||||
action: {
|
||||
@@ -99,8 +74,8 @@ struct BottomTabView: View {
|
||||
},
|
||||
image: {
|
||||
currentTab == .mypage ?
|
||||
"ic_tabbar_my_selected" :
|
||||
"ic_tabbar_my_normal"
|
||||
"ic_my_selected" :
|
||||
"ic_my"
|
||||
},
|
||||
fontName: {
|
||||
currentTab == .mypage ?
|
||||
|
||||
@@ -18,7 +18,6 @@ struct HomeView: View {
|
||||
@StateObject var contentPlayerPlayManager = ContentPlayerPlayManager.shared
|
||||
|
||||
private let liveView = LiveView()
|
||||
private let audition = AuditionView()
|
||||
private let contentView = ContentMainTabHomeView()
|
||||
|
||||
@State private var isShowPlayer = false
|
||||
@@ -30,17 +29,13 @@ struct HomeView: View {
|
||||
VStack(spacing: 0) {
|
||||
ZStack {
|
||||
contentView
|
||||
.frame(width: viewModel.currentTab == .content ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .content ? 1.0 : 0.01)
|
||||
.frame(width: viewModel.currentTab == .home ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .home ? 1.0 : 0.01)
|
||||
|
||||
liveView
|
||||
.frame(width: viewModel.currentTab == .live ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .live ? 1.0 : 0.01)
|
||||
|
||||
audition
|
||||
.frame(width: viewModel.currentTab == .audition ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .audition ? 1.0 : 0.01)
|
||||
|
||||
if viewModel.currentTab == .mypage {
|
||||
MyPageView()
|
||||
}
|
||||
|
||||
@@ -18,24 +18,11 @@ final class HomeViewModel: ObservableObject {
|
||||
private let playbackTrackingRepository = PlaybackTrackingRepository()
|
||||
|
||||
enum CurrentTab: String {
|
||||
case content, live, audition, mypage
|
||||
case home, live, mypage
|
||||
}
|
||||
|
||||
@Published var currentTab: CurrentTab = AppState.shared.startTab
|
||||
|
||||
init() {
|
||||
NotificationCenter.default
|
||||
.publisher(for: .didReceiveHomeTab)
|
||||
.compactMap {
|
||||
$0.object as? CurrentTab
|
||||
}
|
||||
.sink { [weak self] currentTab in
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
self?.currentTab = currentTab
|
||||
}
|
||||
.store(in: &subscription)
|
||||
}
|
||||
|
||||
func pushTokenUpdate(pushToken: String) {
|
||||
userRepository.updatePushToken(pushToken: pushToken)
|
||||
.sink { result in
|
||||
|
||||
Reference in New Issue
Block a user