Add Whatsapp and Telegram sharing providers

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-29 10:26:31 +02:00
parent c5b9a98334
commit d383d0ecff
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 32 additions and 0 deletions

View File

@ -64,6 +64,12 @@
<a :href="facebookShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="facebook" size="is-large" type="is-primary"
/></a>
<a :href="whatsAppShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="whatsapp" size="is-large" type="is-primary"
/></a>
<a :href="telegramShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="telegram" size="is-large" type="is-primary"
/></a>
<a :href="linkedInShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="linkedin" size="is-large" type="is-primary"
/></a>
@ -129,6 +135,16 @@ export default class ShareEventModal extends Vue {
)}&title=${this.event.title}`;
}
get whatsAppShareUrl(): string {
return `https://wa.me/?text=${encodeURIComponent(this.basicTextToEncode)}`;
}
get telegramShareUrl(): string {
return `https://t.me/share/url?url=${encodeURIComponent(
this.event.url
)}&text=${encodeURIComponent(this.event.title)}`;
}
get emailShareUrl(): string {
return `mailto:?to=&body=${this.event.url}&subject=${this.event.title}`;
}

View File

@ -57,6 +57,12 @@
<a :href="linkedInShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="linkedin" size="is-large" type="is-primary"
/></a>
<a :href="whatsAppShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="whatsapp" size="is-large" type="is-primary"
/></a>
<a :href="telegramShareUrl" target="_blank" rel="nofollow noopener"
><b-icon icon="telegram" size="is-large" type="is-primary"
/></a>
<a
:href="diasporaShareUrl"
class="diaspora"
@ -114,6 +120,16 @@ export default class ShareGroupModal extends Vue {
)}&title=${displayName(this.group)}`;
}
get whatsAppShareUrl(): string {
return `https://wa.me/?text=${encodeURIComponent(this.basicTextToEncode)}`;
}
get telegramShareUrl(): string {
return `https://t.me/share/url?url=${encodeURIComponent(
this.group.url
)}&text=${encodeURIComponent(displayName(this.group))}`;
}
get emailShareUrl(): string {
return `mailto:?to=&body=${this.group.url}&subject=${displayName(
this.group