라이브 전체보기 그리드 레이아웃 조정

This commit is contained in:
Yu Sung
2026-01-30 16:42:00 +09:00
parent ed9c2d9d32
commit 26f67028cf
3 changed files with 28 additions and 9 deletions

View File

@@ -11,6 +11,18 @@ import Kingfisher
struct LiveNowItemView: View {
let item: GetRoomListResponse
let itemWidth: CGFloat?
private let defaultWidth: CGFloat = 144
private let defaultHeight: CGFloat = 204
private var resolvedWidth: CGFloat {
itemWidth ?? defaultWidth
}
private var resolvedHeight: CGFloat {
resolvedWidth * defaultHeight / defaultWidth
}
var body: some View {
ZStack(alignment: .top) {
@@ -93,7 +105,7 @@ struct LiveNowItemView: View {
}
}
.padding(10)
.frame(width: 144, height: 204, alignment: .top)
.frame(width: resolvedWidth, height: resolvedHeight, alignment: .top)
.background(Color(hex: "263238"))
.cornerRadius(16)
}
@@ -119,7 +131,8 @@ struct LiveNowItemView_Previews: PreviewProvider {
creatorId: 19,
isReservation: false,
isPrivateRoom: false
)
),
itemWidth: 144
)
}
}