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