라이브 방 추가
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// LiveRoomDonationRankingDialog.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/15.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct LiveRoomDonationRankingDialog: View {
|
||||
|
||||
@Binding var isShowing: Bool
|
||||
@StateObject var viewModel = LiveRoomViewModel()
|
||||
|
||||
let columns = [GridItem(.flexible())]
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text("현재 라이브 후원랭킹")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Spacer()
|
||||
|
||||
Image("ic_close_white")
|
||||
.onTapGesture { isShowing = false }
|
||||
}
|
||||
|
||||
if let donationStatus = viewModel.donationStatus {
|
||||
LiveRoomDonationRankingTotalCanView(totalCan: donationStatus.totalCan)
|
||||
.padding(.top, 25)
|
||||
|
||||
HStack(spacing: 0) {
|
||||
Text("전체")
|
||||
.font(.custom(Font.medium.rawValue, size: 14.7))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Text("\(donationStatus.totalCount)")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.padding(.leading, 6.7)
|
||||
|
||||
Text("명")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.top, 13.3)
|
||||
|
||||
ScrollView(showsIndicators: false) {
|
||||
LazyVGrid(columns: columns, spacing: 0) {
|
||||
ForEach(0..<donationStatus.donationList.count, id: \.self) { index in
|
||||
let item = donationStatus.donationList[index]
|
||||
LiveRoomDonationRankingItemView(
|
||||
index: index,
|
||||
item: item,
|
||||
itemCount: donationStatus.donationList.count
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
}
|
||||
}
|
||||
.padding(20)
|
||||
.background(Color(hex: "222222"))
|
||||
.cornerRadius(8)
|
||||
|
||||
if viewModel.isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(viewModel.errorMessage)
|
||||
.padding(.vertical, 13.3)
|
||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color(hex: "9970ff"))
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.cornerRadius(20)
|
||||
.padding(.bottom, 66.7)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getDonationStatus()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user