feat(home): 장르 크리에이터 섹션을 연결한다
This commit is contained in:
@@ -4,17 +4,23 @@ struct CreatorProfileItem: View {
|
||||
let imageUrl: String?
|
||||
let name: String
|
||||
let subtitle: String?
|
||||
let imageSize: CGSize
|
||||
let spacing: CGFloat
|
||||
let action: (() -> Void)?
|
||||
|
||||
init(
|
||||
imageUrl: String?,
|
||||
name: String,
|
||||
subtitle: String? = nil,
|
||||
imageSize: CGSize = CGSize(width: 72, height: 72),
|
||||
spacing: CGFloat = SodaSpacing.s8,
|
||||
action: (() -> Void)? = nil
|
||||
) {
|
||||
self.imageUrl = imageUrl
|
||||
self.name = name
|
||||
self.subtitle = subtitle
|
||||
self.imageSize = imageSize
|
||||
self.spacing = spacing
|
||||
self.action = action
|
||||
}
|
||||
|
||||
@@ -22,7 +28,7 @@ struct CreatorProfileItem: View {
|
||||
Button {
|
||||
action?()
|
||||
} label: {
|
||||
VStack(alignment: .center, spacing: SodaSpacing.s8) {
|
||||
VStack(alignment: .center, spacing: spacing) {
|
||||
profileImage
|
||||
|
||||
VStack(alignment: .center, spacing: 2) {
|
||||
@@ -48,7 +54,7 @@ struct CreatorProfileItem: View {
|
||||
}
|
||||
|
||||
private var profileImage: some View {
|
||||
DownsampledKFImage(url: URL(string: imageUrl ?? ""), size: CGSize(width: 72, height: 72))
|
||||
DownsampledKFImage(url: URL(string: imageUrl ?? ""), size: imageSize)
|
||||
.background(Color.gray800)
|
||||
.clipShape(Circle())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user