Add email feedback form

This commit is contained in:
Brahim Hadriche committed 2023-07-04 18:26:34 -04:00
1 parent 016d6de6d6
commit 00df78d862
2 files changed
+21 -7

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Links to the app info in web app - Links to the app info in web app
- Loading indicator for search page in web app - Loading indicator for search page in web app
- Feedback link through email
### Fixed ### Fixed
+20 -7
View File
@@ -38,19 +38,21 @@
let deviceInfo = {}; let deviceInfo = {};
let invidiousInfo = {}; let invidiousInfo = {};
let preferencesInfo = {}; let preferencesInfo = {};
const feedbackTitle = encodeURIComponent("[Feedback] Playlet");
let githubUrlIssue = "https://github.com/iBicha/playlet/issues/new"; let githubUrlIssue = "https://github.com/iBicha/playlet/issues/new";
let mailToUrl = "mailto:brahim.hadriche@gmail.com";
playletStateStore.subscribe((value) => { playletStateStore.subscribe((value) => {
appInfo = value.app || {}; appInfo = value.app || {};
deviceInfo = value.device || {}; deviceInfo = value.device || {};
invidiousInfo = value.invidious || {}; invidiousInfo = value.invidious || {};
preferencesInfo = value.preferences || {}; preferencesInfo = value.preferences || {};
githubUrlIssue = CreateGithubIssueUrl(); githubUrlIssue = createGithubIssueUrl();
mailToUrl = createMailToUrl();
}); });
function CreateGithubIssueUrl() { function createFeedbackBody() {
let title = "[Feedback] Playlet"; return `### Feedback
let body = `### Feedback
_insert feedback here_ _insert feedback here_
#### App Info #### App Info
@@ -72,9 +74,16 @@ ${JSON.stringify(invidiousInfo, null, 2)}
\`\`\` \`\`\`
${JSON.stringify(preferencesInfo, null, 2)} ${JSON.stringify(preferencesInfo, null, 2)}
\`\`\``; \`\`\``;
title = encodeURIComponent(title); }
body = encodeURIComponent(body);
return `https://github.com/iBicha/playlet/issues/new?title=${title}&body=${body}`; function createGithubIssueUrl() {
const body = encodeURIComponent(createFeedbackBody());
return `https://github.com/iBicha/playlet/issues/new?title=${feedbackTitle}&body=${body}`;
}
function createMailToUrl() {
const body = encodeURIComponent(createFeedbackBody());
return `mailto:brahim.hadriche@gmail.com?subject=${feedbackTitle}&body=${body}`;
} }
</script> </script>
@@ -86,6 +95,10 @@ ${JSON.stringify(preferencesInfo, null, 2)}
href={githubUrlIssue} href={githubUrlIssue}
target="_blank" target="_blank"
rel="noopener noreferrer">creating an issue on Github</a rel="noopener noreferrer">creating an issue on Github</a
>
or by
<a class="link" href={mailToUrl} target="_blank" rel="noopener noreferrer"
>sending an email</a
>. >.
</div> </div>
<div class="overflow-x-auto"> <div class="overflow-x-auto">