라이브 전체보기 그리드 레이아웃 조정
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user