feat(channel): 공유 진입점을 연결한다
This commit is contained in:
@@ -5,6 +5,7 @@ struct CreatorChannelTitleBar: View {
|
||||
let isFollow: Bool
|
||||
let isNotify: Bool
|
||||
let backgroundProgress: CGFloat
|
||||
let showsTrailingActions: Bool
|
||||
let showsCreatorActions: Bool
|
||||
let onTapBack: () -> Void
|
||||
let onTapFollow: () -> Void
|
||||
@@ -12,24 +13,28 @@ struct CreatorChannelTitleBar: View {
|
||||
let onTapNotify: () -> Void
|
||||
let onTapUnnotify: () -> Void
|
||||
let onTapMore: () -> Void
|
||||
let onTapShare: () -> Void
|
||||
|
||||
init(
|
||||
nickname: String,
|
||||
isFollow: Bool,
|
||||
isNotify: Bool,
|
||||
backgroundProgress: CGFloat,
|
||||
showsTrailingActions: Bool = true,
|
||||
showsCreatorActions: Bool = true,
|
||||
onTapBack: @escaping () -> Void,
|
||||
onTapFollow: @escaping () -> Void,
|
||||
onTapUnfollow: @escaping () -> Void,
|
||||
onTapNotify: @escaping () -> Void,
|
||||
onTapUnnotify: @escaping () -> Void,
|
||||
onTapMore: @escaping () -> Void
|
||||
onTapMore: @escaping () -> Void,
|
||||
onTapShare: @escaping () -> Void = {}
|
||||
) {
|
||||
self.nickname = nickname
|
||||
self.isFollow = isFollow
|
||||
self.isNotify = isNotify
|
||||
self.backgroundProgress = backgroundProgress
|
||||
self.showsTrailingActions = showsTrailingActions
|
||||
self.showsCreatorActions = showsCreatorActions
|
||||
self.onTapBack = onTapBack
|
||||
self.onTapFollow = onTapFollow
|
||||
@@ -37,6 +42,7 @@ struct CreatorChannelTitleBar: View {
|
||||
self.onTapNotify = onTapNotify
|
||||
self.onTapUnnotify = onTapUnnotify
|
||||
self.onTapMore = onTapMore
|
||||
self.onTapShare = onTapShare
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -56,22 +62,32 @@ struct CreatorChannelTitleBar: View {
|
||||
.opacity(backgroundProgress >= 1 ? 1 : 0)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
if showsCreatorActions {
|
||||
HStack(spacing: SodaSpacing.s14) {
|
||||
followButton
|
||||
if showsTrailingActions {
|
||||
if showsCreatorActions {
|
||||
HStack(spacing: SodaSpacing.s14) {
|
||||
followButton
|
||||
|
||||
if isFollow {
|
||||
notifyButton
|
||||
if isFollow {
|
||||
notifyButton
|
||||
}
|
||||
|
||||
Button(action: onTapMore) {
|
||||
Image("ic_new_more")
|
||||
.resizable()
|
||||
.frame(width: 24, height: 24)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
Button(action: onTapMore) {
|
||||
Image("ic_new_more")
|
||||
.layoutPriority(1)
|
||||
} else {
|
||||
Button(action: onTapShare) {
|
||||
Image("ic_audio_content_share")
|
||||
.resizable()
|
||||
.frame(width: 24, height: 24)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(I18n.CreatorChannelHome.channelShare)
|
||||
}
|
||||
.layoutPriority(1)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, SodaSpacing.s14)
|
||||
|
||||
Reference in New Issue
Block a user