feat(creator): 채널 탭 바를 분리한다
This commit is contained in:
@@ -56,7 +56,6 @@ struct CreatorChannelHeaderSection: View {
|
||||
.padding(.bottom, SodaSpacing.s14)
|
||||
}
|
||||
.frame(width: screenSize().width, height: screenSize().width)
|
||||
.ignoresSafeArea(.container, edges: .top)
|
||||
}
|
||||
|
||||
private var talkButton: some View {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import SwiftUI
|
||||
|
||||
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)
|
||||
|
||||
Rectangle()
|
||||
.fill(selectedTab == tab ? Color.soda400 : Color.clear)
|
||||
.frame(height: 3)
|
||||
}
|
||||
.frame(width: 110, height: 52)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(height: 52)
|
||||
.background(Color.black)
|
||||
.overlay(alignment: .bottom) {
|
||||
Rectangle()
|
||||
.fill(Color.gray900)
|
||||
.frame(height: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct CreatorChannelTabBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CreatorChannelTabBar(selectedTab: .constant(.home))
|
||||
.previewLayout(.sizeThatFits)
|
||||
}
|
||||
}
|
||||
@@ -77,44 +77,46 @@ struct CreatorChannelTitleBar: View {
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
VStack(spacing: SodaSpacing.s16) {
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: false,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
struct CreatorChannelTitleBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack(spacing: SodaSpacing.s16) {
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: false,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: true,
|
||||
isNotify: true,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: true,
|
||||
isNotify: true,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: true,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
CreatorChannelTitleBar(
|
||||
isFollow: true,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
onTapNotify: {},
|
||||
onTapUnnotify: {},
|
||||
onTapMore: {}
|
||||
)
|
||||
}
|
||||
.background(Color.gray)
|
||||
.previewLayout(.sizeThatFits)
|
||||
}
|
||||
.background(Color.gray)
|
||||
.previewLayout(.sizeThatFits)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user