feat(yandex-ads): 시리즈 홈과 요일별 화면에 배너를 추가한다

This commit is contained in:
Yu Sung
2026-04-28 13:58:39 +09:00
parent ddd82b6b8f
commit b269a356e1
2 changed files with 29 additions and 23 deletions

View File

@@ -61,31 +61,35 @@ struct SeriesMainDayOfWeekView: View {
let gridSpacing: CGFloat = 16 let gridSpacing: CGFloat = 16
let width = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2 let width = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
LazyVGrid( VStack(spacing: 16) {
columns: Array( YandexInlineBannerView(placement: .seriesMainDayOfWeek, horizontalPadding: 24)
repeating: GridItem(
.flexible(), LazyVGrid(
spacing: gridSpacing, columns: Array(
alignment: .topLeading repeating: GridItem(
.flexible(),
spacing: gridSpacing,
alignment: .topLeading
),
count: 2
), ),
count: 2 alignment: .leading,
), spacing: gridSpacing
alignment: .leading, ) {
spacing: gridSpacing ForEach(viewModel.seriesList.indices, id: \.self) { index in
) { let item = viewModel.seriesList[index]
ForEach(viewModel.seriesList.indices, id: \.self) { index in SeriesMainItemView(item: item, width: width, height: width * 227 / 160)
let item = viewModel.seriesList[index] .contentShape(Rectangle())
SeriesMainItemView(item: item, width: width, height: width * 227 / 160) .onAppear {
.contentShape(Rectangle()) if index == viewModel.seriesList.count - 1 {
.onAppear { viewModel.getDayOfWeekSeriesList(dayOfWeek: dayOfWeek)
if index == viewModel.seriesList.count - 1 { }
viewModel.getDayOfWeekSeriesList(dayOfWeek: dayOfWeek)
} }
} .onTapGesture { AppState.shared.setAppStep(step: .seriesDetail(seriesId: item.seriesId)) }
.onTapGesture { AppState.shared.setAppStep(step: .seriesDetail(seriesId: item.seriesId)) } }
} }
.padding(.horizontal, horizontalPadding)
} }
.padding(.horizontal, horizontalPadding)
} }
} }
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2) .sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)

View File

@@ -55,6 +55,8 @@ struct SeriesMainHomeView: View {
} }
} }
YandexInlineBannerView(placement: .seriesMainHome, horizontalPadding: 24)
if !viewModel.recommendSeriesList.isEmpty { if !viewModel.recommendSeriesList.isEmpty {
VStack(alignment: .leading, spacing: 16) { VStack(alignment: .leading, spacing: 16) {
HStack(spacing: 0) { HStack(spacing: 0) {