feat(channel): 공유 진입점을 연결한다
This commit is contained in:
@@ -3474,6 +3474,7 @@ If you block this user, the following features will be restricted.
|
||||
}
|
||||
|
||||
enum CreatorChannelHome {
|
||||
static var channelShare: String { pick(ko: "채널 공유", en: "Share channel", ja: "チャンネルを共有") }
|
||||
static var home: String { pick(ko: "홈", en: "Home", ja: "ホーム") }
|
||||
static var live: String { pick(ko: "라이브", en: "Live", ja: "ライブ") }
|
||||
static var currentLive: String { pick(ko: "현재 라이브", en: "Live now", ja: "現在ライブ") }
|
||||
|
||||
@@ -16,6 +16,7 @@ struct ProfileReportMenuView: View {
|
||||
let userUnBlockAction: () -> Void
|
||||
let userReportAction: () -> Void
|
||||
let profileReportAction: () -> Void
|
||||
var channelShareAction: (() -> Void)? = nil
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
@@ -28,6 +29,23 @@ struct ProfileReportMenuView: View {
|
||||
Spacer()
|
||||
|
||||
VStack(spacing: 13.3) {
|
||||
if let channelShareAction = channelShareAction {
|
||||
HStack(spacing: 0) {
|
||||
Text(I18n.CreatorChannelHome.channelShare)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
.foregroundColor(.white)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
.padding(.horizontal, 26.7)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
isShowing = false
|
||||
channelShareAction()
|
||||
}
|
||||
}
|
||||
|
||||
HStack(spacing: 0) {
|
||||
Text(isBlockedUser ? I18n.User.unblockUserAction : I18n.User.blockUserAction)
|
||||
.appFont(size: 13.3, weight: .medium)
|
||||
|
||||
@@ -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,6 +62,7 @@ struct CreatorChannelTitleBar: View {
|
||||
.opacity(backgroundProgress >= 1 ? 1 : 0)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
if showsTrailingActions {
|
||||
if showsCreatorActions {
|
||||
HStack(spacing: SodaSpacing.s14) {
|
||||
followButton
|
||||
@@ -72,6 +79,15 @@ struct CreatorChannelTitleBar: View {
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.layoutPriority(1)
|
||||
} else {
|
||||
Button(action: onTapShare) {
|
||||
Image("ic_audio_content_share")
|
||||
.resizable()
|
||||
.frame(width: 24, height: 24)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(I18n.CreatorChannelHome.channelShare)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, SodaSpacing.s14)
|
||||
|
||||
@@ -192,7 +192,7 @@ struct CreatorChannelView: View {
|
||||
)
|
||||
}
|
||||
|
||||
if viewModel.response != nil && isShowReportMenu {
|
||||
if let creator = viewModel.response?.creator, isShowReportMenu {
|
||||
VStack(spacing: 0) {
|
||||
ProfileReportMenuView(
|
||||
isShowing: $isShowReportMenu,
|
||||
@@ -200,7 +200,10 @@ struct CreatorChannelView: View {
|
||||
userBlockAction: { isShowUserBlockConfirm = true },
|
||||
userUnBlockAction: {},
|
||||
userReportAction: { isShowUserReport = true },
|
||||
profileReportAction: { isShowProfileReport = true }
|
||||
profileReportAction: { isShowProfileReport = true },
|
||||
channelShareAction: {
|
||||
viewModel.shareChannel(creatorId: creator.creatorId, nickname: creator.nickname)
|
||||
}
|
||||
)
|
||||
|
||||
if proxy.safeAreaInsets.bottom > 0 {
|
||||
@@ -246,6 +249,13 @@ struct CreatorChannelView: View {
|
||||
}
|
||||
}
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.sheet(
|
||||
isPresented: $viewModel.isShowShareView,
|
||||
onDismiss: { viewModel.shareMessage = "" },
|
||||
content: {
|
||||
ActivityViewController(activityItems: [viewModel.shareMessage])
|
||||
}
|
||||
)
|
||||
.fullScreenCover(isPresented: $isShowAuthView) {
|
||||
authView
|
||||
}
|
||||
@@ -270,6 +280,7 @@ struct CreatorChannelView: View {
|
||||
isFollow: viewModel.response?.creator.isFollow ?? false,
|
||||
isNotify: viewModel.response?.creator.isNotify ?? false,
|
||||
backgroundProgress: backgroundProgress,
|
||||
showsTrailingActions: viewModel.response != nil,
|
||||
showsCreatorActions: !isOwnCreatorChannel,
|
||||
onTapBack: {
|
||||
dismiss()
|
||||
@@ -288,6 +299,11 @@ struct CreatorChannelView: View {
|
||||
},
|
||||
onTapMore: {
|
||||
isShowReportMenu = true
|
||||
},
|
||||
onTapShare: {
|
||||
if let creator = viewModel.response?.creator {
|
||||
viewModel.shareChannel(creatorId: creator.creatorId, nickname: creator.nickname)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user