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

Commit

Permalink
Add webcompat report button to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cuba committed Oct 3, 2023
1 parent 624dbf7 commit 1ed89bc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ extension BrowserViewController {
}
}
}

MenuItemButton(icon: Image(braveSystemName: "leo.warning.triangle-outline"), title: Strings.Shields.reportABrokenSite) {
browserViewController.dismiss(animated: true) {
browserViewController.showSubmitReportView(for: tabURL)
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ extension BrowserViewController: TopToolbarDelegate {
popover.present(from: topToolbar.locationView.shieldsButton, on: self)
}

private func showSubmitReportView(for url: URL) {
func showSubmitReportView(for url: URL) {
// Strip fragments and query params from url
var components = URLComponents(url: url, resolvingAgainstBaseURL: false)
components?.fragment = nil
Expand Down
7 changes: 4 additions & 3 deletions Sources/Brave/Frontend/Shields/SubmitReportSuccessView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ struct SubmitReportSuccessView: View {
var body: some View {
VStack(alignment: .center, spacing: 16) {
Image(braveSystemName: "leo.check.circle-outline")
.font(.title)
.foregroundStyle(Color(braveSystemName: .textTertiary))
.resizable()
.frame(width: 48, height: 48)
.foregroundStyle(Color(braveSystemName: .systemfeedbackSuccessIcon))

Text(Strings.Shields.siteReportedTitle)
.multilineTextAlignment(.center)
Expand All @@ -27,7 +28,7 @@ struct SubmitReportSuccessView: View {
.lineLimit(3)
.foregroundStyle(Color(braveSystemName: .textTertiary))
}
.padding()
.padding(32)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"idiom" : "universal"
}
]
}

0 comments on commit 1ed89bc

Please sign in to comment.