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캔 이상 후원하실 수 있습니다."