feat(home): 홈 추천 콘텐츠 섹션 추가

This commit is contained in:
Yu Sung
2025-11-14 01:24:20 +09:00
parent 0902b1fe30
commit 0fd49a71f6
6 changed files with 106 additions and 2 deletions

View File

@@ -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("""
- 회사명 : 주식회사 소다라이브