From 3ee2316507760982ca5db7a5ec424491017df8f5 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Sun, 5 Jul 2026 23:12:38 +0900 Subject: [PATCH] =?UTF-8?q?fix(creator):=20=EC=84=A0=ED=83=9D=20=ED=83=AD?= =?UTF-8?q?=EC=9D=84=20=EA=B0=80=EC=9A=B4=EB=8D=B0=20=EC=A0=95=EB=A0=AC?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/CreatorChannelTabBar.swift | 42 +++++++++++-------- .../CreatorChannel/CreatorChannelView.swift | 2 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelTabBar.swift b/SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelTabBar.swift index 4132c3af..2b9e5560 100644 --- a/SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelTabBar.swift +++ b/SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelTabBar.swift @@ -4,26 +4,34 @@ struct CreatorChannelTabBar: View { @Binding var selectedTab: CreatorChannelTab var body: some View { - ScrollView(.horizontal, showsIndicators: false) { - HStack(spacing: 0) { - ForEach(CreatorChannelTab.allCases, id: \.self) { tab in - Button { - selectedTab = tab - } label: { - VStack(spacing: 0) { - Text(tab.title) - .appFont(size: 16, weight: .medium) - .foregroundColor(selectedTab == tab ? Color.white : Color.gray500) - .frame(maxWidth: .infinity, maxHeight: .infinity) + ScrollViewReader { proxy in + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 0) { + ForEach(CreatorChannelTab.allCases, id: \.self) { tab in + Button { + selectedTab = tab + } label: { + VStack(spacing: 0) { + Text(tab.title) + .appFont(size: 16, weight: .medium) + .foregroundColor(selectedTab == tab ? Color.white : Color.gray500) + .frame(maxWidth: .infinity, maxHeight: .infinity) - Rectangle() - .fill(selectedTab == tab ? Color.soda400 : Color.clear) - .frame(height: 3) + Rectangle() + .fill(selectedTab == tab ? Color.soda400 : Color.clear) + .frame(height: 3) + } + .frame(width: 110, height: 52) + .contentShape(Rectangle()) } - .frame(width: 110, height: 52) - .contentShape(Rectangle()) + .buttonStyle(.plain) + .id(tab) } - .buttonStyle(.plain) + } + } + .onChange(of: selectedTab) { tab in + withAnimation { + proxy.scrollTo(tab, anchor: .center) } } } diff --git a/SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift b/SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift index 67f48ccb..b9c2a69f 100644 --- a/SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift +++ b/SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift @@ -313,7 +313,7 @@ struct CreatorChannelView: View { onTapCommunityLike: viewModel.likeCommunityPost ) } else { - CreatorChannelPlaceholderTabView(title: viewModel.selectedTab.title) + EmptyView() } }