feat(content-all): theme, 정렬(최신순/인기순) 추가

This commit is contained in:
Yu Sung
2025-11-20 14:52:28 +09:00
parent af42fd074f
commit 68fd9ee3ad
4 changed files with 152 additions and 6 deletions

View File

@@ -20,6 +20,44 @@ struct ContentAllView: View {
VStack(spacing: 0) {
DetailNavigationBar(title: isFree ? "무료 콘텐츠 전체" : isPointAvailableOnly ? "포인트 대여 전체" : "콘텐츠 전체")
if !viewModel.themeList.isEmpty {
ContentMainContentThemeView(
themeList: viewModel.themeList,
selectTheme: viewModel.selectTheme,
selectedTheme: $viewModel.selectedTheme
)
}
HStack(spacing: 12) {
Spacer()
Text("최신순")
.font(.custom(Font.preMedium.rawValue, size: 16))
.foregroundColor(
Color(hex: "e2e2e2")
.opacity(viewModel.sort == .NEWEST ? 1 : 0.5)
)
.onTapGesture {
if viewModel.sort != .NEWEST {
viewModel.sort = .NEWEST
}
}
Text("인기순")
.font(.custom(Font.preMedium.rawValue, size: 16))
.foregroundColor(
Color(hex: "e2e2e2")
.opacity(viewModel.sort == .POPULARITY ? 1 : 0.5)
)
.onTapGesture {
if viewModel.sort != .POPULARITY {
viewModel.sort = .POPULARITY
}
}
}
.padding(.vertical, 12)
.padding(.horizontal, 24)
ScrollView(.vertical, showsIndicators: false) {
let horizontalPadding: CGFloat = 24
let gridSpacing: CGFloat = 16
@@ -95,6 +133,7 @@ struct ContentAllView: View {
.onAppear {
viewModel.isFree = isFree
viewModel.isPointAvailableOnly = isPointAvailableOnly
viewModel.getThemeList()
viewModel.fetchData()
}
}