feat(chat-original): ChatTabView 작품별 탭 및 리스트 UI/API 연동 추가
This commit is contained in:
54
SodaLive/Sources/Chat/Original/OriginalTabItemView.swift
Normal file
54
SodaLive/Sources/Chat/Original/OriginalTabItemView.swift
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// OriginalTabItemView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 9/15/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Kingfisher
|
||||
|
||||
struct OriginalTabItemView: View {
|
||||
|
||||
let item: OriginalWorkListItemResponse
|
||||
let size: CGFloat
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
KFImage(URL(string: item.imageUrl!))
|
||||
.placeholder { Color.gray.opacity(0.2) }
|
||||
.retry(maxCount: 2, interval: .seconds(1))
|
||||
.cancelOnDisappear(true)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: size, height: size * 432 / 306)
|
||||
.clipped()
|
||||
.cornerRadius(16)
|
||||
|
||||
Text(item.title)
|
||||
.font(.custom(Font.preRegular.rawValue, size: 18))
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
|
||||
Text(item.contentType)
|
||||
.font(.custom(Font.preRegular.rawValue, size: 14))
|
||||
.foregroundColor(Color(hex: "78909C"))
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
}
|
||||
.frame(width: size, alignment: .leading)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
OriginalTabItemView(
|
||||
item: OriginalWorkListItemResponse(
|
||||
id: 1,
|
||||
imageUrl: "https://picsum.photos/300",
|
||||
title: "작품제목",
|
||||
contentType: "웹툰"
|
||||
),
|
||||
size: 106
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user