diff --git a/SodaLive/Sources/Content/Series/Content/SeriesContentAllView.swift b/SodaLive/Sources/Content/Series/Content/SeriesContentAllView.swift index 36c1ad7..aa91399 100644 --- a/SodaLive/Sources/Content/Series/Content/SeriesContentAllView.swift +++ b/SodaLive/Sources/Content/Series/Content/SeriesContentAllView.swift @@ -20,6 +20,37 @@ struct SeriesContentAllView: View { VStack(spacing: 0) { DetailNavigationBar(title: "\(seriesTitle) - 전체회차 듣기") + HStack(spacing: 13.3) { + Spacer() + + Text("최신순") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor( + Color.graye2 + .opacity(viewModel.sortType == .NEWEST ? 1 : 0.5) + ) + .onTapGesture { + if viewModel.sortType != .NEWEST { + viewModel.sortType = .NEWEST + } + } + + Text("등록순") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor( + Color.graye2 + .opacity(viewModel.sortType == .OLDEST ? 1 : 0.5) + ) + .onTapGesture { + if viewModel.sortType != .OLDEST { + viewModel.sortType = .OLDEST + } + } + } + .padding(.vertical, 13.3) + .padding(.horizontal, 20) + .background(Color.gray16) + ScrollView(.vertical, showsIndicators: false) { VStack(spacing: 12) { ForEach(0..() enum SeriesSortType: String { - case NEWEST, POPULAR + case NEWEST, OLDEST } var creatorId: Int = 0 diff --git a/SodaLive/Sources/Content/Series/SeriesRepository.swift b/SodaLive/Sources/Content/Series/SeriesRepository.swift index e976df1..a45abaa 100644 --- a/SodaLive/Sources/Content/Series/SeriesRepository.swift +++ b/SodaLive/Sources/Content/Series/SeriesRepository.swift @@ -21,8 +21,8 @@ class SeriesRepository { return api.requestPublisher(.getSeriesDetail(seriesId: seriesId)) } - func getSeriesContentList(seriesId: Int, page: Int, size: Int) -> AnyPublisher { - return api.requestPublisher(.getSeriesContentList(seriesId: seriesId, page: page, size: size)) + func getSeriesContentList(seriesId: Int, page: Int, size: Int, sortType: SeriesListAllViewModel.SeriesSortType) -> AnyPublisher { + return api.requestPublisher(.getSeriesContentList(seriesId: seriesId, page: page, size: size, sortType: sortType)) } func getRecommendSeriesList() -> AnyPublisher { diff --git a/SodaLive/Sources/UI/Theme/Color.swift b/SodaLive/Sources/UI/Theme/Color.swift index 594885e..433edb5 100644 --- a/SodaLive/Sources/UI/Theme/Color.swift +++ b/SodaLive/Sources/UI/Theme/Color.swift @@ -14,6 +14,7 @@ extension Color { static let button = Color(hex: "3bb9f1") static let bg = Color(hex: "13181B") static let gray11 = Color(hex: "111111") + static let gray16 = Color(hex: "161616") static let gray22 = Color(hex: "222222") static let gray23 = Color(hex: "232323") static let gray30 = Color(hex: "303030") @@ -27,6 +28,7 @@ extension Color { static let graybb = Color(hex: "bbbbbb") static let grayd2 = Color(hex: "d2d2d2") static let grayd8 = Color(hex: "d8d8d8") + static let graye2 = Color(hex: "e2e2e2") static let grayee = Color(hex: "eeeeee") static let mainRed = Color(hex: "ff5c49")