sodalive-ios/SodaLive/Sources/Live/Room/LiveRoomTopCreatorView.swift

46 lines
1.2 KiB
Swift

//
// LiveRoomTopCreatorView.swift
// SodaLive
//
// Created by klaus on 2023/08/14.
//
import SwiftUI
import Kingfisher
struct LiveRoomTopCreatorView: View {
let creatorId: Int
var nickname: String
var profileImageUrl: String
var isFollowing: Bool
var onClickProfile: () -> Void
var onClickFollow: (Bool) -> Void
var body: some View {
HStack(spacing: 5.3) {
KFImage(URL(string: profileImageUrl))
.resizable()
.scaledToFill()
.frame(width: 33.3, height: 33.3)
.clipShape(Circle())
.contentShape(Circle())
.onTapGesture { onClickProfile() }
Image("ic_crown")
Text(nickname)
.font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(Color(hex: "eeeeee"))
if creatorId != UserDefaults.int(forKey: .userId) {
Image(isFollowing ? "btn_following" : "btn_follow")
.contentShape(Rectangle())
.onTapGesture { onClickFollow(isFollowing) }
.padding(.leading, 13.3)
}
}
}
}