팔로잉 채널 전체 리스트 페이지 추가

This commit is contained in:
Yu Sung
2023-08-19 23:14:54 +09:00
parent 633e1bfd92
commit 78f80cebd5
9 changed files with 303 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
//
// FollowCreatorItemView.swift
// SodaLive
//
// Created by klaus on 2023/08/19.
//
import SwiftUI
import Kingfisher
struct FollowCreatorItemView: View {
let creator: GetCreatorFollowingAllListItem
let onClickFollow: (Int) -> Void
let onClickUnFollow: (Int) -> Void
@State private var isFollow = true
var body: some View {
VStack(spacing: 13.3) {
HStack(spacing: 0) {
KFImage(URL(string: creator.profileImageUrl))
.resizable()
.frame(width: 60, height: 60)
.clipShape(Circle())
Text(creator.nickname)
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
.padding(.leading, 13.3)
Spacer()
Image(isFollow ? "btn_notification_selected" : "btn_notification")
.onTapGesture {
if isFollow {
onClickUnFollow(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
isFollow = !isFollow
}
}
Rectangle()
.foregroundColor(Color(hex: "595959"))
.frame(height: 0.5)
}
.onAppear {
isFollow = creator.isFollow
}
}
}