Files
sodalive-ios/SodaLive/Sources/MyPage/Block/BlockMemberListView.swift
Yu Sung 280e424385 커스텀 폰트 pretendard-medium, gmarket-medium를 사용하고 있던 것을 appFont 모디
파이어를 사용하여 한국어는 pretendard, 그 외에는 시스템 폰트를 사용하도록 수정
2026-01-23 03:09:20 +09:00

90 lines
3.4 KiB
Swift

//
// BlockMemberListView.swift
// SodaLive
//
// Created by klaus on 9/4/24.
//
import SwiftUI
struct BlockMemberListView: View {
@StateObject var viewModel = BlockMemberListViewModel()
var body: some View {
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
DetailNavigationBar(title: String(localized: "차단 리스트"))
HStack(spacing: 0) {
Text("")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
Text(" \(viewModel.totalCount) ")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.mainRed3)
Text("")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
Spacer()
}
.padding(.horizontal, 13.3)
.padding(.top, 6.7)
if viewModel.totalCount > 0 {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 13.3) {
ForEach(0..<viewModel.blockedMemberList.count, id: \.self) { index in
let item = viewModel.blockedMemberList[index]
BlockedMemberListItemView(
item: item,
blockMember: { viewModel.blockMember(userId: $0) },
unBlockMember: { viewModel.unBlockMember(userId: $0) }
)
.padding(.horizontal, 13.3)
.onAppear {
if index == viewModel.blockedMemberList.count - 1 {
viewModel.getBlockedMemberList()
}
}
}
}
.padding(.top, 26.7)
}
} else {
Text("차단한 유저가 없습니다.")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
.frame(maxHeight: .infinity)
}
}
.onAppear {
viewModel.getBlockedMemberList()
}
.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)
.appFont(size: 12, weight: .medium)
.background(Color.button)
.foregroundColor(Color.white)
.multilineTextAlignment(.leading)
.cornerRadius(20)
.padding(.bottom, 66.7)
Spacer()
}
}
}
}
}
#Preview {
BlockMemberListView()
}