Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 0d3c755

Browse files
authored
Remove disabled switches from VPN Settings screen (#2203)
1 parent ac1cd2c commit 0d3c755

File tree

4 files changed

+22
-54
lines changed

4 files changed

+22
-54
lines changed

DuckDuckGo/NetworkProtectionVPNLocationView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private struct CountryItem: View {
134134
} label: {
135135
Image(systemName: "ellipsis.circle")
136136
.resizable()
137-
.frame(width: 22, height: 22)
137+
.frame(width: 22, height: 22).tint(.textSecondary)
138138
}
139139
}
140140
}
@@ -184,6 +184,7 @@ private struct MenuItem: View {
184184
.if(!isSelected) {
185185
$0.hidden()
186186
}
187+
.tint(.textPrimary)
187188
}
188189
}
189190
)

DuckDuckGo/NetworkProtectionVPNSettingsView.swift

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,60 +27,39 @@ struct NetworkProtectionVPNSettingsView: View {
2727
@StateObject var viewModel = NetworkProtectionVPNSettingsViewModel()
2828

2929
var body: some View {
30-
List {
31-
NavigationLink(destination: NetworkProtectionVPNLocationView()) {
32-
HStack {
33-
Text(UserText.netPPreferredLocationSettingTitle).daxBodyRegular().foregroundColor(.textPrimary)
34-
Spacer()
35-
Text(viewModel.preferredLocation).daxBodyRegular().foregroundColor(.textSecondary)
30+
VStack {
31+
List {
32+
Section {
33+
NavigationLink(destination: NetworkProtectionVPNLocationView()) {
34+
HStack {
35+
Text(UserText.netPPreferredLocationSettingTitle).daxBodyRegular().foregroundColor(.textPrimary)
36+
Spacer()
37+
Text(viewModel.preferredLocation).daxBodyRegular().foregroundColor(.textSecondary)
38+
}
39+
}
40+
}
41+
Section {
42+
HStack(spacing: 16) {
43+
Image("Info-Solid-24")
44+
.foregroundColor(.icon)
45+
Text(UserText.netPSecureDNSSettingFooter)
46+
.daxFootnoteRegular()
47+
.foregroundColor(.textSecondary)
48+
}
3649
}
3750
}
38-
toggleSection(
39-
text: UserText.netPAlwaysOnSettingTitle,
40-
footerText: UserText.netPAlwaysOnSettingFooter
41-
)
42-
toggleSection(
43-
text: UserText.netPSecureDNSSettingTitle,
44-
footerText: UserText.netPSecureDNSSettingFooter
45-
)
4651
}
4752
.applyInsetGroupedListStyle()
4853
.navigationTitle(UserText.netPVPNSettingsTitle)
4954
}
50-
51-
@ViewBuilder
52-
func toggleSection(text: String, footerText: String) -> some View {
53-
Section {
54-
HStack {
55-
VStack(alignment: .leading, spacing: 4) {
56-
Text(text)
57-
.font(.system(size: 16))
58-
.foregroundColor(.textPrimary.opacity(0.4))
59-
.font(.system(size: 13))
60-
.foregroundColor(.textSecondary.opacity(0.4))
61-
}
62-
63-
// These toggles are permanantly disabled as the features are permanantly enabled. Product decision.
64-
Toggle("", isOn: .constant(true))
65-
.disabled(true)
66-
.toggleStyle(SwitchToggleStyle(tint: .controlColor))
67-
}
68-
.listRowBackground(Color.cellBackground)
69-
} footer: {
70-
Text(footerText)
71-
.foregroundColor(.textSecondary)
72-
.accentColor(Color.controlColor)
73-
.font(.system(size: 13))
74-
.padding(.top, 6)
75-
}
76-
}
7755
}
7856

7957
private extension Color {
8058
static let textPrimary = Color(designSystemColor: .textPrimary)
8159
static let textSecondary = Color(designSystemColor: .textSecondary)
8260
static let cellBackground = Color(designSystemColor: .surface)
8361
static let controlColor = Color(designSystemColor: .accent)
62+
static let icon = Color(designSystemColor: .icons).opacity(0.3)
8463
}
8564

8665
#endif

DuckDuckGo/UserText.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,6 @@ In addition to the details entered into this form, your app issue report will co
660660
let message = NSLocalizedString("network.protection.vpn.location.country.item.formatted.cities.count", value: "%d cities", comment: "Subtitle of countries item when there are multiple cities, example : ")
661661
return message.format(arguments: count)
662662
}
663-
static let netPAlwaysOnSettingTitle = NSLocalizedString("network.protection.vpn.always.on.setting.title", value: "Always On", comment: "Title for the Always on VPN setting item.")
664-
static let netPAlwaysOnSettingFooter = NSLocalizedString("network.protection.vpn.always.on.setting.footer", value: "Automatically restore a VPN connection after interruption.", comment: "Footer text for the Always on VPN setting item.")
665-
static let netPSecureDNSSettingTitle = NSLocalizedString("network.protection.vpn.secure.dns.setting.title", value: "Secure DNS", comment: "Title for the Always on VPN setting item.")
666663
static let netPSecureDNSSettingFooter = NSLocalizedString("network.protection.vpn.secure.dns.setting.footer", value: "Network Protection prevents DNS leaks to your Internet Service Provider by routing DNS queries though the VPN tunnel to our own resolver.", comment: "Footer text for the Always on VPN setting item.")
667664
static let netPTurnOnNotificationsButtonTitle = NSLocalizedString("network.protection.turn.on.notifications.button.title", value: "Turn on Notifications", comment: "Title for the button to link to the iOS app settings and enable notifications app-wide.")
668665
static let netPTurnOnNotificationsSectionFooter = NSLocalizedString("network.protection.turn.on.notifications.section.footer", value: "Allow DuckDuckGo to notify you if your connection drops or VPN status changes.", comment: "Footer text under the button to link to the iOS app settings and enable notifications app-wide.")

DuckDuckGo/en.lproj/Localizable.strings

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,12 +1609,6 @@ https://duckduckgo.com/mac";
16091609
/* Title for the toggle for VPN alerts. */
16101610
"network.protection.vpn.alerts.toggle.title" = "VPN Alerts";
16111611

1612-
/* Footer text for the Always on VPN setting item. */
1613-
"network.protection.vpn.always.on.setting.footer" = "Automatically restore a VPN connection after interruption.";
1614-
1615-
/* Title for the Always on VPN setting item. */
1616-
"network.protection.vpn.always.on.setting.title" = "Always On";
1617-
16181612
/* Title for the VPN Location screen's All Countries section. */
16191613
"network.protection.vpn.location.all.countries.section.title" = "All Countries";
16201614

@@ -1645,9 +1639,6 @@ https://duckduckgo.com/mac";
16451639
/* Footer text for the Always on VPN setting item. */
16461640
"network.protection.vpn.secure.dns.setting.footer" = "Network Protection prevents DNS leaks to your Internet Service Provider by routing DNS queries though the VPN tunnel to our own resolver.";
16471641

1648-
/* Title for the Always on VPN setting item. */
1649-
"network.protection.vpn.secure.dns.setting.title" = "Secure DNS";
1650-
16511642
/* Title for the VPN Settings screen. */
16521643
"network.protection.vpn.settings.title" = "VPN Settings";
16531644

0 commit comments

Comments
 (0)