feat(creator): 커뮤니티 아이템 표시를 통일한다
This commit is contained in:
@@ -3,26 +3,22 @@ import SwiftUI
|
||||
struct CreatorChannelCommunityGridItem: View {
|
||||
let post: CreatorChannelCommunityPostItem
|
||||
let isOwnPost: Bool
|
||||
let onTapPurchase: () -> Void
|
||||
let onTapDetail: () -> Void
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { proxy in
|
||||
ZStack {
|
||||
if isPaidLocked {
|
||||
Button(action: onTapPurchase) {
|
||||
Color.gray400
|
||||
.overlay(paidPriceOverlay)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
Color.gray800
|
||||
.overlay(paidPriceOverlay)
|
||||
} else {
|
||||
tileContent(proxy: proxy)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture(perform: onTapDetail)
|
||||
}
|
||||
}
|
||||
.frame(width: proxy.size.width, height: proxy.size.width)
|
||||
.clipped()
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture(perform: onTapDetail)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
if post.isPinned {
|
||||
Image("ic_pin")
|
||||
@@ -92,3 +88,32 @@ struct CreatorChannelCommunityGridItem: View {
|
||||
return String(content.prefix(18))
|
||||
}
|
||||
}
|
||||
|
||||
struct CreatorChannelCommunityGridItem_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CreatorChannelCommunityGridItem(
|
||||
post: CreatorChannelCommunityPostItem(
|
||||
postId: 1,
|
||||
creatorId: 10,
|
||||
creatorNickname: "크리에이터 이름",
|
||||
creatorProfileUrl: "https://picsum.photos/600",
|
||||
createdAtUtc: "2026-08-10T00:00:00Z",
|
||||
content: "유료 커뮤니티 게시글",
|
||||
imageUrl: nil,
|
||||
audioUrl: nil,
|
||||
price: 30,
|
||||
isCommentAvailable: true,
|
||||
likeCount: 5,
|
||||
commentCount: 2,
|
||||
isPinned: true,
|
||||
existOrdered: false,
|
||||
isLiked: false
|
||||
),
|
||||
isOwnPost: false,
|
||||
onTapDetail: {}
|
||||
)
|
||||
.frame(width: 134, height: 134)
|
||||
.background(Color.black)
|
||||
.previewLayout(.sizeThatFits)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user