메인 하단 탭 - 라이브, 콘텐츠 순서 변경
This commit is contained in:
parent
a5b954ada2
commit
6bc5356ac1
|
@ -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: {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue