크리에이터 채널 페이지 추가

This commit is contained in:
Yu Sung
2023-08-11 18:33:48 +09:00
parent a167840162
commit a8338e6fea
69 changed files with 4087 additions and 10 deletions

View File

@@ -0,0 +1,130 @@
//
// ContentListItemView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
import Kingfisher
struct ContentListItemView: View {
let item: GetAudioContentListItem
var body: some View {
VStack(spacing: 10) {
HStack(spacing: 0) {
ZStack(alignment: .topLeading) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: 66.7, height: 66.7, alignment: .top)
.clipped()
.cornerRadius(5.3)
if item.isAdult {
Text("19")
.font(.custom(Font.bold.rawValue, size: 11.3))
.foregroundColor(Color.white)
.padding(4)
.background(Color(hex: "e53621"))
.clipShape(Circle())
.padding(.top, 4.3)
.padding(.leading, 4.3)
}
}
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 8) {
Text(item.themeStr)
.font(.custom(Font.medium.rawValue, size: 8))
.foregroundColor(Color(hex: "3bac6a"))
.padding(2.6)
.background(Color(hex: "28312b"))
.cornerRadius(2.6)
Text(item.duration!)
.font(.custom(Font.medium.rawValue, size: 8))
.foregroundColor(Color(hex: "777777"))
.padding(2.6)
.background(Color(hex: "222222"))
.cornerRadius(2.6)
}
Text(item.title)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "d2d2d2"))
.padding(.top, 8)
.padding(.bottom, 10)
HStack(spacing: 13.3) {
HStack(spacing: 6) {
Image("ic_heart")
.resizable()
.frame(width: 13.3, height: 13.3)
Text("\(item.likeCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777"))
}
HStack(spacing: 6) {
Image("ic_message_square_777")
.resizable()
.frame(width: 13.3, height: 13.3)
Text("\(item.commentCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777"))
}
}
}
.padding(.leading, 10.7)
.padding(.top, 8)
.padding(.bottom, 12)
Spacer()
if item.price > 0 {
HStack(spacing: 8) {
Image("ic_coin_w")
.resizable()
.frame(width: 17, height: 17)
Text("\(item.price)")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "909090"))
}
} else {
Text("무료")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "909090"))
}
}
Rectangle()
.frame(height: 0.5)
.foregroundColor(Color(hex: "595959"))
}
.frame(maxWidth: .infinity)
}
}
struct ContentListItemView_Previews: PreviewProvider {
static var previews: some View {
ContentListItemView(
item: 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
)
)
}
}

View File

@@ -32,7 +32,7 @@ struct ContentMainBannerView: View {
case .EVENT:
AppState.shared.setAppStep(step: .eventDetail(event: item.eventItem!))
case .CREATOR:
break
AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId!))
case .LINK:
if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
@@ -53,7 +53,7 @@ struct ContentMainBannerView: View {
case .EVENT:
AppState.shared.setAppStep(step: .eventDetail(event: item.eventItem!))
case .CREATOR:
break
AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId!))
case .LINK:
if let link = item.link, link.trimmingCharacters(in: .whitespaces).count > 0, let url = URL(string: link), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)

View File

@@ -47,7 +47,7 @@ struct ContentMainItemView: View {
.scaledToFill()
.frame(width: 21.3, height: 21.3)
.clipShape(Circle())
.onTapGesture { }
.onTapGesture { AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId)) }
Text(item.creatorNickname)
.font(.custom(Font.medium.rawValue, size: 12))

View File

@@ -26,7 +26,9 @@ struct ContentMainNewContentCreatorItemView: View {
.frame(width: screenSize().width * 0.18)
.lineLimit(1)
}
.onTapGesture {}
.onTapGesture {
AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId))
}
}
}