fix(profile): 채널 후원 비밀 문구를 분리하고 자기 프로필 후원 버튼을 숨긴다

This commit is contained in:
Yu Sung
2026-02-26 00:44:37 +09:00
parent b84b996059
commit db68aa90d2
6 changed files with 165 additions and 18 deletions

View File

@@ -23,6 +23,9 @@ struct LiveRoomDonationDialogView: View {
@Binding var isShowing: Bool
let isAudioContentDonation: Bool
let messageLimit: Int
let secretLabel: String
let secretMinimumCanMessage: String
let shouldPrefixSecretInMessagePlaceholder: Bool
let onClickDonation: (Int, String, Bool) -> Void
@StateObject var keyboardHandler = KeyboardHandler()
@@ -31,11 +34,17 @@ struct LiveRoomDonationDialogView: View {
isShowing: Binding<Bool>,
isAudioContentDonation: Bool,
messageLimit: Int = 1000,
secretLabel: String = I18n.LiveRoom.secretMissionLabel,
secretMinimumCanMessage: String = I18n.LiveRoom.secretMissionMinimumCanMessage,
shouldPrefixSecretInMessagePlaceholder: Bool = true,
onClickDonation: @escaping (Int, String, Bool) -> Void
) {
self._isShowing = isShowing
self.isAudioContentDonation = isAudioContentDonation
self.messageLimit = messageLimit
self.secretLabel = secretLabel
self.secretMinimumCanMessage = secretMinimumCanMessage
self.shouldPrefixSecretInMessagePlaceholder = shouldPrefixSecretInMessagePlaceholder
self.onClickDonation = onClickDonation
}
@@ -105,7 +114,7 @@ struct LiveRoomDonationDialogView: View {
.resizable()
.frame(width: 20, height: 20)
Text("비밀미션")
Text(secretLabel)
.appFont(size: 14.7, weight: .medium)
.foregroundColor(isSecret ? Color.button : Color.grayee)
}
@@ -217,7 +226,10 @@ struct LiveRoomDonationDialogView: View {
.stroke(Color.graybb, lineWidth: 1)
)
TextField("함께 보낼 \(isSecret ? "비밀 " : "")메시지 입력(최대 \(messageLimit)자)", text: $donationMessage)
TextField(
"함께 보낼 \((isSecret && shouldPrefixSecretInMessagePlaceholder) ? "비밀 " : "")메시지 입력(최대 \(messageLimit)자)",
text: $donationMessage
)
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
.padding(13.3)
@@ -256,7 +268,7 @@ struct LiveRoomDonationDialogView: View {
.onTapGesture {
if !donationCan.trimmingCharacters(in: .whitespaces).isEmpty, let can = Int(donationCan) {
if isSecret && can < 10 {
errorMessage = "비밀 미션은 최소 10캔 이상부터 이용이 가능합니다."
errorMessage = secretMinimumCanMessage
isShowErrorPopup = true
} else if can < 1 {
errorMessage = "1캔 이상 후원하실 수 있습니다."

View File

@@ -3,8 +3,21 @@ import SwiftUI
struct UserProfileChannelDonationView: View {
let creatorId: Int
let donationItems: [GetChannelDonationListItem]
let isShowDonationButton: Bool
let onTapDonationButton: () -> Void
init(
creatorId: Int,
donationItems: [GetChannelDonationListItem],
isShowDonationButton: Bool = true,
onTapDonationButton: @escaping () -> Void
) {
self.creatorId = creatorId
self.donationItems = donationItems
self.isShowDonationButton = isShowDonationButton
self.onTapDonationButton = onTapDonationButton
}
var body: some View {
VStack(alignment: .leading, spacing: 14) {
HStack(spacing: 0) {
@@ -48,22 +61,24 @@ struct UserProfileChannelDonationView: View {
}
}
HStack(spacing: 6.7) {
Image("ic_donation_white")
.resizable()
.frame(width: 20, height: 20)
if isShowDonationButton {
HStack(spacing: 6.7) {
Image("ic_donation_white")
.resizable()
.frame(width: 20, height: 20)
Text(I18n.MemberChannel.channelDonationButton)
.appFont(size: 16, weight: .bold)
.foregroundColor(.white)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 16)
.background(Color(hex: "525252"))
.cornerRadius(16)
.padding(.horizontal, 24)
.onTapGesture {
onTapDonationButton()
Text(I18n.MemberChannel.channelDonationButton)
.appFont(size: 16, weight: .bold)
.foregroundColor(.white)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 16)
.background(Color(hex: "525252"))
.cornerRadius(16)
.padding(.horizontal, 24)
.onTapGesture {
onTapDonationButton()
}
}
}
}

View File

@@ -199,6 +199,7 @@ struct UserProfileView: View {
UserProfileChannelDonationView(
creatorId: creatorProfile.creator.creatorId,
donationItems: creatorProfile.channelDonationList,
isShowDonationButton: creatorProfile.creator.creatorId != UserDefaults.int(forKey: .userId),
onTapDonationButton: {
channelDonationViewModel.setCreatorId(creatorProfile.creator.creatorId, shouldFetch: false)
isShowChannelDonationDialog = true
@@ -439,6 +440,9 @@ struct UserProfileView: View {
isShowing: $isShowChannelDonationDialog,
isAudioContentDonation: false,
messageLimit: 100,
secretLabel: I18n.MemberChannel.secretDonationLabel,
secretMinimumCanMessage: I18n.MemberChannel.secretDonationMinimumCanMessage,
shouldPrefixSecretInMessagePlaceholder: false,
onClickDonation: { can, message, isSecret in
channelDonationViewModel.postChannelDonation(
can: can,

View File

@@ -725,6 +725,18 @@ enum I18n {
)
}
static var secretMissionLabel: String {
pick(ko: "비밀미션", en: "Secret mission", ja: "秘密ミッション")
}
static var secretMissionMinimumCanMessage: String {
pick(
ko: "비밀 미션은 최소 10캔 이상부터 이용이 가능합니다.",
en: "Secret mission is available from at least 10 cans.",
ja: "秘密ミッションは最低10canから利用できます。"
)
}
static var likeHeartNoticeDesc: String {
pick(
ko: "'좋아해요'는 유료 후원입니다.\n클릭시 1캔이 소진됩니다.",
@@ -979,6 +991,14 @@ If you block this user, the following features will be restricted.
static var channelDonationHeader: String { pick(ko: "채널 후원", en: "Channel Donation", ja: "チャンネル支援") }
static var channelDonationButton: String { pick(ko: "채널 후원하기", en: "Donate to Channel", ja: "チャンネルを支援する") }
static var secretDonationLabel: String { pick(ko: "비밀후원", en: "Secret donation", ja: "シークレット支援") }
static var secretDonationMinimumCanMessage: String {
pick(
ko: "비밀 후원은 최소 10캔 이상부터 이용이 가능합니다.",
en: "Secret donation is available from at least 10 cans.",
ja: "シークレット支援は最低10canから利用できます。"
)
}
static var channelDonationEmpty: String { pick(ko: "채널 후원이 없습니다.", en: "No channel donations.", ja: "チャンネル支援はありません。") }
static var channelDonationAllTitle: String { pick(ko: "채널 후원 전체보기", en: "All Channel Donations", ja: "チャンネル支援一覧") }
static var totalLabel: String { pick(ko: "전체", en: "Total", ja: "全体") }