Skip to content

Commit

Permalink
feat: open email when feedback is created
Browse files Browse the repository at this point in the history
closes #5
  • Loading branch information
steveoh committed Oct 13, 2021
1 parent 59a1ef4 commit 54bea2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"larr",
"loglevel",
"mapserv",
"noopener",
"noreferrer",
"postcss",
"relocator",
Expand Down
9 changes: 8 additions & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ export default function Footer() {
</div>
</div>
<div className="text-right">
<div>Feedback</div>
<a
className="text-yellow-500 hover:text-yellow-300"
href={`mailto:agrc-dev@utah.gov?subject=UGRC API Client ${version} Feedback`}
target="_blank"
rel="noopener noreferrer"
>
Feedback
</a>
</div>
</section>
);
Expand Down
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ app.on('web-contents-created', (_, contents) => {

try {
const url = new URL(urlString);
if (url.protocol === 'mailto:') {
return true;
}

if (!url.protocol === 'https:' || !safeHosts.includes(url.hostname)) {
return false;
Expand Down

0 comments on commit 54bea2f

Please sign in to comment.