From 8aa69f02fc9efc4852983ace9a98434b88a16bf7 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Tue, 10 Sep 2024 18:05:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EB=A6=AC=EC=A6=88=20=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20-=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC(=EC=B5=9C=EC=8B=A0=EC=88=9C,=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=EC=88=9C)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Series/Content/SeriesContentAllView.swift | 31 +++++++++++++++++++ .../Content/SeriesContentAllViewModel.swift | 12 ++++++- .../Sources/Content/Series/SeriesApi.swift | 9 +++--- .../Series/SeriesListAllViewModel.swift | 2 +- .../Content/Series/SeriesRepository.swift | 4 +-- SodaLive/Sources/UI/Theme/Color.swift | 2 ++ 6 files changed, 52 insertions(+), 8 deletions(-) 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")