콘텐츠 메인 무료 탭
- 새로운 무료 콘텐츠 전체보기
This commit is contained in:
@@ -17,13 +17,15 @@ struct ContentNewAllView: View {
|
||||
GridItem(.flexible(), alignment: .top)
|
||||
]
|
||||
|
||||
let isFree: Bool
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
DetailNavigationBar(title: "새로운 단편")
|
||||
DetailNavigationBar(title: isFree ? "새로운 무료 콘텐츠" : "새로운 단편")
|
||||
|
||||
Text("※ 최근 2주간 등록된 새로운 단편 입니다.")
|
||||
Text("※ 최근 2주간 등록된 새로운 무료 콘텐츠 입니다.")
|
||||
.font(.custom(Font.medium.rawValue, size: 14.7))
|
||||
.foregroundColor(.graybb)
|
||||
.padding(.horizontal, 13.3)
|
||||
@@ -72,16 +74,18 @@ struct ContentNewAllView: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.isFree = isFree
|
||||
viewModel.getThemeList()
|
||||
viewModel.getNewContentList()
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentNewAllView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentNewAllView()
|
||||
ContentNewAllView(isFree: false)
|
||||
}
|
||||
}
|
||||
|
@@ -33,11 +33,14 @@ final class ContentNewAllViewModel: ObservableObject {
|
||||
var isLast = false
|
||||
private let pageSize = 10
|
||||
|
||||
var isFree: Bool = false
|
||||
|
||||
func getNewContentList() {
|
||||
if (!isLast && !isLoading) {
|
||||
isLoading = true
|
||||
|
||||
repository.getNewContentAllOfTheme(
|
||||
isFree: isFree,
|
||||
theme: selectedTheme == "전체" ? "" : selectedTheme,
|
||||
page: page,
|
||||
size: pageSize
|
||||
|
Reference in New Issue
Block a user