Files
sodalive-ios/SodaLive/Sources/Live/SectionLatestFinishedLiveView.swift
Yu Sung ea733b57e6 라이브 섹션 타이틀 문자열 정리
라이브 관련 섹션 헤더를 한 줄 문구로 통합해 표기 일관성을 높임
2025-12-05 17:20:22 +09:00

65 lines
2.2 KiB
Swift

//
// SectionLatestFinishedLiveView.swift
// SodaLive
//
// Created by klaus on 7/22/25.
//
import SwiftUI
struct SectionLatestFinishedLiveView: View {
let items: [GetLatestFinishedLiveResponse]
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
var body: some View {
VStack(alignment: .leading, spacing: 16) {
HStack(spacing: 0) {
Text("최근 종료한 라이브")
.font(.custom(Font.preBold.rawValue, size: 24))
.foregroundColor(.white)
}
.padding(.horizontal, 24)
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 16) {
ForEach(0..<items.count, id: \.self) {
let item = items[$0]
LatestFinishedLiveItemView(item: item)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared
.setAppStep(step: .creatorDetail(userId: item.memberId))
} else {
AppState.shared
.setAppStep(step: .login)
}
}
}
}
.padding(.horizontal, 24)
}
}
}
}
#Preview {
SectionLatestFinishedLiveView(
items: [
GetLatestFinishedLiveResponse(
memberId: 1,
nickname: "크리에이터 1",
profileImageUrl: "https://cf.sodalive.net/profile/34638/34638-profile-5bfc2bac-3278-48f8-b60c-1294b615f629-8832-1751707083877",
timeAgo: "5분전"
),
GetLatestFinishedLiveResponse(
memberId: 2,
nickname: "크리에이터 2",
profileImageUrl: "https://cf.sodalive.net/profile/34638/34638-profile-5bfc2bac-3278-48f8-b60c-1294b615f629-8832-1751707083877",
timeAgo: "1시간전"
)
]
)
}