[iOS] Update Shred settings UI to display descriptions for each option (#36136)
Update Shred settings UI to display descriptions for each option.
This commit is contained in:
+21
-15
@@ -14,25 +14,31 @@ struct ShredSettingsView: View {
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
FormPicker(selection: $settings.shredLevel) {
|
||||
ForEach(SiteShredLevel.allCases) { level in
|
||||
Text(level.localizedTitle)
|
||||
.foregroundColor(Color(.secondaryBraveLabel))
|
||||
Section {
|
||||
Picker(selection: $settings.shredLevel) {
|
||||
ForEach(SiteShredLevel.allCases) { level in
|
||||
LabelView(
|
||||
title: level.localizedTitle,
|
||||
subtitle: level.localizedDescription
|
||||
)
|
||||
.tag(level)
|
||||
}
|
||||
} label: {
|
||||
EmptyView()
|
||||
}
|
||||
} label: {
|
||||
LabelView(
|
||||
title: Strings.Shields.autoShred,
|
||||
subtitle: nil
|
||||
.pickerStyle(.inline)
|
||||
.listRowBackground(Color(.secondaryBraveGroupedBackground))
|
||||
} header: {
|
||||
Text(Strings.Shields.autoShredSectionTitle)
|
||||
}
|
||||
Section {
|
||||
ToggleView(
|
||||
title: Strings.Shields.shredHistoryRowTitle,
|
||||
subtitle: Strings.Shields.shredHistoryRowDescription,
|
||||
toggle: $settings.shredHistoryItems
|
||||
)
|
||||
.listRowBackground(Color(.secondaryBraveGroupedBackground))
|
||||
}
|
||||
.listRowBackground(Color(.secondaryBraveGroupedBackground))
|
||||
ToggleView(
|
||||
title: Strings.Shields.shredHistoryRowTitle,
|
||||
subtitle: Strings.Shields.shredHistoryRowDescription,
|
||||
toggle: $settings.shredHistoryItems
|
||||
)
|
||||
.listRowBackground(Color(.secondaryBraveGroupedBackground))
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(Color(UIColor.braveGroupedBackground))
|
||||
|
||||
+11
@@ -99,4 +99,15 @@ extension SiteShredLevel: Identifiable {
|
||||
return Strings.Shields.shredOnAppClose
|
||||
}
|
||||
}
|
||||
|
||||
var localizedDescription: String {
|
||||
switch self {
|
||||
case .never:
|
||||
return Strings.Shields.shredNeverDescription
|
||||
case .whenSiteClosed:
|
||||
return Strings.Shields.shredOnSiteTabsClosedDescription
|
||||
case .appExit:
|
||||
return Strings.Shields.shredOnAppCloseDescription
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,6 +388,15 @@ extension Strings.Shields {
|
||||
comment: "An option setting for never automatically shreding site data"
|
||||
)
|
||||
|
||||
/// The description for never automatically shreding site data
|
||||
public static let shredNeverDescription = NSLocalizedString(
|
||||
"ShredNeverDescription",
|
||||
tableName: "BraveShared",
|
||||
bundle: .module,
|
||||
value: "Browsing data is never shred automatically",
|
||||
comment: "The description for never automatically shreding site data"
|
||||
)
|
||||
|
||||
/// An option setting for shredding when the site is closed
|
||||
public static let shredOnSiteTabsClosed = NSLocalizedString(
|
||||
"ShredOnSiteTabsClosed",
|
||||
@@ -397,6 +406,15 @@ extension Strings.Shields {
|
||||
comment: "An option setting for automatically shredding when the site is closed"
|
||||
)
|
||||
|
||||
/// The description for shredding when the site is closed
|
||||
public static let shredOnSiteTabsClosedDescription = NSLocalizedString(
|
||||
"ShredOnSiteTabsClosedDescription",
|
||||
tableName: "BraveShared",
|
||||
bundle: .module,
|
||||
value: "Browsing data is automatically shredded when all tabs open to a site are closed",
|
||||
comment: "The description for shredding when the site is closed"
|
||||
)
|
||||
|
||||
/// An option setting for shredding when the app is closed
|
||||
public static let shredOnAppClose = NSLocalizedString(
|
||||
"ShredOnAppClose",
|
||||
@@ -406,6 +424,24 @@ extension Strings.Shields {
|
||||
comment: "An option setting for automatically shredding only when the app is closed"
|
||||
)
|
||||
|
||||
/// The description for shredding when the app is closed
|
||||
public static let shredOnAppCloseDescription = NSLocalizedString(
|
||||
"ShredOnAppCloseDescription",
|
||||
tableName: "BraveShared",
|
||||
bundle: .module,
|
||||
value: "Browsing data is automatically shredded when the Brave app is closed / restarted",
|
||||
comment: "The description for shredding when the app is closed"
|
||||
)
|
||||
|
||||
/// The title for the auto shred section in settings
|
||||
public static let autoShredSectionTitle = NSLocalizedString(
|
||||
"AutoShredSectionTitle",
|
||||
tableName: "BraveShared",
|
||||
bundle: .module,
|
||||
value: "Automatically Shred Browsing Data",
|
||||
comment: "The description for shredding when the app is closed"
|
||||
)
|
||||
|
||||
/// A title for a confirmation window that appears when a user clicks on 'Shred Data'
|
||||
public static let shredSiteDataConfirmationTitle = NSLocalizedString(
|
||||
"ShredSiteDataConfirmationTitle",
|
||||
|
||||
Reference in New Issue
Block a user