diff --git a/SodaLive/Sources/Live/Room/Create/CreateLiveRoomRequest.swift b/SodaLive/Sources/Live/Room/Create/CreateLiveRoomRequest.swift index 2763b2b..c70f97b 100644 --- a/SodaLive/Sources/Live/Room/Create/CreateLiveRoomRequest.swift +++ b/SodaLive/Sources/Live/Room/Create/CreateLiveRoomRequest.swift @@ -22,4 +22,5 @@ struct CreateLiveRoomRequest: Encodable { var menuPanId: Int = 0 var menuPan: String = "" var isActiveMenuPan: Bool = false + var isAvailableJoinCreator: Bool = true } diff --git a/SodaLive/Sources/Live/Room/Create/LiveRoomCreateView.swift b/SodaLive/Sources/Live/Room/Create/LiveRoomCreateView.swift index 15199c5..c7ef901 100644 --- a/SodaLive/Sources/Live/Room/Create/LiveRoomCreateView.swift +++ b/SodaLive/Sources/Live/Room/Create/LiveRoomCreateView.swift @@ -147,6 +147,23 @@ struct LiveRoomCreateView: View { .frame(width: screenSize().width - 26.7) .padding(.top, 33.3) + VStack(spacing: 13.3) { + Text("크리에이터 입장 설정") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color.grayee) + .frame(width: screenSize().width - 26.7, alignment: .leading) + + HStack(spacing: 13.3) { + SelectedButtonView(title: "가능", isActive: true, isSelected: viewModel.isAvailableJoinCreator) + .onTapGesture { viewModel.isAvailableJoinCreator = true } + + SelectedButtonView(title: "불가능", isActive: true, isSelected: !viewModel.isAvailableJoinCreator) + .onTapGesture { viewModel.isAvailableJoinCreator = false } + } + } + .frame(width: screenSize().width - 26.7) + .padding(.top, 33.3) + if UserDefaults.bool(forKey: .auth) { AdultSettingView() .frame(width: screenSize().width - 26.7) diff --git a/SodaLive/Sources/Live/Room/Create/LiveRoomCreateViewModel.swift b/SodaLive/Sources/Live/Room/Create/LiveRoomCreateViewModel.swift index 0f12412..1c8d541 100644 --- a/SodaLive/Sources/Live/Room/Create/LiveRoomCreateViewModel.swift +++ b/SodaLive/Sources/Live/Room/Create/LiveRoomCreateViewModel.swift @@ -88,6 +88,8 @@ final class LiveRoomCreateViewModel: ObservableObject { @Published var isActivateMenu = false @Published var selectedMenu: SelectedMenu? = nil + @Published var isAvailableJoinCreator = true + private let repository = LiveRepository() private var subscription = Set() @@ -178,7 +180,8 @@ final class LiveRoomCreateViewModel: ObservableObject { password: (roomType == .PRIVATE && !password.trimmingCharacters(in: .whitespaces).isEmpty) ? password : nil, menuPanId: isActivateMenu ? menuId : 0, menuPan: isActivateMenu ? menu : "", - isActiveMenuPan: isActivateMenu + isActiveMenuPan: isActivateMenu, + isAvailableJoinCreator: isAvailableJoinCreator ) if timeSettingMode == .RESERVATION {