크리에이터 프로필 - 배너 광고 추가

This commit is contained in:
Yu Sung 2023-09-15 18:11:40 +09:00
parent 9a72e21fda
commit f44ef505cf
1 changed files with 90 additions and 69 deletions

View File

@ -6,6 +6,7 @@
// //
import SwiftUI import SwiftUI
import GoogleMobileAds
struct UserProfileView: View { struct UserProfileView: View {
@ -45,6 +46,7 @@ struct UserProfileView: View {
ScrollView(.vertical, showsIndicators: false) { ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 0) { VStack(spacing: 0) {
if let creatorProfile = viewModel.creatorProfile { if let creatorProfile = viewModel.creatorProfile {
VStack(spacing: 0) {
UserProfileCreatorView( UserProfileCreatorView(
creator: creatorProfile.creator) { creator: creatorProfile.creator) {
viewModel.creatorFollow() viewModel.creatorFollow()
@ -87,6 +89,14 @@ struct UserProfileView: View {
viewModel.isExpandNotice.toggle() viewModel.isExpandNotice.toggle()
} }
} }
}
BannerAdView(adUnitId: CREATOR_CHANNEL_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
.padding(.top, 26.7)
if creatorProfile.contentList.count > 0 || if creatorProfile.contentList.count > 0 ||
userId == UserDefaults.int(forKey: .userId) userId == UserDefaults.int(forKey: .userId)
@ -95,7 +105,7 @@ struct UserProfileView: View {
userId: userId, userId: userId,
items: creatorProfile.contentList items: creatorProfile.contentList
) )
.padding(.top, 46.7) .padding(.top, 26.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
} }
@ -123,7 +133,7 @@ struct UserProfileView: View {
} }
} }
) )
.padding(.top, 46.7) .padding(.top, 26.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
} }
@ -153,6 +163,15 @@ struct UserProfileView: View {
.padding(.top, 26.7) .padding(.top, 26.7)
} }
BannerAdView(adUnitId: CREATOR_CHANNEL_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
.padding(.top, 26.7)
VStack(spacing: 0) {
if creatorProfile.similarCreatorList.count > 0 {
VStack(spacing: 26.7) { VStack(spacing: 26.7) {
UserProfileSimilarCreatorView( UserProfileSimilarCreatorView(
creators: creatorProfile.similarCreatorList, creators: creatorProfile.similarCreatorList,
@ -165,6 +184,7 @@ struct UserProfileView: View {
.foregroundColor(Color(hex: "909090").opacity(0.5)) .foregroundColor(Color(hex: "909090").opacity(0.5))
} }
.padding(.top, 26.7) .padding(.top, 26.7)
}
UserProfileFanTalkView( UserProfileFanTalkView(
userId: userId, userId: userId,
@ -188,6 +208,7 @@ struct UserProfileView: View {
} }
} }
} }
}
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) { .popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
HStack { HStack {
Spacer() Spacer()