feat(explorer): 채널 후원 목록/등록 기능을 추가한다

This commit is contained in:
Yu Sung
2026-02-25 20:57:23 +09:00
parent e9bd1e7396
commit 32d1d970e4
17 changed files with 853 additions and 58 deletions

View File

@@ -22,9 +22,22 @@ struct LiveRoomDonationDialogView: View {
@Binding var isShowing: Bool
let isAudioContentDonation: Bool
let messageLimit: Int
let onClickDonation: (Int, String, Bool) -> Void
@StateObject var keyboardHandler = KeyboardHandler()
init(
isShowing: Binding<Bool>,
isAudioContentDonation: Bool,
messageLimit: Int = 1000,
onClickDonation: @escaping (Int, String, Bool) -> Void
) {
self._isShowing = isShowing
self.isAudioContentDonation = isAudioContentDonation
self.messageLimit = messageLimit
self.onClickDonation = onClickDonation
}
var body: some View {
ZStack {
@@ -204,7 +217,7 @@ struct LiveRoomDonationDialogView: View {
.stroke(Color.graybb, lineWidth: 1)
)
TextField("함께 보낼 \(isSecret ? "비밀 " : "")메시지 입력(최대 1000자)", text: $donationMessage)
TextField("함께 보낼 \(isSecret ? "비밀 " : "")메시지 입력(최대 \(messageLimit)자)", text: $donationMessage)
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
.padding(13.3)
@@ -286,8 +299,8 @@ struct LiveRoomDonationDialogView: View {
}
func limitText() {
if donationMessage.count > 1000 {
donationMessage = String(donationMessage.prefix(1000))
if donationMessage.count > messageLimit {
donationMessage = String(donationMessage.prefix(messageLimit))
}
}
}