feat: 메인 라이브

- 추천 라이브 배너 크기 조절
This commit is contained in:
Yu Sung
2025-07-22 02:13:16 +09:00
parent 15adbfe781
commit 5d0b23d10d

View File

@@ -16,24 +16,18 @@ struct SectionRecommendLiveView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
var body: some View {
VStack(spacing: 0) {
VStack(spacing: 28) {
TabView(selection: $currentIndex) {
ForEach(0..<items.count, id: \.self) { index in
let item = items[index]
if let url = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
KFImage(URL(string: url))
.cancelOnDisappear(true)
.downsampling(
size: CGSize(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 0.53
)
)
.resizable()
.scaledToFill()
.frame(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 0.53
width: screenSize().width,
height: screenSize().width * 0.53
)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
@@ -46,17 +40,11 @@ struct SectionRecommendLiveView: View {
} else {
KFImage(URL(string: item.imageUrl))
.cancelOnDisappear(true)
.downsampling(
size: CGSize(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 0.53
)
)
.resizable()
.scaledToFill()
.frame(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 0.53
width: screenSize().width,
height: screenSize().width * 0.53
)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
@@ -71,10 +59,9 @@ struct SectionRecommendLiveView: View {
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.frame(
width: screenSize().width - 26.7,
height: (screenSize().width - 26.7) * 0.53
width: screenSize().width,
height: screenSize().width * 0.53
)
.padding(.top, 26.7)
HStack(spacing: 4) {
ForEach(0..<items.count, id: \.self) { index in
@@ -87,9 +74,8 @@ struct SectionRecommendLiveView: View {
.tag(index)
}
}
.padding(.top, 13.3)
}
.frame(width: screenSize().width - 26.7)
.frame(maxWidth: .infinity)
.onAppear {
timer = Timer.publish(every: 3, on: .main, in: .common).autoconnect()
}