라이브
- 후원 메시지, 룰렛 결과 모든 유저에게 보이도록 수정
This commit is contained in:
		| @@ -9,8 +9,10 @@ import SwiftUI | ||||
|  | ||||
| struct LiveRoomDonationMessageDialog: View { | ||||
|      | ||||
|     @StateObject var viewModel: LiveRoomViewModel | ||||
|     @Binding var isShowing: Bool | ||||
|     @StateObject var viewModel = LiveRoomViewModel() | ||||
|      | ||||
|     @State var creatorId = 0 | ||||
|      | ||||
|     var body: some View { | ||||
|         ZStack { | ||||
| @@ -45,7 +47,7 @@ struct LiveRoomDonationMessageDialog: View { | ||||
|                             ForEach(0..<viewModel.donationMessageList.count, id: \.self) { index in | ||||
|                                 let donationMessage = viewModel.donationMessageList[index] | ||||
|                                  | ||||
|                                 LiveRoomDonationMessageItemView(message: donationMessage) { | ||||
|                                 LiveRoomDonationMessageItemView(message: donationMessage, creatorId: creatorId) { | ||||
|                                     viewModel.deleteDonationMessage(uuid: $0) | ||||
|                                 } | ||||
|                                 .onTapGesture { | ||||
| @@ -79,7 +81,7 @@ struct LiveRoomDonationMessageDialog: View { | ||||
|                     .padding(.vertical, 13.3) | ||||
|                     .frame(width: screenSize().width - 66.7, alignment: .center) | ||||
|                     .font(.custom(Font.medium.rawValue, size: 12)) | ||||
|                     .background(Color(hex: "9970ff")) | ||||
|                     .background(Color.button) | ||||
|                     .foregroundColor(Color.white) | ||||
|                     .multilineTextAlignment(.leading) | ||||
|                     .cornerRadius(20) | ||||
| @@ -89,6 +91,7 @@ struct LiveRoomDonationMessageDialog: View { | ||||
|         } | ||||
|         .onAppear { | ||||
|             viewModel.getDonationMessageList() | ||||
|             creatorId = viewModel.liveRoomInfo?.creatorId ?? 0 | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -10,6 +10,7 @@ import SwiftUI | ||||
| struct LiveRoomDonationMessageItemView: View { | ||||
|      | ||||
|     let message: LiveRoomDonationMessage | ||||
|     let creatorId: Int | ||||
|     let deleteDonationMessage: (String) -> Void | ||||
|      | ||||
|     var body: some View { | ||||
| @@ -32,10 +33,12 @@ struct LiveRoomDonationMessageItemView: View { | ||||
|              | ||||
|             Spacer() | ||||
|              | ||||
|             Image("ic_close_white") | ||||
|                 .resizable() | ||||
|                 .frame(width: 13.3, height: 13.3) | ||||
|                 .onTapGesture { deleteDonationMessage(message.uuid) } | ||||
|             if creatorId == UserDefaults.int(forKey: .userId) { | ||||
|                 Image("ic_close_white") | ||||
|                     .resizable() | ||||
|                     .frame(width: 13.3, height: 13.3) | ||||
|                     .onTapGesture { deleteDonationMessage(message.uuid) } | ||||
|             } | ||||
|         } | ||||
|         .padding(13.3) | ||||
|         .background(message.canMessage.trimmingCharacters(in: .whitespaces).isEmpty ? Color(hex: "c25264").opacity(0.8) : Color.gray33) | ||||
| @@ -51,6 +54,7 @@ struct LiveRoomDonationMessageItemView: View { | ||||
|             canMessage: "10캔을 후원하셨습니다", | ||||
|             donationMessage: "ㅅㅅㅅ" | ||||
|         ), | ||||
|         creatorId: 0, | ||||
|         deleteDonationMessage: { _ in } | ||||
|     ) | ||||
| } | ||||
| @@ -63,6 +67,7 @@ struct LiveRoomDonationMessageItemView: View { | ||||
|             canMessage: "", | ||||
|             donationMessage: "[테스트] 당첨!" | ||||
|         ), | ||||
|         creatorId: 0, | ||||
|         deleteDonationMessage: { _ in } | ||||
|     ) | ||||
| } | ||||
|   | ||||
| @@ -203,18 +203,15 @@ struct LiveRoomViewV2: View { | ||||
|                                             ) | ||||
|                                         } | ||||
|                                          | ||||
|                                         if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) && | ||||
|                                             UserDefaults.string(forKey: .role) == MemberRole.CREATOR.rawValue { | ||||
|                                             LiveRoomRightBottomButton( | ||||
|                                                 imageName: "ic_donation_message_list", | ||||
|                                                 onClick: { viewModel.isShowDonationMessagePopup = true } | ||||
|                                             ) | ||||
|                                         } else { | ||||
|                                             LiveRoomRightBottomButton( | ||||
|                                                 imageName: "ic_donation", | ||||
|                                                 onClick: { viewModel.isShowDonationPopup = true } | ||||
|                                             ) | ||||
|                                         } | ||||
|                                         LiveRoomRightBottomButton( | ||||
|                                             imageName: "ic_donation", | ||||
|                                             onClick: { viewModel.isShowDonationPopup = true } | ||||
|                                         ) | ||||
|                                          | ||||
|                                         LiveRoomRightBottomButton( | ||||
|                                             imageName: "ic_donation_message_list", | ||||
|                                             onClick: { viewModel.isShowDonationMessagePopup = true } | ||||
|                                         ) | ||||
|                                     } | ||||
|                                     .padding(.trailing, 13.3) | ||||
|                                      | ||||
| @@ -668,7 +665,7 @@ struct LiveRoomViewV2: View { | ||||
|             LiveRoomDonationRankingDialog(isShowing: $viewModel.isShowDonationRankingPopup) | ||||
|         } | ||||
|         .sheet(isPresented: $viewModel.isShowDonationMessagePopup) { | ||||
|             LiveRoomDonationMessageDialog(isShowing: $viewModel.isShowDonationMessagePopup) | ||||
|             LiveRoomDonationMessageDialog(viewModel: viewModel, isShowing: $viewModel.isShowDonationMessagePopup) | ||||
|         } | ||||
|     } | ||||
|      | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung