Skip to content

Commit

Permalink
Rebranded strings, removed AIChat, News, rewards sections
Browse files Browse the repository at this point in the history
  • Loading branch information
udaybansal19 committed Jun 10, 2024
1 parent fff212a commit 797c911
Show file tree
Hide file tree
Showing 15 changed files with 447 additions and 446 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ import os.log
extension BrowserViewController {
func featuresMenuSection(_ menuController: MenuViewController) -> some View {
VStack(alignment: .leading, spacing: 5) {
VPNMenuButton(
retryStateActive: Preferences.VPN.vpnReceiptStatus.value
== BraveVPN.ReceiptResponse.Status.retryPeriod.rawValue,
vpnProductInfo: self.vpnProductInfo,
displayVPNDestination: { [unowned self] vc in
(self.presentedViewController as? MenuViewController)?
.pushInnerMenu(vc)
},
enableInstalledVPN: { [unowned menuController] in
// Donate Enable VPN Activity for suggestions
let enableVPNActivity = ActivityShortcutManager.shared.createShortcutActivity(
type: .enableBraveVPN
)
menuController.userActivity = enableVPNActivity
enableVPNActivity.becomeCurrent()
},
displayAlert: { [unowned menuController] alert in
menuController.present(alert, animated: true)
},
openURL: { [weak self] url in
guard let self = self else { return }
self.openURLInNewTab(
url,
isPrivate: self.privateBrowsingManager.isPrivateBrowsing,
isPrivileged: false
)
}
)
// VPNMenuButton(
// retryStateActive: Preferences.VPN.vpnReceiptStatus.value
// == BraveVPN.ReceiptResponse.Status.retryPeriod.rawValue,
// vpnProductInfo: self.vpnProductInfo,
// displayVPNDestination: { [unowned self] vc in
// (self.presentedViewController as? MenuViewController)?
// .pushInnerMenu(vc)
// },
// enableInstalledVPN: { [unowned menuController] in
// // Donate Enable VPN Activity for suggestions
// let enableVPNActivity = ActivityShortcutManager.shared.createShortcutActivity(
// type: .enableBraveVPN
// )
// menuController.userActivity = enableVPNActivity
// enableVPNActivity.becomeCurrent()
// },
// displayAlert: { [unowned menuController] alert in
// menuController.present(alert, animated: true)
// },
// openURL: { [weak self] url in
// guard let self = self else { return }
// self.openURLInNewTab(
// url,
// isPrivate: self.privateBrowsingManager.isPrivateBrowsing,
// isPrivileged: false
// )
// }
// )

// Region Button is populated without current selected detail title for features menu
RegionMenuButton(
Expand All @@ -67,35 +67,35 @@ extension BrowserViewController {
.padding(.horizontal, 14)
.padding(.bottom, 5)

VPNMenuButton(
retryStateActive: Preferences.VPN.vpnReceiptStatus.value
== BraveVPN.ReceiptResponse.Status.retryPeriod.rawValue,
vpnProductInfo: self.vpnProductInfo,
description: Strings.OptionsMenu.braveVPNItemDescription,
displayVPNDestination: { [unowned self] vc in
(self.presentedViewController as? MenuViewController)?
.pushInnerMenu(vc)
},
enableInstalledVPN: { [unowned menuController] in
// Donate Enable VPN Activity for suggestions
let enableVPNActivity = ActivityShortcutManager.shared.createShortcutActivity(
type: .enableBraveVPN
)
menuController.userActivity = enableVPNActivity
enableVPNActivity.becomeCurrent()
},
displayAlert: { [unowned self] alert in
self.popToBVC()
self.present(alert, animated: true)
},
openURL: { [unowned self] url in
self.openURLInNewTab(
url,
isPrivate: self.privateBrowsingManager.isPrivateBrowsing,
isPrivileged: false
)
}
)
// VPNMenuButton(
// retryStateActive: Preferences.VPN.vpnReceiptStatus.value
// == BraveVPN.ReceiptResponse.Status.retryPeriod.rawValue,
// vpnProductInfo: self.vpnProductInfo,
// description: Strings.OptionsMenu.braveVPNItemDescription,
// displayVPNDestination: { [unowned self] vc in
// (self.presentedViewController as? MenuViewController)?
// .pushInnerMenu(vc)
// },
// enableInstalledVPN: { [unowned menuController] in
// // Donate Enable VPN Activity for suggestions
// let enableVPNActivity = ActivityShortcutManager.shared.createShortcutActivity(
// type: .enableBraveVPN
// )
// menuController.userActivity = enableVPNActivity
// enableVPNActivity.becomeCurrent()
// },
// displayAlert: { [unowned self] alert in
// self.popToBVC()
// self.present(alert, animated: true)
// },
// openURL: { [unowned self] url in
// self.openURLInNewTab(
// url,
// isPrivate: self.privateBrowsingManager.isPrivateBrowsing,
// isPrivileged: false
// )
// }
// )

// Region Button is populated including the details for privacy feature menu
RegionMenuButton(
Expand All @@ -107,7 +107,7 @@ extension BrowserViewController {
}
)

Divider()
// Divider()

MenuItemFactory.button(
for: .playlist(subtitle: Strings.OptionsMenu.bravePlaylistItemDescription)
Expand All @@ -117,7 +117,7 @@ extension BrowserViewController {
}

// Add Brave Talk and News options only in normal browsing
if !privateBrowsingManager.isPrivateBrowsing {
if false && !privateBrowsingManager.isPrivateBrowsing {
// Show Brave News if it is first launch and after first launch If the new is enabled
if Preferences.General.isFirstLaunch.value
|| (!Preferences.General.isFirstLaunch.value && Preferences.BraveNews.isEnabled.value)
Expand Down Expand Up @@ -147,7 +147,7 @@ extension BrowserViewController {
}

// Add Brave-Leo options only in normal browsing
if !privateBrowsingManager.isPrivateBrowsing {
if false && !privateBrowsingManager.isPrivateBrowsing {
MenuItemFactory.button(for: .leo) { [unowned self] in
self.popToBVC()
self.openBraveLeo()
Expand Down Expand Up @@ -345,7 +345,7 @@ extension BrowserViewController {
}

// Add Brave-Leo options only in normal browsing
if !browserViewController.tabManager.privateBrowsingManager.isPrivateBrowsing {
if false && !browserViewController.tabManager.privateBrowsingManager.isPrivateBrowsing {
MenuItemButton(
icon: Image(braveSystemName: "leo.product.brave-leo"),
title: Strings.leoMenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ extension BrowserViewController: ToolbarDelegate {
featuresMenuSection(menuController)
} else {
privacyFeaturesMenuSection(menuController)
Divider()
}
Divider()
destinationMenuSection(menuController, isShownOnWebPage: isShownOnWebPage)
if let tabURL = selectedTabURL {
Divider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class NewTabPageViewController: UIViewController {
sections.insert(ntpDefaultBrowserCalloutProvider, at: 0)
}

if !privateBrowsingManager.isPrivateBrowsing {
if false && !privateBrowsingManager.isPrivateBrowsing {
sections.append(
BraveNewsSectionProvider(
dataSource: feedDataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class InitialSearchEngines {
}

private func priorityOverrides() {
// No priority engines are live at the moment.
defaultSearchEngine = .google
}

// MARK: - Helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class TopToolbarView: UIView, ToolbarProtocol {
shieldsRewardsStack.addArrangedSubview(rewardsButton)

[
leadingItemsStackView, locationContainer, shieldsRewardsStack, trailingItemsStackView,
leadingItemsStackView, locationContainer, trailingItemsStackView,
cancelButton,
].forEach {
mainStackView.addArrangedSubview($0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ extension Preferences {

/// Tells the app whether we should show Privacy Hub in new tab page view controller
public static let showNewTabPrivacyHub =
Option<Bool>(key: "newtabpage.show-newtab-privacyhub", default: true)
Option<Bool>(key: "newtabpage.show-newtab-privacyhub", default: false)

/// First time when privacy hub hide action is tieggered user will be shown alert
static let hidePrivacyHubAlertShown = Option<Bool>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ import os
isEnabled: true
),
ClearableSetting(id: .downloads, clearable: DownloadsClearable(), isEnabled: true),
ClearableSetting(
id: .braveNews,
clearable: BraveNewsClearable(feedDataSource: feedDataSource),
isEnabled: true
),
// ClearableSetting(
// id: .braveNews,
// clearable: BraveNewsClearable(feedDataSource: feedDataSource),
// isEnabled: true
// ),
ClearableSetting(id: .playlistCache, clearable: PlayListCacheClearable(), isEnabled: false),
ClearableSetting(id: .playlistData, clearable: PlayListDataClearable(), isEnabled: false),
ClearableSetting(id: .recentSearches, clearable: RecentSearchClearable(), isEnabled: true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct AdvancedShieldsSettingsView: View {

var body: some View {
List {
DefaultShieldsViewView(settings: settings)
// DefaultShieldsViewView(settings: settings)
ClearDataSectionView(settings: settings)

Section {
Expand All @@ -46,14 +46,14 @@ struct AdvancedShieldsSettingsView: View {
ManageWebsiteDataView()
}

NavigationLink {
PrivacyReportSettingsView()
} label: {
LabelView(
title: Strings.PrivacyHub.privacyReportsTitle,
subtitle: nil
)
}.listRowBackground(Color(.secondaryBraveGroupedBackground))
// NavigationLink {
// PrivacyReportSettingsView()
// } label: {
// LabelView(
// title: Strings.PrivacyHub.privacyReportsTitle,
// subtitle: nil
// )
// }.listRowBackground(Color(.secondaryBraveGroupedBackground))
}

OtherPrivacySettingsSectionView(settings: settings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ struct OtherPrivacySettingsSectionView: View {
),
option: Preferences.Privacy.screenTimeEnabled
)
ToggleView(
title: Strings.P3A.settingTitle,
subtitle: Strings.P3A.settingSubtitle,
toggle: $settings.isP3AEnabled
)
OptionToggleView(
title: Strings.Settings.sendUsagePingTitle,
subtitle: Strings.Settings.sendUsagePingDescription,
option: Preferences.DAU.sendUsagePing
)
// ToggleView(
// title: Strings.P3A.settingTitle,
// subtitle: Strings.P3A.settingSubtitle,
// toggle: $settings.isP3AEnabled
// )
// OptionToggleView(
// title: Strings.Settings.sendUsagePingTitle,
// subtitle: Strings.Settings.sendUsagePingDescription,
// option: Preferences.DAU.sendUsagePing
// )
} header: {
Text(Strings.otherPrivacySettingsSection)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,37 +110,37 @@ class ShortcutSettingsViewController: TableViewController {
)
)

dataSource.sections.append(
Section(
rows: [
Row(
text: Strings.Shortcuts.shortcutSettingsEnableVPNTitle,
selection: { [unowned self] in
manageShortcutActivity(for: .enableBraveVPN)
},
accessory: .disclosureIndicator,
cellClass: MultilineValue1Cell.self
)
],
footer: .title(Strings.Shortcuts.shortcutSettingsEnableVPNDescription)
)
)
// dataSource.sections.append(
// Section(
// rows: [
// Row(
// text: Strings.Shortcuts.shortcutSettingsEnableVPNTitle,
// selection: { [unowned self] in
// manageShortcutActivity(for: .enableBraveVPN)
// },
// accessory: .disclosureIndicator,
// cellClass: MultilineValue1Cell.self
// )
// ],
// footer: .title(Strings.Shortcuts.shortcutSettingsEnableVPNDescription)
// )
// )

dataSource.sections.append(
Section(
rows: [
Row(
text: Strings.Shortcuts.shortcutSettingsOpenBraveNewsTitle,
selection: { [unowned self] in
manageShortcutActivity(for: .openBraveNews)
},
accessory: .disclosureIndicator,
cellClass: MultilineValue1Cell.self
)
],
footer: .title(Strings.Shortcuts.shortcutSettingsOpenBraveNewsDescription)
)
)
// dataSource.sections.append(
// Section(
// rows: [
// Row(
// text: Strings.Shortcuts.shortcutSettingsOpenBraveNewsTitle,
// selection: { [unowned self] in
// manageShortcutActivity(for: .openBraveNews)
// },
// accessory: .disclosureIndicator,
// cellClass: MultilineValue1Cell.self
// )
// ],
// footer: .title(Strings.Shortcuts.shortcutSettingsOpenBraveNewsDescription)
// )
// )

dataSource.sections.append(
Section(
Expand Down
Loading

0 comments on commit 797c911

Please sign in to comment.