메인 라이브 탭 - 커뮤니티 포스트 영역 추가

This commit is contained in:
Yu Sung
2023-12-21 23:46:22 +09:00
parent 7bd32f8486
commit acdacbfb7b
8 changed files with 128 additions and 6 deletions

View File

@@ -0,0 +1,66 @@
//
// SectionCommunityPostView.swift
// SodaLive
//
// Created by klaus on 2023/12/21.
//
import SwiftUI
struct SectionCommunityPostView: View {
let items: [GetCommunityPostListResponse]
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 13.3) {
ForEach(0..<items.count, id: \.self) { index in
let item = items[index]
CreatorCommunityItemView(item: item)
.frame(width: 320)
.onTapGesture {
AppState.shared
.setAppStep(step: .creatorCommunityAll(creatorId: item.creatorId))
}
}
}
}
}
}
struct SectionCommunityPostView_Previews: PreviewProvider {
static var previews: some View {
SectionCommunityPostView(items: [
GetCommunityPostListResponse(
postId: 1,
creatorId: 1,
creatorNickname: "민하나",
creatorProfileUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
imageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
content: "라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!",
date: "3일전",
isCommentAvailable: false,
isAdult: false,
isLike: true,
likeCount: 10,
commentCount: 0,
firstComment: nil
),
GetCommunityPostListResponse(
postId: 2,
creatorId: 2,
creatorNickname: "닉네임2",
creatorProfileUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
imageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
content: "너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!",
date: "3일전",
isCommentAvailable: false,
isAdult: false,
isLike: true,
likeCount: 20,
commentCount: 0,
firstComment: nil
)
])
}
}