메인 하단 탭 - 라이브, 콘텐츠 순서 변경

This commit is contained in:
Yu Sung 2023-08-20 20:42:14 +09:00
parent a5b954ada2
commit 6bc5356ac1
2 changed files with 26 additions and 26 deletions

View File

@ -15,31 +15,6 @@ struct BottomTabView: View {
HStack(spacing: 0) { HStack(spacing: 0) {
let tabWidth = width / 5 let tabWidth = width / 5
TabButton(
title: "라이브",
action: {
if currentTab != .live {
currentTab = .live
}
},
image: {
currentTab == .live ?
"ic_tabbar_live_selected" :
"ic_tabbar_live_normal"
},
fontName: {
currentTab == .live ?
Font.bold.rawValue :
Font.medium.rawValue
},
color: {
currentTab == .live ?
Color(hex: "9970ff") :
Color(hex: "909090")
},
width: tabWidth
)
TabButton( TabButton(
title: "콘텐츠", title: "콘텐츠",
action: { action: {
@ -65,6 +40,31 @@ struct BottomTabView: View {
width: tabWidth width: tabWidth
) )
TabButton(
title: "라이브",
action: {
if currentTab != .live {
currentTab = .live
}
},
image: {
currentTab == .live ?
"ic_tabbar_live_selected" :
"ic_tabbar_live_normal"
},
fontName: {
currentTab == .live ?
Font.bold.rawValue :
Font.medium.rawValue
},
color: {
currentTab == .live ?
Color(hex: "9970ff") :
Color(hex: "909090")
},
width: tabWidth
)
TabButton( TabButton(
title: "탐색", title: "탐색",
action: { action: {

View File

@ -19,7 +19,7 @@ final class HomeViewModel: ObservableObject {
case content, live, explorer, message, mypage case content, live, explorer, message, mypage
} }
@Published var currentTab: CurrentTab = .live @Published var currentTab: CurrentTab = .content
func pushTokenUpdate(pushToken: String) { func pushTokenUpdate(pushToken: String) {
userRepository.updatePushToken(pushToken: pushToken) userRepository.updatePushToken(pushToken: pushToken)