diff --git a/Core/Core/Network/AuthEndpoint.swift b/Core/Core/Network/AuthEndpoint.swift index e93e5c860..609e4890b 100644 --- a/Core/Core/Network/AuthEndpoint.swift +++ b/Core/Core/Network/AuthEndpoint.swift @@ -29,9 +29,9 @@ enum AuthEndpoint: EndPointType { case .getAuthCookies: return "/oauth2/login/" case .getRegisterFields: - return "user_api/v1/account/registration/" + return "/user_api/v1/account/registration/" case .registerUser: - return "user_api/v1/account/registration/" + return "/user_api/v1/account/registration/" case .validateRegistrationFields: return "/api/user/v1/validation/registration" case .resetPassword: diff --git a/Course/Course/Presentation/Video/PlayerViewControllerHolder.swift b/Course/Course/Presentation/Video/PlayerViewControllerHolder.swift index fac9ef02a..a56e8dfb8 100644 --- a/Course/Course/Presentation/Video/PlayerViewControllerHolder.swift +++ b/Course/Course/Presentation/Video/PlayerViewControllerHolder.swift @@ -178,6 +178,25 @@ public class PlayerViewControllerHolder: PlayerViewControllerHolderProtocol { } } +extension AVPlayerViewController: PlayerControllerProtocol { + public func play() { + player?.play() + } + + public func pause() { + player?.pause() + } + + public func seekTo(to date: Date) { + player?.seek(to: date) + } + + public func stop() { + player?.replaceCurrentItem(with: nil) + } +} + +#if DEBUG extension PlayerViewControllerHolder { static var mock: PlayerViewControllerHolder { PlayerViewControllerHolder( @@ -198,21 +217,4 @@ extension PlayerViewControllerHolder { ) } } - -extension AVPlayerViewController: PlayerControllerProtocol { - public func play() { - player?.play() - } - - public func pause() { - player?.pause() - } - - public func seekTo(to date: Date) { - player?.seek(to: date) - } - - public func stop() { - player?.replaceCurrentItem(with: nil) - } -} +#endif diff --git a/Course/Course/Presentation/Video/YoutubePlayerViewControllerHolder.swift b/Course/Course/Presentation/Video/YoutubePlayerViewControllerHolder.swift index e74545c25..16a4d9eca 100644 --- a/Course/Course/Presentation/Video/YoutubePlayerViewControllerHolder.swift +++ b/Course/Course/Presentation/Video/YoutubePlayerViewControllerHolder.swift @@ -140,27 +140,6 @@ public class YoutubePlayerViewControllerHolder: PlayerViewControllerHolderProtoc } } -extension YoutubePlayerViewControllerHolder { - static var mock: YoutubePlayerViewControllerHolder { - YoutubePlayerViewControllerHolder( - url: URL(string: "")!, - blockID: "", - courseID: "", - selectedCourseTab: 0, - videoResolution: .zero, - pipManager: PipManagerProtocolMock(), - playerTracker: PlayerTrackerProtocolMock(url: URL(string: "")), - playerDelegate: nil, - playerService: PlayerService( - courseID: "", - blockID: "", - interactor: CourseInteractor.mock, - router: CourseRouterMock() - ) - ) - } -} - extension YouTubePlayer: PlayerControllerProtocol { public func play() { self.play(completion: nil) @@ -181,3 +160,26 @@ extension YouTubePlayer: PlayerControllerProtocol { self.stop(completion: nil) } } + +#if DEBUG +extension YoutubePlayerViewControllerHolder { + static var mock: YoutubePlayerViewControllerHolder { + YoutubePlayerViewControllerHolder( + url: URL(string: "")!, + blockID: "", + courseID: "", + selectedCourseTab: 0, + videoResolution: .zero, + pipManager: PipManagerProtocolMock(), + playerTracker: PlayerTrackerProtocolMock(url: URL(string: "")), + playerDelegate: nil, + playerService: PlayerService( + courseID: "", + blockID: "", + interactor: CourseInteractor.mock, + router: CourseRouterMock() + ) + ) + } +} +#endif diff --git a/Dashboard/Dashboard/Presentation/Elements/CategoryFilterView.swift b/Dashboard/Dashboard/Presentation/Elements/CategoryFilterView.swift index c01444840..a0b24625b 100644 --- a/Dashboard/Dashboard/Presentation/Elements/CategoryFilterView.swift +++ b/Dashboard/Dashboard/Presentation/Elements/CategoryFilterView.swift @@ -58,7 +58,7 @@ struct CategoryFilterView: View { Text(option.text) .font(Theme.Fonts.titleSmall) .foregroundColor( - option == selectedOption ? Theme.Colors.white : ( + option == selectedOption ? Theme.Colors.slidingSelectedTextColor : ( colorScheme == .light ? Theme.Colors.accentColor : .white ) ) diff --git a/Dashboard/Dashboard/Presentation/Elements/PrimaryCardView.swift b/Dashboard/Dashboard/Presentation/Elements/PrimaryCardView.swift index 8428c1857..27e2abfb5 100644 --- a/Dashboard/Dashboard/Presentation/Elements/PrimaryCardView.swift +++ b/Dashboard/Dashboard/Presentation/Elements/PrimaryCardView.swift @@ -179,9 +179,7 @@ public struct PrimaryCardView: View { .renderingMode(.template) .resizable() .frame(width: 24, height: 24) - .foregroundStyle( - selected ? Theme.Colors.white : Theme.Colors.textPrimary - ) + .foregroundStyle(foregroundColor(selected)) .padding(12) VStack(alignment: .leading, spacing: 6) { @@ -190,20 +188,20 @@ public struct PrimaryCardView: View { .font(Theme.Fonts.labelSmall) .multilineTextAlignment(.leading) .lineLimit(1) - .foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary) + .foregroundStyle(foregroundColor(selected)) } Text(title) .font(Theme.Fonts.titleSmall) .multilineTextAlignment(.leading) .lineLimit(1) - .foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary) + .foregroundStyle(foregroundColor(selected)) } .padding(.top, 2) } } Spacer() CoreAssets.chevronRight.swiftUIImage - .foregroundStyle(selected ? Theme.Colors.white : Theme.Colors.textPrimary) + .foregroundStyle(foregroundColor(selected)) .padding(8) } .padding(.top, 8) @@ -212,6 +210,10 @@ public struct PrimaryCardView: View { }) } + private func foregroundColor(_ selected: Bool) -> SwiftUI.Color { + return selected ? Theme.Colors.primaryButtonTextColor : Theme.Colors.textPrimary + } + private var courseBanner: some View { return KFImage(URL(string: courseImage)) .onFailureImage(CoreAssets.noCourseImage.image) diff --git a/Profile/Profile/Data/Network/ProfileEndpoint.swift b/Profile/Profile/Data/Network/ProfileEndpoint.swift index bf3b330ca..b17e5db6d 100644 --- a/Profile/Profile/Data/Network/ProfileEndpoint.swift +++ b/Profile/Profile/Data/Network/ProfileEndpoint.swift @@ -20,11 +20,11 @@ enum ProfileEndpoint: EndPointType { var path: String { switch self { case .getUserProfile(let username): - return "api/user/v1/accounts/\(username)" + return "/api/user/v1/accounts/\(username)" case .logOut: - return "oauth2/revoke_token/" + return "/oauth2/revoke_token/" case let .updateUserProfile(username, _): - return "api/user/v1/accounts/\(username)" + return "/api/user/v1/accounts/\(username)" case let .uploadProfilePicture(username, _): return "/api/user/v1/accounts/\(username)/image" case .deleteProfilePicture(username: let username):