하트 랭킹 추가

This commit is contained in:
Yu Sung
2024-11-12 00:33:28 +09:00
parent fb5d7bd209
commit b4f99af291
9 changed files with 349 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ struct LiveRoomInfoGuestView: View {
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickMenuPan: () -> Void
let onClickTotalHeart: () -> Void
let onClickTotalDonation: () -> Void
let onClickChangeListener: () -> Void
let onClickToggleSignature: () -> Void
@@ -179,6 +180,7 @@ struct LiveRoomInfoGuestView: View {
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
.onTapGesture { onClickTotalHeart() }
HStack(spacing: 6.7) {
Image("ic_can")
@@ -260,6 +262,7 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider {
onClickProfile: { _ in },
onClickNotice: {},
onClickMenuPan: {},
onClickTotalHeart: {},
onClickTotalDonation: {},
onClickChangeListener: {},
onClickToggleSignature: {}

View File

@@ -37,6 +37,7 @@ struct LiveRoomInfoHostView: View {
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickMenuPan: () -> Void
let onClickTotalHeart: () -> Void
let onClickTotalDonation: () -> Void
let onClickParticipants: () -> Void
let onClickToggleSignature: () -> Void
@@ -177,6 +178,7 @@ struct LiveRoomInfoHostView: View {
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
.onTapGesture { onClickTotalHeart() }
HStack(spacing: 6.7) {
Image("ic_can")
@@ -269,6 +271,7 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
onClickProfile: { _ in },
onClickNotice: {},
onClickMenuPan: {},
onClickTotalHeart: {},
onClickTotalDonation: {},
onClickParticipants: {},
onClickToggleSignature: {}

View File

@@ -0,0 +1,18 @@
//
// GetLiveRoomHeartListResponse.swift
// SodaLive
//
// Created by klaus on 11/11/24.
//
struct GetLiveRoomHeartListResponse: Decodable {
let heartList: [GetLiveRoomHeartListItem]
let totalCount: Int
let totalHeart: Int
}
struct GetLiveRoomHeartListItem: Decodable {
let profileImage: String
let nickname: String
let heart: Int
}

View File

@@ -64,6 +64,9 @@ struct LiveRoomViewV2: View {
onClickMenuPan: {
viewModel.isShowMenuPan.toggle()
},
onClickTotalHeart: {
viewModel.isShowHeartRankingPopup = true
},
onClickTotalDonation: {
viewModel.isShowDonationRankingPopup = true
},
@@ -119,6 +122,9 @@ struct LiveRoomViewV2: View {
onClickMenuPan: {
viewModel.isShowMenuPan.toggle()
},
onClickTotalHeart: {
viewModel.isShowHeartRankingPopup = true
},
onClickTotalDonation: {
viewModel.isShowDonationRankingPopup = true
},
@@ -747,6 +753,17 @@ struct LiveRoomViewV2: View {
.sheet(isPresented: $viewModel.isShowDonationRankingPopup) {
LiveRoomDonationRankingDialog(isShowing: $viewModel.isShowDonationRankingPopup)
}
.sheet(isPresented: $viewModel.isShowHeartRankingPopup) {
LiveRoomHeartRankingDialog(
isShowing: $viewModel.isShowHeartRankingPopup,
isShowPopup: $viewModel.isShowPopup,
errorMessage: viewModel.errorMessage,
isLoading: viewModel.isLoading,
heartStatus: viewModel.heartStatus
) {
viewModel.getHeartStatus()
}
}
.sheet(isPresented: $viewModel.isShowDonationMessagePopup) {
LiveRoomDonationMessageDialog(viewModel: viewModel, isShowing: $viewModel.isShowDonationMessagePopup)
}