feat(home): 홈 추천 콘텐츠 섹션 추가
This commit is contained in:
@@ -327,6 +327,46 @@ struct HomeTabView: View {
|
||||
}
|
||||
}
|
||||
|
||||
if !viewModel.recommendContentList.isEmpty {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
HStack {
|
||||
Text("추천 콘텐츠")
|
||||
.font(.custom(Font.preBold.rawValue, size: 24))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Spacer()
|
||||
|
||||
Image("ic_refresh")
|
||||
.onTapGesture {
|
||||
viewModel.refreshRecommendContents()
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
|
||||
let horizontalPadding: CGFloat = 24
|
||||
let gridSpacing: CGFloat = 16
|
||||
let width = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
|
||||
|
||||
LazyVGrid(
|
||||
columns: Array(
|
||||
repeating: GridItem(
|
||||
.flexible(),
|
||||
spacing: gridSpacing,
|
||||
alignment: .topLeading
|
||||
),
|
||||
count: 2
|
||||
),
|
||||
alignment: .leading,
|
||||
spacing: gridSpacing
|
||||
) {
|
||||
ForEach(viewModel.recommendContentList.indices, id: \.self) { idx in
|
||||
ContentItemView(item: viewModel.recommendContentList[idx], itemSize: width)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, horizontalPadding)
|
||||
}
|
||||
}
|
||||
|
||||
Text("""
|
||||
- 회사명 : 주식회사 소다라이브
|
||||
|
||||
|
||||
Reference in New Issue
Block a user