sodalive-ios/SodaLive/Sources/Content/Detail/ContentDetailCreatorProfile...

44 lines
1.2 KiB
Swift

//
// ContentDetailCreatorProfileView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
import Kingfisher
struct ContentDetailCreatorProfileView: View {
let creator: AudioContentCreator
let onClickFollow: (Int) -> Void
let onClickUnFollow: (Int) -> Void
var body: some View {
HStack(spacing: 0) {
KFImage(URL(string: creator.profileImageUrl))
.resizable()
.frame(width: 26.7, height: 26.7)
.clipShape(Circle())
Text(creator.nickname)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color.gray77)
.padding(.horizontal, 5.3)
Spacer()
if creator.creatorId != UserDefaults.int(forKey: .userId) {
Image(creator.isFollowing ? "btn_following_big" : "btn_follow_big")
.onTapGesture {
if creator.isFollowing {
onClickUnFollow(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
}
}
}
}
}