라이브 게스트

- 본인이 스피커일 때 리스너로 변경하는 버튼 추가
This commit is contained in:
Yu Sung 2024-03-15 00:56:49 +09:00
parent 68cc99c263
commit e95d152e45
3 changed files with 17 additions and 2 deletions

View File

@ -20,7 +20,7 @@ struct LiveRoomOverlayStrokeTextButton: View {
var body: some View { var body: some View {
Text(text) Text(text)
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color.red) .foregroundColor(textColor)
.padding(.horizontal, 8) .padding(.horizontal, 8)
.padding(.vertical, 6) .padding(.vertical, 6)
.overlay( .overlay(

View File

@ -35,6 +35,7 @@ struct LiveRoomInfoGuestView: View {
let onClickNotice: () -> Void let onClickNotice: () -> Void
let onClickMenuPan: () -> Void let onClickMenuPan: () -> Void
let onClickTotalDonation: () -> Void let onClickTotalDonation: () -> Void
let onClickChangeListener: () -> Void
var body: some View { var body: some View {
ZStack { ZStack {
@ -50,6 +51,16 @@ struct LiveRoomInfoGuestView: View {
Spacer() Spacer()
if speakerList.contains(where: { $0.id == UserDefaults.int(forKey: .userId)}) {
LiveRoomOverlayStrokeTextButton(
text: "리스너 변경",
textColor: Color.grayee,
strokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickChangeListener() }
}
LiveRoomOverlayStrokeTextToggleButton( LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnBg, isOn: isOnBg,
onText: "배경 ON", onText: "배경 ON",
@ -205,7 +216,8 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider {
onClickProfile: { _ in }, onClickProfile: { _ in },
onClickNotice: {}, onClickNotice: {},
onClickMenuPan: {}, onClickMenuPan: {},
onClickTotalDonation: {} onClickTotalDonation: {},
onClickChangeListener: {}
) )
} }
} }

View File

@ -113,6 +113,9 @@ struct LiveRoomViewV2: View {
}, },
onClickTotalDonation: { onClickTotalDonation: {
viewModel.isShowDonationRankingPopup = true viewModel.isShowDonationRankingPopup = true
},
onClickChangeListener: {
viewModel.setListener()
} }
) )
} }