forked from MapComplete/MapComplete
Fix: substituteKeys works correctly if newline is in the text, fix 'send email to report broken'-button by porting it to svelte
This commit is contained in:
parent
2bbf966d22
commit
b4f65bf2f7
3 changed files with 137 additions and 95 deletions
31
src/UI/Popup/SendEmail.svelte
Normal file
31
src/UI/Popup/SendEmail.svelte
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<script lang="ts">
|
||||
|
||||
import type { OsmTags } from "../../Models/OsmFeature";
|
||||
import Svg from "../../Svg";
|
||||
import ToSvelte from "../Base/ToSvelte.svelte";
|
||||
import { Utils } from "../../Utils";
|
||||
|
||||
export let tags: Store<OsmTags>
|
||||
export let args: string[]
|
||||
|
||||
let [to, subject, body, button_text] = args.map(a => Utils.SubstituteKeys(a, $tags))
|
||||
let url = "mailto:" +
|
||||
to +
|
||||
"?subject=" +
|
||||
encodeURIComponent(subject) +
|
||||
"&body=" +
|
||||
encodeURIComponent(body)
|
||||
$: console.log(url)
|
||||
console.log(">>> args", args)
|
||||
</script>
|
||||
<a class="button flex items-center w-full" href={url}>
|
||||
<ToSvelte construct={Svg.envelope_svg().SetClass("w-8 h-8 mr-4 shrink-0")}/>
|
||||
{button_text}
|
||||
</a>
|
||||
SEND EMAIL to {to}
|
||||
<br/>
|
||||
subject: {subject}
|
||||
<br/>
|
||||
body: {body}
|
||||
<br/>
|
||||
{button_text}
|
||||
Loading…
Add table
Add a link
Reference in a new issue