Skip to content

Commit

Permalink
Fixes some issues that were introduced by mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Dec 19, 2024
1 parent abef952 commit 091f90d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ struct NumberedParagraphConfig {
let detail: Detail?

init(text: String, detail: Detail? = nil) {
self.text = Text(text)
// The LocalizedStringKey wrapper is necessary to properly parse markdown
self.text = Text(LocalizedStringKey(text))
self.detail = detail
}

Expand All @@ -81,7 +82,6 @@ private struct NumberedParagraph: View {
NumberedCircle(number: number)
VStack(alignment: .leading, spacing: Const.Spacing.textAndImage) {
HStack {
// The LocalizedStringKey wrapper is necessary to properly parse markdown
config.text
.foregroundStyle(Color(designSystemColor: .textPrimary))
.font(Font(uiFont: Const.Font.text))
Expand Down
11 changes: 9 additions & 2 deletions DuckDuckGo/Widgets/Education/WidgetEducationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ struct WidgetEducationView: View {

var secondParagraphText: Text {
if #available(iOS 18, *) {
return Text(UserText.addWidgetSettingsSecondParagraph)
// The LocalizedStringKey wrapper is necessary to properly parse markdown
return Text(LocalizedStringKey(UserText.addWidgetSettingsSecondParagraph))
} else {
// Ref: https://stackoverflow.com/questions/62168292/what-s-the-equivalent-to-string-localizedstringwithformat-for-swiftuis-lo
return Text("addWidget.settings.secondParagraph.\(Image.add)")
Expand Down Expand Up @@ -87,7 +88,13 @@ private extension Color {
extension Image {
static let add = Image("WidgetEducationAddIcon")
static let widgetExample = Image("WidgetEducationWidgetExample")
static let homeScreen = Image("WidgetEducationHomeScreen")
static var homeScreen: Image {
if #available(iOS 18, *) {
Image("WidgetEducationHomeScreen")
} else {
Image("WidgetEducationHomeScreeniOS17")
}
}
}

private enum Const {
Expand Down

0 comments on commit 091f90d

Please sign in to comment.