55 lines
1.5 KiB
Swift
55 lines
1.5 KiB
Swift
//
|
|
// 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
|
|
}
|
|
}
|
|
}
|