라이브 입장 메시지 on/off 스위치 추가

- 라이브 정보 수정 가장 아래에 입장 메시지 on/off 스위치 추가
This commit is contained in:
Yu Sung
2025-04-15 13:34:27 +09:00
parent d09ffe1973
commit a7b3c9d5e7
3 changed files with 28 additions and 7 deletions

View File

@@ -16,6 +16,7 @@ struct LiveRoomInfoEditDialog: View {
@State private var title = ""
@State private var notice = ""
@State private var isAdult = false
@State private var isEntryMessageEnabled = true
let placeholder = "라이브 공지를 입력하세요"
@@ -24,19 +25,20 @@ struct LiveRoomInfoEditDialog: View {
let isLoading: Bool
let coverImageUrl: String?
let coverImage: UIImage?
var confirmAction: (String, String, Bool) -> Void
var confirmAction: (String, String, Bool, Bool) -> Void
init(
isShowing: Binding<Bool>,
isShowPhotoPicker: Binding<Bool>,
viewModel: LiveRoomViewModel,
isAdult: Bool,
isEntryMessageEnabled: Bool,
isLoading: Bool,
currentTitle: String,
currentNotice: String,
coverImageUrl: String,
coverImage: UIImage?,
confirmAction: @escaping (String, String, Bool) -> Void
confirmAction: @escaping (String, String, Bool, Bool) -> Void
) {
self._isShowing = isShowing
self._isShowPhotoPicker = isShowPhotoPicker
@@ -44,6 +46,7 @@ struct LiveRoomInfoEditDialog: View {
self._viewModel = StateObject(wrappedValue: viewModel)
self.isLoading = isLoading
self.isAdult = isAdult
self.isEntryMessageEnabled = isEntryMessageEnabled
self.title = currentTitle
self.notice = currentNotice
@@ -159,6 +162,22 @@ struct LiveRoomInfoEditDialog: View {
)
.padding(.top, 33.3)
HStack(spacing: 0) {
Text("입장메시지")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color.grayee)
Spacer()
Image(isEntryMessageEnabled ? "btn_toggle_on_big" : "btn_toggle_off_big")
.resizable()
.frame(width: 33.3, height: 20)
.onTapGesture {
isEntryMessageEnabled.toggle()
}
}
.padding(.top, 33.3)
HStack(spacing: 13.3) {
Text("취소")
.font(.custom(Font.bold.rawValue, size: 18.3))
@@ -187,7 +206,8 @@ struct LiveRoomInfoEditDialog: View {
confirmAction(
title,
notice.trimmingCharacters(in: .whitespacesAndNewlines) != placeholder ? notice : "",
isAdult
isAdult,
isEntryMessageEnabled
)
isShowing = false
}