feat(latest-audio-content-all): 테마 UI 변경, 아이템 2단으로 변경

This commit is contained in:
Yu Sung
2025-11-20 15:06:25 +09:00
parent 68fd9ee3ad
commit 4d5ac61dbe
9 changed files with 129 additions and 67 deletions

View File

@@ -11,12 +11,6 @@ struct ContentNewAllView: View {
@StateObject var viewModel = ContentNewAllViewModel()
let columns = [
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top),
GridItem(.flexible(), alignment: .top)
]
let isFree: Bool
var body: some View {
@@ -33,14 +27,13 @@ struct ContentNewAllView: View {
.frame(width: screenSize().width, alignment: .leading)
.background(Color.gray22)
ContentMainNewContentThemeView(
themes: viewModel.themeList,
ContentMainContentThemeView(
themeList: viewModel.themeList,
selectTheme: {
viewModel.selectedTheme = $0
},
selectedTheme: $viewModel.selectedTheme
)
.padding(.horizontal, 20)
HStack(spacing: 0) {
Text("전체")
@@ -57,12 +50,27 @@ struct ContentNewAllView: View {
.foregroundColor(Color(hex: "e2e2e2"))
.padding(.leading, 2)
}
.padding(.horizontal, 13.3)
.padding(.horizontal, 24)
ScrollView(.vertical, showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 32) {
let horizontalPadding: CGFloat = 24
let gridSpacing: CGFloat = 16
let itemSize = (screenSize().width - (horizontalPadding * 2) - gridSpacing) / 2
LazyVGrid(
columns: Array(
repeating: GridItem(
.flexible(),
spacing: gridSpacing,
alignment: .topLeading
),
count: 2
),
alignment: .leading,
spacing: gridSpacing
) {
ForEach(0..<viewModel.newContentList.count, id: \.self) { index in
ContentNewAllItemView(item: viewModel.newContentList[index])
ContentNewAllItemView(width: itemSize, item: viewModel.newContentList[index])
.onAppear {
if index == viewModel.newContentList.count - 1 {
viewModel.getNewContentList()
@@ -70,7 +78,7 @@ struct ContentNewAllView: View {
}
}
}
.padding(.horizontal, 13.3)
.padding(.horizontal, 24)
}
}
.onAppear {