Skip to content

Commit

Permalink
Update NTP context menu to add search bar visibility toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Oct 18, 2024
1 parent 3819af2 commit aa11ed7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ struct UserText {
// MARK: New Tab
// Context Menu
static let newTabBottomPopoverTitle = NSLocalizedString("newTab.bottom.popover.title", value: "New Tab Page", comment: "Title of the popover that appears when pressing the bottom right button")
static let newTabMenuItemShowSearchBar = NSLocalizedString("newTab.menu.item.show.search.bar", value: "Show Search Field", comment: "Title of the menu item in the home page to show/hide search bar section")
static let newTabMenuItemShowFavorite = NSLocalizedString("newTab.menu.item.show.favorite", value: "Show Favorites", comment: "Title of the menu item in the home page to show/hide favorite section")
static let newTabMenuItemShowContinuteSetUp = NSLocalizedString("newTab.menu.item.show.continue.setup", value: "Show Next Steps", comment: "Title of the menu item in the home page to show/hide continue setup section")
static let newTabMenuItemShowRecentActivity = NSLocalizedString("newTab.menu.item.show.recent.activity", value: "Show Recent Activity", comment: "Title of the menu item in the home page to show/hide recent activity section")
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/HomePage/View/HomePageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ extension HomePage.Views {

@ViewBuilder
func sectionsVisibilityContextMenuItems() -> some View {
if addressBarModel.shouldShowAddressBar {
Toggle(UserText.newTabMenuItemShowSearchBar, isOn: $model.isSearchBarVisible)
.toggleStyle(.checkbox)
}
if model.isContinueSetUpAvailable {
Toggle(UserText.newTabMenuItemShowContinuteSetUp, isOn: $model.isContinueSetUpVisible)
.toggleStyle(.checkbox)
Expand Down
12 changes: 12 additions & 0 deletions DuckDuckGo/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -35109,6 +35109,18 @@
}
}
},
"newTab.menu.item.show.search.bar" : {
"comment" : "Title of the menu item in the home page to show/hide search bar section",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Show Search Field"
}
}
}
},
"newTab.recent.activity.section.title" : {
"comment" : "Title of the RecentActivity section in the home page",
"extractionState" : "extracted_with_value",
Expand Down

0 comments on commit aa11ed7

Please sign in to comment.