From 8cb7287b5d5a53993c87834cea9e3f2d511d6aac Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 24 Mar 2025 09:22:28 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20-=20=ED=95=98=EB=8B=A8=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=ED=83=AD=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/App/AppStep.swift | 2 ++ SodaLive/Sources/ContentView.swift | 3 +++ .../Sources/Main/Home/BottomTabView.swift | 27 +------------------ SodaLive/Sources/Main/Home/HomeView.swift | 11 +++----- .../Sources/Main/Home/HomeViewModel.swift | 2 +- 5 files changed, 11 insertions(+), 34 deletions(-) diff --git a/SodaLive/Sources/App/AppStep.swift b/SodaLive/Sources/App/AppStep.swift index 7913104..684d6af 100644 --- a/SodaLive/Sources/App/AppStep.swift +++ b/SodaLive/Sources/App/AppStep.swift @@ -153,4 +153,6 @@ enum AppStep { case newReplayContentAll case introduceCreatorAll + + case message } diff --git a/SodaLive/Sources/ContentView.swift b/SodaLive/Sources/ContentView.swift index 2d7e7b9..33a40d2 100644 --- a/SodaLive/Sources/ContentView.swift +++ b/SodaLive/Sources/ContentView.swift @@ -233,6 +233,9 @@ struct ContentView: View { case .introduceCreatorAll: ContentMainIntroduceCreatorAllView() + case .message: + MessageView() + default: EmptyView() .frame(width: 0, height: 0, alignment: .topLeading) diff --git a/SodaLive/Sources/Main/Home/BottomTabView.swift b/SodaLive/Sources/Main/Home/BottomTabView.swift index e13217a..6f1e762 100644 --- a/SodaLive/Sources/Main/Home/BottomTabView.swift +++ b/SodaLive/Sources/Main/Home/BottomTabView.swift @@ -13,7 +13,7 @@ struct BottomTabView: View { var body: some View { HStack(spacing: 0) { - let tabWidth = width / 5 + let tabWidth = width / 4 TabButton( title: "콘텐츠", @@ -90,31 +90,6 @@ struct BottomTabView: View { width: tabWidth ) - TabButton( - title: "메시지", - action: { - if currentTab != .message { - currentTab = .message - } - }, - image: { - currentTab == .message ? - "ic_tabbar_message_selected" : - "ic_tabbar_message_normal" - }, - fontName: { - currentTab == .message ? - Font.bold.rawValue : - Font.medium.rawValue - }, - color: { - currentTab == .message ? - Color.button : - Color.graybb - }, - width: tabWidth - ) - TabButton( title: "마이", action: { diff --git a/SodaLive/Sources/Main/Home/HomeView.swift b/SodaLive/Sources/Main/Home/HomeView.swift index d75a51d..03af700 100644 --- a/SodaLive/Sources/Main/Home/HomeView.swift +++ b/SodaLive/Sources/Main/Home/HomeView.swift @@ -22,7 +22,6 @@ struct HomeView: View { private let liveView = LiveView() private let audition = AuditionView() - private let messageView = MessageView() private let contentView = ContentMainTabHomeView() @State private var isShowPlayer = false @@ -44,10 +43,6 @@ struct HomeView: View { .frame(width: viewModel.currentTab == .audition ? proxy.size.width : 0) .opacity(viewModel.currentTab == .audition ? 1.0 : 0.01) - messageView - .frame(width: viewModel.currentTab == .message ? proxy.size.width : 0) - .opacity(viewModel.currentTab == .message ? 1.0 : 0.01) - if viewModel.currentTab == .mypage { MyPageView() } @@ -255,7 +250,7 @@ struct HomeView: View { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { if value > 0 { - viewModel.currentTab = .message + appState.setAppStep(step: .message) } } } @@ -278,7 +273,9 @@ struct HomeView: View { } .onAppear { if appState.pushMessageId > 0 { - viewModel.currentTab = .message + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + appState.setAppStep(step: .message) + } } } } diff --git a/SodaLive/Sources/Main/Home/HomeViewModel.swift b/SodaLive/Sources/Main/Home/HomeViewModel.swift index 9e53078..5a179c0 100644 --- a/SodaLive/Sources/Main/Home/HomeViewModel.swift +++ b/SodaLive/Sources/Main/Home/HomeViewModel.swift @@ -18,7 +18,7 @@ final class HomeViewModel: ObservableObject { private let playbackTrackingRepository = PlaybackTrackingRepository() enum CurrentTab: String { - case content, live, audition, message, mypage + case content, live, audition, mypage } @Published var currentTab: CurrentTab = AppState.shared.startTab