feat(chat): 채팅 탭 추가 및 캐릭터/톡 내부 탭 구현
- ChatTabView 신설: 앱 바 + 내부 탭(캐릭터/톡) 전환 구성 - 커스텀 탭 적용 - indicatorHeight: 4, indicatorColor: #3bb9f1 - tabText color: #b0bec5 - 폰트: 선택 전 Pretendard-Regular, 선택 후 Pretendard-Bold - HomeView/BottomTabView에 ChatTabView 연동 - CharacterView/TalkView 플레이스홀더 추가
This commit is contained in:
@@ -13,7 +13,7 @@ struct BottomTabView: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
let tabWidth = width / 3
|
||||
let tabWidth = width / 4
|
||||
|
||||
TabButton(
|
||||
title: "홈",
|
||||
@@ -40,6 +40,31 @@ struct BottomTabView: View {
|
||||
width: tabWidth
|
||||
)
|
||||
|
||||
TabButton(
|
||||
title: "채팅",
|
||||
action: {
|
||||
if currentTab != .chat {
|
||||
currentTab = .chat
|
||||
}
|
||||
},
|
||||
image: {
|
||||
currentTab == .chat ?
|
||||
"ic_chat_selected" :
|
||||
"ic_chat"
|
||||
},
|
||||
fontName: {
|
||||
currentTab == .chat ?
|
||||
Font.bold.rawValue :
|
||||
Font.medium.rawValue
|
||||
},
|
||||
color: {
|
||||
currentTab == .chat ?
|
||||
Color.button :
|
||||
Color.graybb
|
||||
},
|
||||
width: tabWidth
|
||||
)
|
||||
|
||||
TabButton(
|
||||
title: "라이브",
|
||||
action: {
|
||||
|
||||
@@ -19,6 +19,7 @@ struct HomeView: View {
|
||||
|
||||
private let liveView = LiveView()
|
||||
private let homeTabView = HomeTabView()
|
||||
private let chatTabView = ChatTabView()
|
||||
|
||||
@State private var isShowPlayer = false
|
||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||
@@ -32,6 +33,10 @@ struct HomeView: View {
|
||||
.frame(width: viewModel.currentTab == .home ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .home ? 1.0 : 0.01)
|
||||
|
||||
chatTabView
|
||||
.frame(width: viewModel.currentTab == .chat ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .chat ? 1.0 : 0.01)
|
||||
|
||||
liveView
|
||||
.frame(width: viewModel.currentTab == .live ? proxy.size.width : 0)
|
||||
.opacity(viewModel.currentTab == .live ? 1.0 : 0.01)
|
||||
|
||||
@@ -18,7 +18,7 @@ final class HomeViewModel: ObservableObject {
|
||||
private let playbackTrackingRepository = PlaybackTrackingRepository()
|
||||
|
||||
enum CurrentTab: String {
|
||||
case home, live, mypage
|
||||
case home, chat, live, mypage
|
||||
}
|
||||
|
||||
@Published var currentTab: CurrentTab = AppState.shared.startTab
|
||||
|
||||
Reference in New Issue
Block a user