Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix toggle color resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Apr 6, 2021
1 parent ba9635a commit e56a830
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private struct MenuView<Content: View>: View {
content
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
.accentColor(Color(BraveUX.braveOrange))
}
}
}
Expand All @@ -60,7 +61,6 @@ struct MenuItemButton: View {
.frame(maxWidth: .infinity, minHeight: 48.0, alignment: .leading)
}
.buttonStyle(TableCellButtonStyle())
.accentColor(Color(Theme.of(nil).colors.tints.home))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ struct VPNMenuButton: View {
}
}

private var vpnToggle: some View {
Group {
let toggle = Toggle("Brave VPN", isOn: isVPNEnabledBinding)
if #available(iOS 14.0, *) {
toggle
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
} else {
toggle
}
}
}

var body: some View {
Button(action: { toggleVPN(!BraveVPN.isConnected) }) {
HStack {
Expand All @@ -55,7 +67,7 @@ struct VPNMenuButton: View {
if isVPNStatusChanging {
ActivityIndicatorView(isAnimating: true)
}
Toggle("Brave VPN", isOn: isVPNEnabledBinding)
vpnToggle
.labelsHidden()
}
.padding(.horizontal, 14)
Expand Down

0 comments on commit e56a830

Please sign in to comment.