diff --git a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Contents.json b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Contents.json index f9973c21e..cb121759a 100644 --- a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Frame 273-2.svg", + "filename" : "leaveProfileLight.svg", "idiom" : "universal" }, { @@ -11,7 +11,7 @@ "value" : "dark" } ], - "filename" : "Frame 273.svg", + "filename" : "leaveProfileDark.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273-2.svg b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273-2.svg deleted file mode 100644 index 539abbf57..000000000 --- a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273-2.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273.svg b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273.svg deleted file mode 100644 index 439f7839d..000000000 --- a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/Frame 273.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileDark.svg b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileDark.svg new file mode 100644 index 000000000..f53f2ce8f --- /dev/null +++ b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileDark.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileLight.svg b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileLight.svg new file mode 100644 index 000000000..bae97e99a --- /dev/null +++ b/Core/Core/Assets.xcassets/Profile/leaveProfile.imageset/leaveProfileLight.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/Profile/logOut.imageset/Contents.json b/Core/Core/Assets.xcassets/Profile/logOut.imageset/Contents.json index 5910a0fb6..ee3f397ac 100644 --- a/Core/Core/Assets.xcassets/Profile/logOut.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/Profile/logOut.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "_93_Door_Exit_Logout_Out.svg", + "filename" : "logOut_lighttheme.svg", "idiom" : "universal" }, { @@ -11,7 +11,7 @@ "value" : "dark" } ], - "filename" : "_93_Door_Exit_Logout_Out-2.svg", + "filename" : "logOut_darktheme.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out-2.svg b/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out-2.svg deleted file mode 100644 index ca3bf3908..000000000 --- a/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out-2.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out.svg b/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out.svg deleted file mode 100644 index 60b35eecb..000000000 --- a/Core/Core/Assets.xcassets/Profile/logOut.imageset/_93_Door_Exit_Logout_Out.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_darktheme.svg b/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_darktheme.svg new file mode 100644 index 000000000..a52ebb029 --- /dev/null +++ b/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_darktheme.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_lighttheme.svg b/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_lighttheme.svg new file mode 100644 index 000000000..3545c6727 --- /dev/null +++ b/Core/Core/Assets.xcassets/Profile/logOut.imageset/logOut_lighttheme.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/checkEmail.imageset/Contents.json b/Core/Core/Assets.xcassets/checkEmail.imageset/Contents.json index cf478a766..f00259a41 100644 --- a/Core/Core/Assets.xcassets/checkEmail.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/checkEmail.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "_1.svg", + "filename" : "checkEmailLight.svg", "idiom" : "universal" }, { @@ -11,7 +11,7 @@ "value" : "dark" } ], - "filename" : "_1-2.svg", + "filename" : "checkEmailDark.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/checkEmail.imageset/_1-2.svg b/Core/Core/Assets.xcassets/checkEmail.imageset/_1-2.svg deleted file mode 100644 index 8f70d7871..000000000 --- a/Core/Core/Assets.xcassets/checkEmail.imageset/_1-2.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/checkEmail.imageset/_1.svg b/Core/Core/Assets.xcassets/checkEmail.imageset/_1.svg deleted file mode 100644 index c3b7babd2..000000000 --- a/Core/Core/Assets.xcassets/checkEmail.imageset/_1.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailDark.svg b/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailDark.svg new file mode 100644 index 000000000..552d0c036 --- /dev/null +++ b/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailDark.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailLight.svg b/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailLight.svg new file mode 100644 index 000000000..47f8ceac3 --- /dev/null +++ b/Core/Core/Assets.xcassets/checkEmail.imageset/checkEmailLight.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/noWifi.imageset/Contents.json b/Core/Core/Assets.xcassets/noWifi.imageset/Contents.json new file mode 100644 index 000000000..8c7a6c0c8 --- /dev/null +++ b/Core/Core/Assets.xcassets/noWifi.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "noWifi.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Core/Core/Assets.xcassets/noWifi.imageset/noWifi.svg b/Core/Core/Assets.xcassets/noWifi.imageset/noWifi.svg new file mode 100644 index 000000000..052e9c275 --- /dev/null +++ b/Core/Core/Assets.xcassets/noWifi.imageset/noWifi.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/noWifiMini.imageset/Contents.json b/Core/Core/Assets.xcassets/noWifiMini.imageset/Contents.json new file mode 100644 index 000000000..8c7a6c0c8 --- /dev/null +++ b/Core/Core/Assets.xcassets/noWifiMini.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "noWifi.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Core/Core/Assets.xcassets/noWifiMini.imageset/noWifi.svg b/Core/Core/Assets.xcassets/noWifiMini.imageset/noWifi.svg new file mode 100644 index 000000000..d3244e4eb --- /dev/null +++ b/Core/Core/Assets.xcassets/noWifiMini.imageset/noWifi.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Core/Core/Assets.xcassets/notAvaliable.imageset/Contents.json b/Core/Core/Assets.xcassets/notAvaliable.imageset/Contents.json index 1869de7d4..d717fb05a 100644 --- a/Core/Core/Assets.xcassets/notAvaliable.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/notAvaliable.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Frame 273-3.svg", + "filename" : "notAvaliableDark.svg", "idiom" : "universal" }, { @@ -11,7 +11,7 @@ "value" : "dark" } ], - "filename" : "Frame 273-4.svg", + "filename" : "notAvaliableLight.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-3.svg b/Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableDark.svg similarity index 55% rename from Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-3.svg rename to Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableDark.svg index 628645fb6..5988af1a4 100644 --- a/Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-3.svg +++ b/Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableDark.svg @@ -1,11 +1,6 @@ - - - - - - - - - + + + + diff --git a/Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-4.svg b/Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableLight.svg similarity index 52% rename from Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-4.svg rename to Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableLight.svg index 9b2d26b91..ef4db81cd 100644 --- a/Core/Core/Assets.xcassets/notAvaliable.imageset/Frame 273-4.svg +++ b/Core/Core/Assets.xcassets/notAvaliable.imageset/notAvaliableLight.svg @@ -1,11 +1,6 @@ - - - - - - - - - + + + + diff --git a/Core/Core/Extensions/ViewExtension.swift b/Core/Core/Extensions/ViewExtension.swift index 446de5321..8520a84cb 100644 --- a/Core/Core/Extensions/ViewExtension.swift +++ b/Core/Core/Extensions/ViewExtension.swift @@ -14,13 +14,14 @@ public extension View { func cardStyle( top: CGFloat? = 0, bottom: CGFloat? = 0, + paddingAll: CGFloat? = 20, leftLineEnabled: Bool = false, bgColor: Color = Theme.Colors.background, strokeColor: Color = Theme.Colors.cardViewStroke, textColor: Color = Theme.Colors.textPrimary ) -> some View { return self - .padding(.all, 20) + .padding(.all, paddingAll) .padding(.vertical, leftLineEnabled ? 0 : 6) .font(Theme.Fonts.titleMedium) .frame(minWidth: 0, diff --git a/Core/Core/SwiftGen/Assets.swift b/Core/Core/SwiftGen/Assets.swift index c0f29a4bf..2252597b1 100644 --- a/Core/Core/SwiftGen/Assets.swift +++ b/Core/Core/SwiftGen/Assets.swift @@ -106,6 +106,8 @@ public enum CoreAssets { public static let readdleSpark = ImageAsset(name: "readdle-spark") public static let ymail = ImageAsset(name: "ymail") public static let noCourseImage = ImageAsset(name: "noCourseImage") + public static let noWifi = ImageAsset(name: "noWifi") + public static let noWifiMini = ImageAsset(name: "noWifiMini") public static let notAvaliable = ImageAsset(name: "notAvaliable") public static let playVideo = ImageAsset(name: "playVideo") public static let star = ImageAsset(name: "star") diff --git a/Core/Core/SwiftGen/Strings.swift b/Core/Core/SwiftGen/Strings.swift index dd7f3daba..d47476385 100644 --- a/Core/Core/SwiftGen/Strings.swift +++ b/Core/Core/SwiftGen/Strings.swift @@ -55,10 +55,8 @@ public enum CoreLocalization { public static let courseUnits = CoreLocalization.tr("Localizable", "COURSEWARE.COURSE_UNITS", fallback: "Course units") /// Finish public static let finish = CoreLocalization.tr("Localizable", "COURSEWARE.FINISH", fallback: "Finish") - /// Good Work! - public static let goodWork = CoreLocalization.tr("Localizable", "COURSEWARE.GOOD_WORK", fallback: "Good Work!") - /// “ is finished. - public static let isFinished = CoreLocalization.tr("Localizable", "COURSEWARE.IS_FINISHED", fallback: "“ is finished.") + /// Good job! + public static let goodWork = CoreLocalization.tr("Localizable", "COURSEWARE.GOOD_WORK", fallback: "Good job!") /// Next public static let next = CoreLocalization.tr("Localizable", "COURSEWARE.NEXT", fallback: "Next") /// Next section @@ -73,8 +71,10 @@ public enum CoreLocalization { public static let resume = CoreLocalization.tr("Localizable", "COURSEWARE.RESUME", fallback: "Resume") /// Resume with: public static let resumeWith = CoreLocalization.tr("Localizable", "COURSEWARE.RESUME_WITH", fallback: "Resume with:") - /// Section “ - public static let section = CoreLocalization.tr("Localizable", "COURSEWARE.SECTION", fallback: "Section “") + /// You've completed “%@”. + public static func sectionCompleted(_ p1: Any) -> String { + return CoreLocalization.tr("Localizable", "COURSEWARE.SECTION_COMPLETED", String(describing: p1), fallback: "You've completed “%@”.") + } } public enum Date { /// Ended @@ -117,6 +117,12 @@ public enum CoreLocalization { public static let userNotActive = CoreLocalization.tr("Localizable", "ERROR.USER_NOT_ACTIVE", fallback: "User account is not activated. Please activate your account first.") /// You can only download files over Wi-Fi. You can change this in the settings. public static let wifi = CoreLocalization.tr("Localizable", "ERROR.WIFI", fallback: "You can only download files over Wi-Fi. You can change this in the settings.") + public enum Internet { + /// Please connect to the internet to view this content. + public static let noInternetDescription = CoreLocalization.tr("Localizable", "ERROR.INTERNET.NO_INTERNET_DESCRIPTION", fallback: "Please connect to the internet to view this content.") + /// No internet connection + public static let noInternetTitle = CoreLocalization.tr("Localizable", "ERROR.INTERNET.NO_INTERNET_TITLE", fallback: "No internet connection") + } } public enum Mainscreen { /// Dashboard diff --git a/Core/Core/View/Base/AlertView.swift b/Core/Core/View/Base/AlertView.swift index 3b8ec66e7..388c70c54 100644 --- a/Core/Core/View/Base/AlertView.swift +++ b/Core/Core/View/Base/AlertView.swift @@ -281,19 +281,19 @@ public struct AlertView: View { }, label: { ZStack { Text(CoreLocalization.Alert.logout) - .foregroundColor(Theme.Colors.primaryButtonTextColor) + .foregroundColor(Theme.Colors.warningText) .font(Theme.Fonts.labelLarge) .frame(maxWidth: .infinity) .padding(.horizontal, 16) Image(systemName: "rectangle.portrait.and.arrow.right") - .foregroundColor(Theme.Colors.white) + .foregroundColor(Theme.Colors.warningText) .frame(minWidth: 190, minHeight: 48, alignment: .trailing) } .frame(maxWidth: 215, minHeight: 48) }) .background( Theme.Shapes.buttonShape - .fill(Theme.Colors.accentColor) + .fill(Theme.Colors.warning) ) .overlay( RoundedRectangle(cornerRadius: 8) diff --git a/Core/Core/en.lproj/Localizable.strings b/Core/Core/en.lproj/Localizable.strings index 4a4f52e84..8d868b239 100644 --- a/Core/Core/en.lproj/Localizable.strings +++ b/Core/Core/en.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Core @@ -22,16 +22,18 @@ "ERROR.WIFI" = "You can only download files over Wi-Fi. You can change this in the settings."; "ERROR.AUTHORIZATION_FAILED" = "Authorization failed."; +"ERROR.INTERNET.NO_INTERNET_TITLE" = "No internet connection"; +"ERROR.INTERNET.NO_INTERNET_DESCRIPTION" = "Please connect to the internet to view this content."; + "COURSEWARE.COURSE_CONTENT" = "Course content"; "COURSEWARE.COURSE_CONTENT_NOT_AVAILABLE" = "This interactive component isn't yet available on mobile."; "COURSEWARE.COURSE_UNITS" = "Course units"; "COURSEWARE.NEXT" = "Next"; "COURSEWARE.PREVIOUS" = "Prev"; "COURSEWARE.FINISH" = "Finish"; -"COURSEWARE.GOOD_WORK" = "Good Work!"; +"COURSEWARE.GOOD_WORK" = "Good job!"; "COURSEWARE.BACK_TO_OUTLINE" = "Back to outline"; -"COURSEWARE.SECTION" = "Section “"; -"COURSEWARE.IS_FINISHED" = "“ is finished."; +"COURSEWARE.SECTION_COMPLETED" = "You've completed “%@”."; "COURSEWARE.CONTINUE" = "Continue"; "COURSEWARE.RESUME" = "Resume"; "COURSEWARE.RESUME_WITH" = "Resume with:"; diff --git a/Core/Core/uk.lproj/Localizable.strings b/Core/Core/uk.lproj/Localizable.strings index 3f2e867b7..ce8cc2ac5 100644 --- a/Core/Core/uk.lproj/Localizable.strings +++ b/Core/Core/uk.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Core @@ -21,6 +21,9 @@ "ERROR.UNKNOWN_ERROR" = "Щось пішло не так"; "ERROR.WIFI" = "Завантажувати файли можна лише через Wi-Fi. Ви можете змінити це в налаштуваннях."; +"ERROR.INTERNET.NO_INTERNET_TITLE" = "Немає підключення до Інтернету"; +"ERROR.INTERNET.NO_INTERNET_DESCRIPTION" = "Будь ласка, підключіться до Інтернету, щоб переглянути цей вміст."; + "COURSEWARE.COURSE_CONTENT" = "Зміст курсу"; "COURSEWARE.COURSE_CONTENT_NOT_AVAILABLE" = "This interactive component isn't yet available on mobile."; "COURSEWARE.COURSE_UNITS" = "Модулі"; @@ -29,8 +32,7 @@ "COURSEWARE.FINISH" = "Завершити"; "COURSEWARE.GOOD_WORK" = "Гарна робота!"; "COURSEWARE.BACK_TO_OUTLINE" = "Повернутись до модуля"; -"COURSEWARE.SECTION" = "Секція “"; -"COURSEWARE.IS_FINISHED" = "“ завершена."; +"COURSEWARE.SECTION_COMPLETED" = "Ви завершили “%@”."; "COURSEWARE.CONTINUE" = "Продовжити"; "COURSEWARE.RESUME" = "Resume"; "COURSEWARE.RESUME_WITH" = "Продовжити далі:"; diff --git a/Course/Course/Presentation/Unit/CourseNavigationView.swift b/Course/Course/Presentation/Unit/CourseNavigationView.swift index 0834019e3..fbcc8ef84 100644 --- a/Course/Course/Presentation/Unit/CourseNavigationView.swift +++ b/Course/Course/Presentation/Unit/CourseNavigationView.swift @@ -91,8 +91,7 @@ struct CourseNavigationView: View { viewModel.router.presentAlert( alertTitle: CourseLocalization.Courseware.goodWork, - alertMessage: (CourseLocalization.Courseware.section - + currentVertical.displayName + CourseLocalization.Courseware.isFinished), + alertMessage: (CoreLocalization.Courseware.sectionCompleted(currentVertical.displayName)), nextSectionName: { if let data = viewModel.nextData, let vertical = viewModel.vertical(for: data) { diff --git a/Course/Course/Presentation/Unit/CourseUnitView.swift b/Course/Course/Presentation/Unit/CourseUnitView.swift index e38c22879..56c387965 100644 --- a/Course/Course/Presentation/Unit/CourseUnitView.swift +++ b/Course/Course/Presentation/Unit/CourseUnitView.swift @@ -190,7 +190,7 @@ public struct CourseUnitView: View { Spacer(minLength: 150) } } else { - NoInternetView(playerStateSubject: playerStateSubject) + NoInternetView() } } else { @@ -220,7 +220,7 @@ public struct CourseUnitView: View { Spacer(minLength: 150) } } else { - NoInternetView(playerStateSubject: playerStateSubject) + NoInternetView() } } // MARK: Web @@ -234,7 +234,7 @@ public struct CourseUnitView: View { ) // not need to add frame limit there because we did that with injection } else { - NoInternetView(playerStateSubject: playerStateSubject) + NoInternetView() } } else { EmptyView() @@ -243,14 +243,12 @@ public struct CourseUnitView: View { case .unknown(let url): if index >= viewModel.index - 1 && index <= viewModel.index + 1 { if viewModel.connectivity.isInternetAvaliable { - ScrollView(showsIndicators: false) { - UnknownView(url: url, viewModel: viewModel) - .frameLimit(width: reader.size.width) - Spacer() - .frame(minHeight: 100) - } + UnknownView(url: url, viewModel: viewModel) + .frameLimit(width: reader.size.width) + Spacer() + .frame(minHeight: 100) } else { - NoInternetView(playerStateSubject: playerStateSubject) + NoInternetView() } } else { EmptyView() @@ -278,7 +276,7 @@ public struct CourseUnitView: View { //No need iPad paddings there bacause they were added //to PostsView that placed inside DiscussionView } else { - NoInternetView(playerStateSubject: playerStateSubject) + NoInternetView() } } else { EmptyView() @@ -565,7 +563,7 @@ struct CourseUnitView_Previews: PreviewProvider { config: ConfigMock(), router: CourseRouterMock(), analytics: CourseAnalyticsMock(), - connectivity: Connectivity(), + connectivity: Connectivity(), storage: CourseStorageMock(), manager: DownloadManagerMock() ), sectionName: "") @@ -575,20 +573,23 @@ struct CourseUnitView_Previews: PreviewProvider { #endif struct NoInternetView: View { - - let playerStateSubject: CurrentValueSubject - + var body: some View { VStack(spacing: 28) { - Image(systemName: "wifi").resizable() + Spacer() + CoreAssets.noWifi.swiftUIImage + .renderingMode(.template) + .foregroundStyle(Color.primary) .scaledToFit() - .frame(width: 100) - Text(CourseLocalization.Error.noInternet) + Text(CoreLocalization.Error.Internet.noInternetTitle) + .font(Theme.Fonts.titleLarge) + .foregroundColor(Theme.Colors.textPrimary) + Text(CoreLocalization.Error.Internet.noInternetDescription) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .multilineTextAlignment(.center) - .padding(.horizontal, 20) - UnitButtonView(type: .reload, action: { - playerStateSubject.send(VideoPlayerState.kill) - }).frame(width: 100) + .padding(.horizontal, 50) + Spacer() }.frame(maxWidth: .infinity, maxHeight: .infinity) } } diff --git a/Course/Course/Presentation/Unit/Subviews/UnknownView.swift b/Course/Course/Presentation/Unit/Subviews/UnknownView.swift index 6a41ae3e7..d38104a23 100644 --- a/Course/Course/Presentation/Unit/Subviews/UnknownView.swift +++ b/Course/Course/Presentation/Unit/Subviews/UnknownView.swift @@ -15,6 +15,7 @@ struct UnknownView: View { var body: some View { VStack(spacing: 0) { + Spacer() CoreAssets.notAvaliable.swiftUIImage Text(CourseLocalization.NotAvaliable.title) .font(Theme.Fonts.titleLarge) @@ -33,6 +34,7 @@ struct UnknownView: View { }) .frame(width: 215) .padding(.top, 40) + Spacer() } .padding(24) } diff --git a/Course/Course/SwiftGen/Strings.swift b/Course/Course/SwiftGen/Strings.swift index f61aef96c..bdcfddabe 100644 --- a/Course/Course/SwiftGen/Strings.swift +++ b/Course/Course/SwiftGen/Strings.swift @@ -41,18 +41,18 @@ public enum CourseLocalization { public static let courseUnits = CourseLocalization.tr("Localizable", "COURSEWARE.COURSE_UNITS", fallback: "Course units") /// Finish public static let finish = CourseLocalization.tr("Localizable", "COURSEWARE.FINISH", fallback: "Finish") - /// Good Work! - public static let goodWork = CourseLocalization.tr("Localizable", "COURSEWARE.GOOD_WORK", fallback: "Good Work!") - /// “ is finished. - public static let isFinished = CourseLocalization.tr("Localizable", "COURSEWARE.IS_FINISHED", fallback: "“ is finished.") + /// Good job! + public static let goodWork = CourseLocalization.tr("Localizable", "COURSEWARE.GOOD_WORK", fallback: "Good job!") + /// “. + public static let isFinished = CourseLocalization.tr("Localizable", "COURSEWARE.IS_FINISHED", fallback: "“.") /// Next public static let next = CourseLocalization.tr("Localizable", "COURSEWARE.NEXT", fallback: "Next") /// Prev public static let previous = CourseLocalization.tr("Localizable", "COURSEWARE.PREVIOUS", fallback: "Prev") /// Resume with: public static let resumeWith = CourseLocalization.tr("Localizable", "COURSEWARE.RESUME_WITH", fallback: "Resume with:") - /// Section “ - public static let section = CourseLocalization.tr("Localizable", "COURSEWARE.SECTION", fallback: "Section “") + /// You've completed “ + public static let section = CourseLocalization.tr("Localizable", "COURSEWARE.SECTION", fallback: "You've completed “") } public enum CourseContainer { /// Course @@ -61,8 +61,8 @@ public enum CourseLocalization { public static let dates = CourseLocalization.tr("Localizable", "COURSE_CONTAINER.DATES", fallback: "Dates") /// Discussions public static let discussions = CourseLocalization.tr("Localizable", "COURSE_CONTAINER.DISCUSSIONS", fallback: "Discussions") - /// Handouts - public static let handouts = CourseLocalization.tr("Localizable", "COURSE_CONTAINER.HANDOUTS", fallback: "Handouts") + /// More + public static let handouts = CourseLocalization.tr("Localizable", "COURSE_CONTAINER.HANDOUTS", fallback: "More") /// Handouts In developing public static let handoutsInDeveloping = CourseLocalization.tr("Localizable", "COURSE_CONTAINER.HANDOUTS_IN_DEVELOPING", fallback: "Handouts In developing") /// Videos @@ -231,8 +231,8 @@ public enum CourseLocalization { public static let button = CourseLocalization.tr("Localizable", "NOT_AVALIABLE.BUTTON", fallback: "Open in browser") /// Explore other parts of this course or view this on web. public static let description = CourseLocalization.tr("Localizable", "NOT_AVALIABLE.DESCRIPTION", fallback: "Explore other parts of this course or view this on web.") - /// This interactive component isn’t yet available - public static let title = CourseLocalization.tr("Localizable", "NOT_AVALIABLE.TITLE", fallback: "This interactive component isn’t yet available") + /// This interactive component isn't available on mobile + public static let title = CourseLocalization.tr("Localizable", "NOT_AVALIABLE.TITLE", fallback: "This interactive component isn't available on mobile") } public enum Outline { /// Certificate @@ -246,8 +246,8 @@ public enum CourseLocalization { public static let courseHasntStarted = CourseLocalization.tr("Localizable", "OUTLINE.COURSE_HASNT_STARTED", fallback: "This course hasn't started yet.") /// Course videos public static let courseVideos = CourseLocalization.tr("Localizable", "OUTLINE.COURSE_VIDEOS", fallback: "Course videos") - /// You've passed the course - public static let passedTheCourse = CourseLocalization.tr("Localizable", "OUTLINE.PASSED_THE_COURSE", fallback: "You've passed the course") + /// You’ve completed the course + public static let passedTheCourse = CourseLocalization.tr("Localizable", "OUTLINE.PASSED_THE_COURSE", fallback: "You’ve completed the course") /// View certificate public static let viewCertificate = CourseLocalization.tr("Localizable", "OUTLINE.VIEW_CERTIFICATE", fallback: "View certificate") } diff --git a/Course/Course/en.lproj/Localizable.strings b/Course/Course/en.lproj/Localizable.strings index 52d82216c..5f785ca8d 100644 --- a/Course/Course/en.lproj/Localizable.strings +++ b/Course/Course/en.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Course @@ -7,7 +7,7 @@ */ "OUTLINE.CONGRATULATIONS" = "Congratulations!"; -"OUTLINE.PASSED_THE_COURSE" = "You've passed the course"; +"OUTLINE.PASSED_THE_COURSE" = "You’ve completed the course"; "OUTLINE.VIEW_CERTIFICATE" = "View certificate"; "OUTLINE.CERTIFICATE" = "Certificate"; "OUTLINE.COURSE_VIDEOS" = "Course videos"; @@ -18,10 +18,10 @@ "COURSEWARE.NEXT" = "Next"; "COURSEWARE.PREVIOUS" = "Prev"; "COURSEWARE.FINISH" = "Finish"; -"COURSEWARE.GOOD_WORK" = "Good Work!"; +"COURSEWARE.GOOD_WORK" = "Good job!"; "COURSEWARE.BACK_TO_OUTLINE" = "Back to outline"; -"COURSEWARE.SECTION" = "Section “"; -"COURSEWARE.IS_FINISHED" = "“ is finished."; +"COURSEWARE.SECTION" = "You've completed “"; +"COURSEWARE.IS_FINISHED" = "“."; "COURSEWARE.CONTINUE" = "Continue"; "COURSEWARE.RESUME_WITH" = "Resume with:"; @@ -40,7 +40,7 @@ "COURSE_CONTAINER.VIDEOS" = "Videos"; "COURSE_CONTAINER.DATES" = "Dates"; "COURSE_CONTAINER.DISCUSSIONS" = "Discussions"; -"COURSE_CONTAINER.HANDOUTS" = "Handouts"; +"COURSE_CONTAINER.HANDOUTS" = "More"; "COURSE_CONTAINER.HANDOUTS_IN_DEVELOPING" = "Handouts In developing"; "HANDOUTS_CELL_HANDOUTS.TITLE" = "Handouts"; @@ -48,7 +48,7 @@ "HANDOUTS_CELL_HANDOUTS.DESCRIPTION" = "Find important course information"; "HANDOUTS_CELL_ANNOUNCEMENTS.DESCRIPTION" = "Keep up with the latest news"; -"NOT_AVALIABLE.TITLE" = "This interactive component isn’t yet available"; +"NOT_AVALIABLE.TITLE" = "This interactive component isn't available on mobile"; "NOT_AVALIABLE.DESCRIPTION" = "Explore other parts of this course or view this on web."; "NOT_AVALIABLE.BUTTON" = "Open in browser"; diff --git a/Dashboard/Dashboard/Presentation/DashboardView.swift b/Dashboard/Dashboard/Presentation/DashboardView.swift index c896acfd3..44c6c3fc8 100644 --- a/Dashboard/Dashboard/Presentation/DashboardView.swift +++ b/Dashboard/Dashboard/Presentation/DashboardView.swift @@ -43,16 +43,16 @@ public struct DashboardView: View { await viewModel.getMyCourses(page: 1, refresh: true) }) { Group { - if viewModel.courses.isEmpty && !viewModel.fetchInProgress { - EmptyPageIcon() - } else { - LazyVStack(spacing: 0) { - HStack { - dashboardCourses - .padding(.horizontal, 20) - .padding(.bottom, 20) - Spacer() - }.padding(.leading, 10) + LazyVStack(spacing: 0) { + HStack { + dashboardCourses + .padding(.horizontal, 20) + .padding(.bottom, 20) + Spacer() + }.padding(.leading, 10) + if viewModel.courses.isEmpty && !viewModel.fetchInProgress { + EmptyPageIcon() + } else { ForEach(Array(viewModel.courses.enumerated()), id: \.offset) { index, course in @@ -164,11 +164,6 @@ struct EmptyPageIcon: View { CoreAssets.dashboardEmptyPage.swiftUIImage .padding(.bottom, 16) .accessibilityIdentifier("empty_page_image") - Text(DashboardLocalization.Empty.title) - .font(Theme.Fonts.titleMedium) - .foregroundColor(Theme.Colors.textPrimary) - .padding(.bottom, 8) - .accessibilityIdentifier("empty_page_title_text") Text(DashboardLocalization.Empty.subtitle) .font(Theme.Fonts.bodySmall) .foregroundColor(Theme.Colors.textSecondary) diff --git a/Dashboard/Dashboard/SwiftGen/Strings.swift b/Dashboard/Dashboard/SwiftGen/Strings.swift index 8067cdfab..aac74931c 100644 --- a/Dashboard/Dashboard/SwiftGen/Strings.swift +++ b/Dashboard/Dashboard/SwiftGen/Strings.swift @@ -18,8 +18,6 @@ public enum DashboardLocalization { public enum Empty { /// You are not enrolled in any courses yet. public static let subtitle = DashboardLocalization.tr("Localizable", "EMPTY.SUBTITLE", fallback: "You are not enrolled in any courses yet.") - /// It's empty - public static let title = DashboardLocalization.tr("Localizable", "EMPTY.TITLE", fallback: "It's empty") } public enum Header { /// Courses diff --git a/Dashboard/Dashboard/en.lproj/Localizable.strings b/Dashboard/Dashboard/en.lproj/Localizable.strings index 20d6b1307..88fc5d371 100644 --- a/Dashboard/Dashboard/en.lproj/Localizable.strings +++ b/Dashboard/Dashboard/en.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Dashboard @@ -10,5 +10,4 @@ "HEADER.COURSES" = "Courses"; "HEADER.WELCOME_BACK" = "Welcome back. Let's keep learning."; -"EMPTY.TITLE" = "It's empty"; "EMPTY.SUBTITLE" = "You are not enrolled in any courses yet."; diff --git a/Discovery/Discovery/Presentation/NativeDiscovery/CourseDetailsView.swift b/Discovery/Discovery/Presentation/NativeDiscovery/CourseDetailsView.swift index c4ed19e32..427cd4ade 100644 --- a/Discovery/Discovery/Presentation/NativeDiscovery/CourseDetailsView.swift +++ b/Discovery/Discovery/Presentation/NativeDiscovery/CourseDetailsView.swift @@ -99,19 +99,19 @@ public struct CourseDetailsView: View { viewModel?.showCourseVideo() }) }.aspectRatio(CGSize(width: 16, height: 8.5), contentMode: .fill) -// .frame(maxHeight: 250) .cornerRadius(12) .padding(.horizontal, 6) .padding(.top, 7) .fixedSize(horizontal: false, vertical: true) - // MARK: - Title and description - CourseTitleView(courseDetails: courseDetails) - // MARK: - Course state button CourseStateView(title: title, courseDetails: courseDetails, viewModel: viewModel) + .padding(.top, 24) + + // MARK: - Title and description + CourseTitleView(courseDetails: courseDetails) } // MARK: - HTML Embed @@ -177,10 +177,12 @@ public struct CourseDetailsView: View { } // MARK: - Offline mode SnackBar - OfflineSnackBarView(connectivity: viewModel.connectivity, - reloadAction: { - await viewModel.getCourseDetail(courseID: courseID, withProgress: false) - }) + if viewModel.courseState() != .enrollOpen { + OfflineSnackBarView(connectivity: viewModel.connectivity, + reloadAction: { + await viewModel.getCourseDetail(courseID: courseID, withProgress: false) + }) + } // MARK: - Error Alert if viewModel.showError { @@ -222,20 +224,34 @@ private struct CourseStateView: View { var body: some View { switch viewModel.courseState() { case .enrollOpen: - StyledButton(DiscoveryLocalization.Details.enrollNow, action: { - if !viewModel.userloggedIn { - viewModel.router.showRegisterScreen( - sourceScreen: .courseDetail( - courseDetails.courseID, - courseDetails.courseTitle) - ) + Group { + if viewModel.connectivity.isInternetAvaliable { + StyledButton(DiscoveryLocalization.Details.enrollNow, action: { + if !viewModel.userloggedIn { + viewModel.router.showRegisterScreen( + sourceScreen: .courseDetail( + courseDetails.courseID, + courseDetails.courseTitle) + ) + } else { + Task { + await viewModel.enrollToCourse(id: courseDetails.courseID) + } + } + }) + .padding(16) } else { - Task { - await viewModel.enrollToCourse(id: courseDetails.courseID) - } + HStack(alignment: .center, spacing: 10) { + CoreAssets.noWifiMini.swiftUIImage + .renderingMode(.template) + .foregroundStyle(Theme.Colors.warning) + Text(DiscoveryLocalization.Details.enrollmentNoInternet) + .multilineTextAlignment(.leading) + .font(Theme.Fonts.titleSmall) + Spacer() + }.cardStyle(paddingAll: 12, bgColor: Theme.Colors.textInputUnfocusedBackground, strokeColor: .clear) } - }) - .padding(16) + } .accessibilityIdentifier("enroll_button") case .enrollClose: Text(DiscoveryLocalization.Details.enrollmentDateIsOver) diff --git a/Discovery/Discovery/SwiftGen/Strings.swift b/Discovery/Discovery/SwiftGen/Strings.swift index 8bd26400c..987aec582 100644 --- a/Discovery/Discovery/SwiftGen/Strings.swift +++ b/Discovery/Discovery/SwiftGen/Strings.swift @@ -52,6 +52,8 @@ public enum DiscoveryLocalization { public static let enrollNow = DiscoveryLocalization.tr("Localizable", "DETAILS.ENROLL_NOW", fallback: "Enroll now") /// You cannot enroll in this course because the enrollment date is over. public static let enrollmentDateIsOver = DiscoveryLocalization.tr("Localizable", "DETAILS.ENROLLMENT_DATE_IS_OVER", fallback: "You cannot enroll in this course because the enrollment date is over.") + /// To enroll in this course, please make sure you are connected to the internet. + public static let enrollmentNoInternet = DiscoveryLocalization.tr("Localizable", "DETAILS.ENROLLMENT_NO_INTERNET", fallback: "To enroll in this course, please make sure you are connected to the internet.") /// Course details public static let title = DiscoveryLocalization.tr("Localizable", "DETAILS.TITLE", fallback: "Course details") /// View course diff --git a/Discovery/Discovery/en.lproj/Localizable.strings b/Discovery/Discovery/en.lproj/Localizable.strings index 09bd81912..8792ba146 100644 --- a/Discovery/Discovery/en.lproj/Localizable.strings +++ b/Discovery/Discovery/en.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Discovery @@ -34,3 +34,4 @@ "DETAILS.VIEW_COURSE" = "View course"; "DETAILS.ENROLL_NOW" = "Enroll now"; "DETAILS.ENROLLMENT_DATE_IS_OVER" = "You cannot enroll in this course because the enrollment date is over."; +"DETAILS.ENROLLMENT_NO_INTERNET" = "To enroll in this course, please make sure you are connected to the internet."; diff --git a/Discovery/Discovery/uk.lproj/Localizable.strings b/Discovery/Discovery/uk.lproj/Localizable.strings index 28f832e27..25f73bf53 100644 --- a/Discovery/Discovery/uk.lproj/Localizable.strings +++ b/Discovery/Discovery/uk.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Discovery @@ -34,3 +34,4 @@ "DETAILS.VIEW_COURSE" = "Переглянути курс"; "DETAILS.ENROLL_NOW" = "Зареєструватися"; "DETAILS.ENROLLMENT_DATE_IS_OVER" = "Ви не можете зареєструватися на цей курс, оскільки дата реєстрації закінчилася."; +"DETAILS.ENROLLMENT_NO_INTERNET" = "Щоб зареєструватися на цьому курсі, переконайтеся, що ви підключені до Інтернету."; diff --git a/OpenEdX.xcodeproj/project.pbxproj b/OpenEdX.xcodeproj/project.pbxproj index 043a37fbf..12b243007 100644 --- a/OpenEdX.xcodeproj/project.pbxproj +++ b/OpenEdX.xcodeproj/project.pbxproj @@ -43,8 +43,8 @@ 07A7D79028F5C9060000BE81 /* Core.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 07A7D78E28F5C9060000BE81 /* Core.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 07D5DA3528D075AA00752FD9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07D5DA3428D075AA00752FD9 /* AppDelegate.swift */; }; 07D5DA3E28D075AB00752FD9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 07D5DA3D28D075AB00752FD9 /* Assets.xcassets */; }; + 0AF04487E2B198E7A14F037F /* Pods_App_OpenEdX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEBF1DCBDEE79A04144660EB /* Pods_App_OpenEdX.framework */; }; 149FF39E2B9F1AB50034B33F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 149FF39C2B9F1AB50034B33F /* LaunchScreen.storyboard */; }; - 95C140F3BDF778364986E83B /* Pods_App_OpenEdX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F138C15C3A2515F8F94DAA8B /* Pods_App_OpenEdX.framework */; }; A500668B2B613ED10024680B /* PushNotificationsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A500668A2B613ED10024680B /* PushNotificationsManager.swift */; }; A500668D2B6143000024680B /* FCMProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A500668C2B6143000024680B /* FCMProvider.swift */; }; A50066912B61467B0024680B /* BrazeProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50066902B61467B0024680B /* BrazeProvider.swift */; }; @@ -126,11 +126,9 @@ 07D5DA3128D075AA00752FD9 /* OpenEdX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenEdX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 07D5DA3428D075AA00752FD9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 07D5DA3D28D075AB00752FD9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 1499CCAD7A0D8A3E6AF39794 /* Pods-App-OpenEdX.debugprod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugprod.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugprod.xcconfig"; sourceTree = ""; }; + 0F08B37CE833845FF5CD43E0 /* Pods-App-OpenEdX.releasestage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releasestage.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releasestage.xcconfig"; sourceTree = ""; }; 149FF39D2B9F1AB50034B33F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6F54C19C823A769E18923FA8 /* Pods-App-OpenEdX.debugstage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugstage.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugstage.xcconfig"; sourceTree = ""; }; - 8284179FC05AEE2591573E20 /* Pods-App-OpenEdX.debugdev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugdev.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugdev.xcconfig"; sourceTree = ""; }; - A24D6A8E1BC4DF46AD68904C /* Pods-App-OpenEdX.releaseprod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releaseprod.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releaseprod.xcconfig"; sourceTree = ""; }; + 5E9E8EEB795809CB9424EBA6 /* Pods-App-OpenEdX.releaseprod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releaseprod.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releaseprod.xcconfig"; sourceTree = ""; }; A500668A2B613ED10024680B /* PushNotificationsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationsManager.swift; sourceTree = ""; }; A500668C2B6143000024680B /* FCMProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FCMProvider.swift; sourceTree = ""; }; A50066902B61467B0024680B /* BrazeProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrazeProvider.swift; sourceTree = ""; }; @@ -142,11 +140,13 @@ A59568982B616D9400ED4F90 /* PushLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushLink.swift; sourceTree = ""; }; A59702282B83C87900CA064C /* FirebaseAnalyticsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseAnalyticsService.swift; sourceTree = ""; }; A5C10D8E2B861A70008E864D /* SegmentAnalyticsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentAnalyticsService.swift; sourceTree = ""; }; - A89AD827F52CF6A6B903606E /* Pods-App-OpenEdX.releasestage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releasestage.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releasestage.xcconfig"; sourceTree = ""; }; BA7468752B96201D00793145 /* DeepLinkRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinkRouter.swift; sourceTree = ""; }; - BB08ACD2CCA33D6DDDDD31B4 /* Pods-App-OpenEdX.releasedev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releasedev.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releasedev.xcconfig"; sourceTree = ""; }; + BEDEC3C1F88936685DCF7AE5 /* Pods-App-OpenEdX.debugdev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugdev.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugdev.xcconfig"; sourceTree = ""; }; + C9D8705F03FC185BBE66984C /* Pods-App-OpenEdX.debugprod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugprod.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugprod.xcconfig"; sourceTree = ""; }; + D19FBC727E9AD036986A0B8D /* Pods-App-OpenEdX.releasedev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.releasedev.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.releasedev.xcconfig"; sourceTree = ""; }; + E02715409EC1643835C9EFEE /* Pods-App-OpenEdX.debugstage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-OpenEdX.debugstage.xcconfig"; path = "Target Support Files/Pods-App-OpenEdX/Pods-App-OpenEdX.debugstage.xcconfig"; sourceTree = ""; }; E0D6E6A22B1626B10089F9C9 /* Theme.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Theme.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F138C15C3A2515F8F94DAA8B /* Pods_App_OpenEdX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App_OpenEdX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FEBF1DCBDEE79A04144660EB /* Pods_App_OpenEdX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App_OpenEdX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -166,9 +166,9 @@ 0219C67728F4347600D64452 /* Course.framework in Frameworks */, 027DB33028D8A063002B6862 /* Dashboard.framework in Frameworks */, A5BD3E302B83B0F7006A8983 /* SegmentFirebase in Frameworks */, - 95C140F3BDF778364986E83B /* Pods_App_OpenEdX.framework in Frameworks */, A51CDBED2B6D2BEE009B6D4E /* SegmentBraze in Frameworks */, A51CDBEF2B6D2BEE009B6D4E /* SegmentBrazeUI in Frameworks */, + 0AF04487E2B198E7A14F037F /* Pods_App_OpenEdX.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -261,7 +261,7 @@ 072787B028D34D83002E9142 /* Discovery.framework */, 0770DE4A28D0A462006D8A5D /* Authorization.framework */, 0770DE1228D07845006D8A5D /* Core.framework */, - F138C15C3A2515F8F94DAA8B /* Pods_App_OpenEdX.framework */, + FEBF1DCBDEE79A04144660EB /* Pods_App_OpenEdX.framework */, ); name = Frameworks; sourceTree = ""; @@ -269,12 +269,12 @@ 55A895025FB07897BA68E063 /* Pods */ = { isa = PBXGroup; children = ( - 1499CCAD7A0D8A3E6AF39794 /* Pods-App-OpenEdX.debugprod.xcconfig */, - 6F54C19C823A769E18923FA8 /* Pods-App-OpenEdX.debugstage.xcconfig */, - 8284179FC05AEE2591573E20 /* Pods-App-OpenEdX.debugdev.xcconfig */, - A24D6A8E1BC4DF46AD68904C /* Pods-App-OpenEdX.releaseprod.xcconfig */, - A89AD827F52CF6A6B903606E /* Pods-App-OpenEdX.releasestage.xcconfig */, - BB08ACD2CCA33D6DDDDD31B4 /* Pods-App-OpenEdX.releasedev.xcconfig */, + C9D8705F03FC185BBE66984C /* Pods-App-OpenEdX.debugprod.xcconfig */, + E02715409EC1643835C9EFEE /* Pods-App-OpenEdX.debugstage.xcconfig */, + BEDEC3C1F88936685DCF7AE5 /* Pods-App-OpenEdX.debugdev.xcconfig */, + 5E9E8EEB795809CB9424EBA6 /* Pods-App-OpenEdX.releaseprod.xcconfig */, + 0F08B37CE833845FF5CD43E0 /* Pods-App-OpenEdX.releasestage.xcconfig */, + D19FBC727E9AD036986A0B8D /* Pods-App-OpenEdX.releasedev.xcconfig */, ); path = Pods; sourceTree = ""; @@ -387,7 +387,7 @@ isa = PBXNativeTarget; buildConfigurationList = 07D5DA4528D075AB00752FD9 /* Build configuration list for PBXNativeTarget "OpenEdX" */; buildPhases = ( - 3165870BC90D2FA438CFF0A9 /* [CP] Check Pods Manifest.lock */, + CC61D82AF6FA18BD30E5E8E5 /* [CP] Check Pods Manifest.lock */, 0770DE2328D08647006D8A5D /* SwiftLint */, 07D5DA2D28D075AA00752FD9 /* Sources */, 07D5DA2E28D075AA00752FD9 /* Frameworks */, @@ -509,7 +509,7 @@ shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n"; }; - 3165870BC90D2FA438CFF0A9 /* [CP] Check Pods Manifest.lock */ = { + CC61D82AF6FA18BD30E5E8E5 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -691,7 +691,7 @@ }; 02DD1C9629E80CC200F35DCE /* DebugStage */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6F54C19C823A769E18923FA8 /* Pods-App-OpenEdX.debugstage.xcconfig */; + baseConfigurationReference = E02715409EC1643835C9EFEE /* Pods-App-OpenEdX.debugstage.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -779,7 +779,7 @@ }; 02DD1C9829E80CCB00F35DCE /* ReleaseStage */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A89AD827F52CF6A6B903606E /* Pods-App-OpenEdX.releasestage.xcconfig */; + baseConfigurationReference = 0F08B37CE833845FF5CD43E0 /* Pods-App-OpenEdX.releasestage.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -873,7 +873,7 @@ }; 0727875928D231FD002E9142 /* DebugDev */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8284179FC05AEE2591573E20 /* Pods-App-OpenEdX.debugdev.xcconfig */; + baseConfigurationReference = BEDEC3C1F88936685DCF7AE5 /* Pods-App-OpenEdX.debugdev.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -961,7 +961,7 @@ }; 0727875B28D23204002E9142 /* ReleaseDev */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BB08ACD2CCA33D6DDDDD31B4 /* Pods-App-OpenEdX.releasedev.xcconfig */; + baseConfigurationReference = D19FBC727E9AD036986A0B8D /* Pods-App-OpenEdX.releasedev.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1109,7 +1109,7 @@ }; 07D5DA4628D075AB00752FD9 /* DebugProd */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1499CCAD7A0D8A3E6AF39794 /* Pods-App-OpenEdX.debugprod.xcconfig */; + baseConfigurationReference = C9D8705F03FC185BBE66984C /* Pods-App-OpenEdX.debugprod.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1143,7 +1143,7 @@ }; 07D5DA4728D075AB00752FD9 /* ReleaseProd */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A24D6A8E1BC4DF46AD68904C /* Pods-App-OpenEdX.releaseprod.xcconfig */; + baseConfigurationReference = 5E9E8EEB795809CB9424EBA6 /* Pods-App-OpenEdX.releaseprod.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; diff --git a/Profile/Profile/Presentation/EditProfile/EditProfileView.swift b/Profile/Profile/Presentation/EditProfile/EditProfileView.swift index b2467d82c..8909ddfc6 100644 --- a/Profile/Profile/Presentation/EditProfile/EditProfileView.swift +++ b/Profile/Profile/Presentation/EditProfile/EditProfileView.swift @@ -175,6 +175,7 @@ public struct EditProfileView: View { HStack(alignment: .top, spacing: 6) { CoreAssets.alarm.swiftUIImage.renderingMode(.template) Text(viewModel.alertMessage ?? "") + .font(Theme.Fonts.labelLarge) }.shadowCardStyle(bgColor: Theme.Colors.warning, textColor: .black) .transition(.move(edge: .bottom)) diff --git a/Profile/Profile/SwiftGen/Strings.swift b/Profile/Profile/SwiftGen/Strings.swift index 69559d7c8..d1adacf55 100644 --- a/Profile/Profile/SwiftGen/Strings.swift +++ b/Profile/Profile/SwiftGen/Strings.swift @@ -56,8 +56,8 @@ public enum ProfileLocalization { public static let backToProfile = ProfileLocalization.tr("Localizable", "DELETE_ACCOUNT.BACK_TO_PROFILE", fallback: "Back to profile") /// Yes, delete account public static let comfirm = ProfileLocalization.tr("Localizable", "DELETE_ACCOUNT.COMFIRM", fallback: "Yes, delete account") - /// To confirm this action you need to enter your account password. - public static let description = ProfileLocalization.tr("Localizable", "DELETE_ACCOUNT.DESCRIPTION", fallback: "To confirm this action you need to enter your account password.") + /// To confirm this action, please enter your account password. + public static let description = ProfileLocalization.tr("Localizable", "DELETE_ACCOUNT.DESCRIPTION", fallback: "To confirm this action, please enter your account password.") /// The password is incorrect. Please try again. public static let incorrectPassword = ProfileLocalization.tr("Localizable", "DELETE_ACCOUNT.INCORRECT_PASSWORD", fallback: "The password is incorrect. Please try again.") /// Password @@ -148,10 +148,10 @@ public enum ProfileLocalization { public static let wifiTitle = ProfileLocalization.tr("Localizable", "SETTINGS.WIFI_TITLE", fallback: "Wi-fi only download") } public enum UnsavedDataAlert { - /// Changes you have made may not be saved. - public static let text = ProfileLocalization.tr("Localizable", "UNSAVED_DATA_ALERT.TEXT", fallback: "Changes you have made may not be saved.") - /// Leave profile? - public static let title = ProfileLocalization.tr("Localizable", "UNSAVED_DATA_ALERT.TITLE", fallback: "Leave profile?") + /// Changes you have made will be discarded. + public static let text = ProfileLocalization.tr("Localizable", "UNSAVED_DATA_ALERT.TEXT", fallback: "Changes you have made will be discarded.") + /// Leave without saving? + public static let title = ProfileLocalization.tr("Localizable", "UNSAVED_DATA_ALERT.TITLE", fallback: "Leave without saving?") } } // swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length diff --git a/Profile/Profile/en.lproj/Localizable.strings b/Profile/Profile/en.lproj/Localizable.strings index 8f88084ea..df2a437f8 100644 --- a/Profile/Profile/en.lproj/Localizable.strings +++ b/Profile/Profile/en.lproj/Localizable.strings @@ -1,4 +1,4 @@ -/* +/* Localizable.strings Profile @@ -32,8 +32,8 @@ "DELETE_ALERT.TITLE" = "Warning!"; "DELETE_ALERT.TEXT" = "Do you really want to delete your account?"; -"UNSAVED_DATA_ALERT.TITLE" = "Leave profile?"; -"UNSAVED_DATA_ALERT.TEXT" = "Changes you have made may not be saved."; +"UNSAVED_DATA_ALERT.TITLE" = "Leave without saving?"; +"UNSAVED_DATA_ALERT.TEXT" = "Changes you have made will be discarded."; "EDIT.TOO_YONG_USER" = "You must be over 13 years old to have a profile with full access to information."; "EDIT.LIMITED_PROFILE_DESCRIPTION" = "A limited profile only shares your username and profile photo."; @@ -52,7 +52,7 @@ "DELETE_ACCOUNT.TITLE" = "Delete account"; "DELETE_ACCOUNT.ARE_YOU_SURE" = "Are you sure you want to "; "DELETE_ACCOUNT.WANT_TO_DELETE" = "delete your account?"; -"DELETE_ACCOUNT.DESCRIPTION" = "To confirm this action you need to enter your account password."; +"DELETE_ACCOUNT.DESCRIPTION" = "To confirm this action, please enter your account password."; "DELETE_ACCOUNT.PASSWORD" = "Password"; "DELETE_ACCOUNT.PASSWORD_DESCRIPTION" = "Enter password"; "DELETE_ACCOUNT.COMFIRM" = "Yes, delete account"; diff --git a/Theme/Theme/Assets.xcassets/Colors/warningText.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/warningText.colorset/Contents.json new file mode 100644 index 000000000..be9d677bb --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/warningText.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 7c25fd7b6..4eeb5d2c3 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -70,6 +70,7 @@ public enum ThemeAssets { public static let toggleSwitchColor = ColorAsset(name: "ToggleSwitchColor") public static let navigationBarTintColor = ColorAsset(name: "navigationBarTintColor") public static let warning = ColorAsset(name: "warning") + public static let warningText = ColorAsset(name: "warningText") public static let white = ColorAsset(name: "white") public static let appLogo = ImageAsset(name: "appLogo") } diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index c36bd18db..473eb9c0a 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -44,6 +44,7 @@ public struct Theme { public private(set) static var textInputUnfocusedBackground = ThemeAssets.textInputUnfocusedBackground.swiftUIColor public private(set) static var textInputUnfocusedStroke = ThemeAssets.textInputUnfocusedStroke.swiftUIColor public private(set) static var warning = ThemeAssets.warning.swiftUIColor + public private(set) static var warningText = ThemeAssets.warningText.swiftUIColor public private(set) static var white = ThemeAssets.white.swiftUIColor public private(set) static var onProgress = ThemeAssets.onProgress.swiftUIColor public private(set) static var progressDone = ThemeAssets.progressDone.swiftUIColor