크리에이터 채널 페이지 추가
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// UserProfileContentView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/11.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct UserProfileContentView: View {
|
||||
|
||||
let userId: Int
|
||||
let items: [GetAudioContentListItem]
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text(userId == UserDefaults.int(forKey: .userId) ? "내 콘텐츠" : "콘텐츠")
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("전체보기")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "bbbbbb"))
|
||||
.onTapGesture {}
|
||||
}
|
||||
|
||||
if userId == UserDefaults.int(forKey: .userId) {
|
||||
Text("새로운 콘텐츠 등록하기")
|
||||
.font(.custom(Font.bold.rawValue, size: 15))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.padding(.vertical, 17)
|
||||
.frame(maxWidth: .infinity)
|
||||
.background(Color(hex: "9970ff"))
|
||||
.cornerRadius(5.3)
|
||||
.padding(.top, 21)
|
||||
.onTapGesture { AppState.shared.setAppStep(step: .createContent) }
|
||||
}
|
||||
|
||||
VStack(spacing: 10.7) {
|
||||
ForEach(0..<items.count, id: \.self) { index in
|
||||
let item = items[index]
|
||||
ContentListItemView(item: item)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {}
|
||||
}
|
||||
}
|
||||
.padding(.top, 21)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct UserProfileContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
UserProfileContentView(
|
||||
userId: 0,
|
||||
items: [
|
||||
GetAudioContentListItem(
|
||||
contentId: 25,
|
||||
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
title: "폭우",
|
||||
price: 110,
|
||||
themeStr: "test",
|
||||
duration: "00:04:43",
|
||||
likeCount: 2,
|
||||
commentCount: 0,
|
||||
isAdult: false
|
||||
)
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user