Files
sodalive-ios/SodaLive/Sources/Home/HomeLiveItemView.swift
Yu Sung b8f679d233 fix: 메인 홈
- 콘텐츠 업로드 버튼 추가
2025-07-15 05:06:29 +09:00

89 lines
2.8 KiB
Swift

//
// HomeLiveItemView.swift
// SodaLive
//
// Created by klaus on 7/11/25.
//
import SwiftUI
import Kingfisher
struct HomeLiveItemView: View {
let item: GetRoomListResponse
let onClickItem: (Int) -> Void
var body: some View {
HStack(spacing: 16) {
ZStack(alignment: .bottom) {
ZStack {
KFImage(URL(string: item.creatorProfileImage))
.cancelOnDisappear(true)
.resizable()
.frame(width: 62, height: 62)
.clipShape(Circle())
}
.padding(7)
.overlay {
Circle()
.strokeBorder(lineWidth: 3)
.foregroundColor(.button)
}
Image("img_live")
}
VStack(alignment: .leading, spacing: 4) {
Text(item.creatorNickname)
.font(.custom(Font.preRegular.rawValue, size: 18))
.foregroundColor(.white)
.lineLimit(2)
.truncationMode(.tail)
Text(item.title)
.font(.custom(Font.preRegular.rawValue, size: 16))
.foregroundColor(Color(hex: "B0BEC5"))
.lineLimit(2)
.truncationMode(.tail)
}
}
.padding(.horizontal, 14)
.padding(.vertical, 10)
.frame(width: 282, alignment: .leading)
.background(Color(hex: "2A339D"))
.cornerRadius(999)
.overlay(
RoundedRectangle(cornerRadius: 999)
.strokeBorder(
Color(hex: "FFFFFF"),
lineWidth: 1
)
)
.contentShape(Rectangle())
.onTapGesture { onClickItem(item.roomId) }
}
}
#Preview {
HomeLiveItemView(
item: GetRoomListResponse(
roomId: 1,
title: "네네코 마사로네네코 마사로네네코 마사로네네코 마사로",
content: "테스트",
beginDateTime: "2025-08-10 15:00:00",
numberOfParticipate: 1,
numberOfPeople: 10,
coverImageUrl: "https://cf.sodalive.net/live_room_cover/18038/18038-cover-8c3cb985-733d-4425-8eaf-ef753064d371-2283-1751800412922",
isAdult: false,
price: 0,
tags: [""],
channelName: "",
creatorProfileImage: "https://cf.sodalive.net/profile/34806/34806-profile-49db6b45-bb1e-4dc7-917e-1a614a853f5f-4232-1752158072656",
creatorNickname: "설린",
creatorId: 1,
isReservation: false,
isPrivateRoom: false
)
) { _ in }
}