feat(creator): 채널 타이틀 바를 분리한다

This commit is contained in:
Yu Sung
2026-07-02 16:41:00 +09:00
parent 949c8cec8e
commit cd55b3e2f5
4 changed files with 158 additions and 46 deletions

View File

@@ -30,52 +30,27 @@ struct CreatorChannelView: View {
}
private var titleBar: some View {
HStack(spacing: 12) {
Button {
CreatorChannelTitleBar(
isFollow: viewModel.response?.creator.isFollow ?? false,
isNotify: viewModel.response?.creator.isNotify ?? false,
backgroundProgress: 1,
onTapBack: {
dismiss()
} label: {
Image(systemName: "chevron.left")
.foregroundColor(.white)
.frame(width: 44, height: 44)
}
Spacer()
if let creator = viewModel.response?.creator {
Button {
if creator.isFollow {
viewModel.creatorFollow(follow: false, notify: false)
} else {
viewModel.creatorFollow(follow: true, notify: true)
}
} label: {
Text(creator.isFollow ? I18n.CreatorChannelHome.following : I18n.CreatorChannelHome.follow)
.font(.system(size: 13, weight: .semibold))
.foregroundColor(creator.isFollow ? .white : .black)
.padding(.horizontal, 12)
.frame(height: 30)
.background(creator.isFollow ? Color.gray33 : Color.soda400)
.clipShape(Capsule())
}
if creator.isFollow {
Button {
if creator.isNotify {
viewModel.creatorFollow(follow: true, notify: false)
} else {
viewModel.creatorFollow(follow: true, notify: true)
}
} label: {
Image(systemName: creator.isNotify ? "bell.fill" : "bell")
.foregroundColor(.white)
.frame(width: 44, height: 44)
}
}
}
}
.frame(height: 56)
.padding(.horizontal, 8)
.background(Color.black)
},
onTapFollow: {
viewModel.creatorFollow(follow: true, notify: true)
},
onTapUnfollow: {
viewModel.creatorFollow(follow: false, notify: false)
},
onTapNotify: {
viewModel.creatorFollow(follow: true, notify: true)
},
onTapUnnotify: {
viewModel.creatorFollow(follow: true, notify: false)
},
onTapMore: {}
)
}
private var tabBar: some View {