diff --git a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift index 95f864d..3b4a972 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift @@ -119,6 +119,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject { @Published var noticeViewHeight: CGFloat = UIFont.systemFontSize @Published var isBgOn = true + @Published var isSignatureOn = true @Published var donationStatus: GetLiveRoomDonationStatusResponse? @Published private(set) var offset: CGFloat = 0 diff --git a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift index cceea9a..6c8090f 100644 --- a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift +++ b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift @@ -15,6 +15,7 @@ struct LiveRoomInfoGuestView: View { let isOnBg: Bool let isOnNotice: Bool let isOnMenuPan: Bool + let isOnSignature: Bool let isShowMenuPanButton: Bool let creatorId: Int @@ -36,6 +37,7 @@ struct LiveRoomInfoGuestView: View { let onClickMenuPan: () -> Void let onClickTotalDonation: () -> Void let onClickChangeListener: () -> Void + let onClickToggleSignature: () -> Void var body: some View { ZStack { @@ -61,6 +63,18 @@ struct LiveRoomInfoGuestView: View { ) { onClickChangeListener() } } + LiveRoomOverlayStrokeTextToggleButton( + isOn: isOnSignature, + onText: "시그니처 ON", + onTextColor: Color.button, + onStrokeColor: Color.button, + offText: "시그니처 OFF", + offTextColor: Color.graybb, + offStrokeColor: Color.graybb, + strokeWidth: 1, + strokeCornerRadius: 5.3 + ) { onClickToggleSignature() } + LiveRoomOverlayStrokeTextToggleButton( isOn: isOnBg, onText: "배경 ON", @@ -181,6 +195,7 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider { isOnBg: true, isOnNotice: false, isOnMenuPan: false, + isOnSignature: false, isShowMenuPanButton: false, creatorId: 1, creatorNickname: "도화", @@ -217,7 +232,8 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider { onClickNotice: {}, onClickMenuPan: {}, onClickTotalDonation: {}, - onClickChangeListener: {} + onClickChangeListener: {}, + onClickToggleSignature: {} ) } } diff --git a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift index 3c0f892..eee87b4 100644 --- a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift +++ b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift @@ -17,6 +17,7 @@ struct LiveRoomInfoHostView: View { let isOnBg: Bool let isOnNotice: Bool let isOnMenuPan: Bool + let isOnSignature: Bool let isShowMenuPanButton: Bool let creatorId: Int @@ -37,6 +38,7 @@ struct LiveRoomInfoHostView: View { let onClickMenuPan: () -> Void let onClickTotalDonation: () -> Void let onClickParticipants: () -> Void + let onClickToggleSignature: () -> Void var body: some View { ZStack { @@ -52,6 +54,18 @@ struct LiveRoomInfoHostView: View { Spacer() + LiveRoomOverlayStrokeTextToggleButton( + isOn: isOnSignature, + onText: "시그니처 ON", + onTextColor: Color.button, + onStrokeColor: Color.button, + offText: "시그니처 OFF", + offTextColor: Color.graybb, + offStrokeColor: Color.graybb, + strokeWidth: 1, + strokeCornerRadius: 5.3 + ) { onClickToggleSignature() } + LiveRoomOverlayStrokeTextToggleButton( isOn: isOnBg, onText: "배경 ON", @@ -197,6 +211,7 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider { isOnBg: true, isOnNotice: true, isOnMenuPan: false, + isOnSignature: false, isShowMenuPanButton: false, creatorId: 1, creatorNickname: "도화", @@ -232,7 +247,8 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider { onClickNotice: {}, onClickMenuPan: {}, onClickTotalDonation: {}, - onClickParticipants: {} + onClickParticipants: {}, + onClickToggleSignature: {} ) } } diff --git a/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift b/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift index 9b731ba..567d2e6 100644 --- a/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift +++ b/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift @@ -30,6 +30,7 @@ struct LiveRoomViewV2: View { isOnBg: viewModel.isBgOn, isOnNotice: viewModel.isShowNotice, isOnMenuPan: viewModel.isShowMenuPan, + isOnSignature: viewModel.isSignatureOn, isShowMenuPanButton: !liveRoomInfo.menuPan.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, creatorId: liveRoomInfo.creatorId, creatorNickname: liveRoomInfo.creatorNickname, @@ -66,6 +67,9 @@ struct LiveRoomViewV2: View { }, onClickParticipants: { viewModel.isShowProfileList = true + }, + onClickToggleSignature: { + viewModel.isSignatureOn.toggle() } ) } else { @@ -75,6 +79,7 @@ struct LiveRoomViewV2: View { isOnBg: viewModel.isBgOn, isOnNotice: viewModel.isShowNotice, isOnMenuPan: viewModel.isShowMenuPan, + isOnSignature: viewModel.isSignatureOn, isShowMenuPanButton: !liveRoomInfo.menuPan.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty, creatorId: liveRoomInfo.creatorId, creatorNickname: liveRoomInfo.creatorNickname, @@ -116,6 +121,9 @@ struct LiveRoomViewV2: View { }, onClickChangeListener: { viewModel.setListener() + }, + onClickToggleSignature: { + viewModel.isSignatureOn.toggle() } ) } @@ -258,7 +266,7 @@ struct LiveRoomViewV2: View { }.padding(.bottom, 70) } - if viewModel.signatureImageUrl.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 { + if viewModel.isSignatureOn && viewModel.signatureImageUrl.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 { VStack { Spacer() @@ -273,7 +281,7 @@ struct LiveRoomViewV2: View { } } - if let signature = viewModel.signature { + if let signature = viewModel.signature, viewModel.isSignatureOn { VStack { Spacer()