콘텐츠 메인 - 배너 광고 추가

This commit is contained in:
Yu Sung 2023-09-15 17:59:23 +09:00
parent b1773b117d
commit 1c4503bda1
2 changed files with 24 additions and 1 deletions

View File

@ -6,6 +6,7 @@
//
import SwiftUI
import GoogleMobileAds
struct ContentMainCurationView: View {
@ -16,6 +17,15 @@ struct ContentMainCurationView: View {
ForEach(0..<items.count, id: \.self) {
let item = items[$0]
ContentMainCurationItemView(item: item)
.padding(.horizontal, 13.3)
if $0 % 2 != 0 {
BannerAdView(adUnitId: CURATION_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
}
}
}
}

View File

@ -6,6 +6,7 @@
//
import SwiftUI
import GoogleMobileAds
import RefreshableScrollView
struct ContentMainView: View {
@ -27,20 +28,31 @@ struct ContentMainView: View {
.font(.custom(Font.bold.rawValue, size: 21.3))
.foregroundColor(Color(hex: "9970ff"))
.padding(.bottom, 26.7)
.padding(.horizontal, 13.3)
if viewModel.newContentUploadCreatorList.count > 0 {
ContentMainNewContentCreatorView(items: viewModel.newContentUploadCreatorList)
.padding(.bottom, 26.7)
.padding(.horizontal, 13.3)
}
if viewModel.bannerList.count > 0 {
ContentMainBannerView(items: viewModel.bannerList)
.padding(.bottom, 40)
.padding(.horizontal, 13.3)
}
BannerAdView(adUnitId: CURATION_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
.padding(.bottom, 40)
if viewModel.orderList.count > 0 {
ContentMainMyStashView(items: viewModel.orderList)
.padding(.bottom, 40)
.padding(.horizontal, 13.3)
}
ContentMainNewContentView(
@ -49,6 +61,7 @@ struct ContentMainView: View {
selectTheme: { viewModel.selectedTheme = $0 },
selectedTheme: $viewModel.selectedTheme
)
.padding(.horizontal, 13.3)
if viewModel.curationList.count > 0 {
ContentMainCurationView(items: viewModel.curationList)
@ -56,7 +69,7 @@ struct ContentMainView: View {
.padding(.bottom, 20)
}
}
.padding(13.3)
.padding(.vertical, 13.3)
}
if UserDefaults.string(forKey: .role) == MemberRole.CREATOR.rawValue {