Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: addition of signal social media #935

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 53 additions & 5 deletions frontend/components/modal/ModalSharePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,51 @@
iconSize="1.5em"
/>
</s-facebook>
<!-- <div class="flex h-full w-full cursor-pointer items-center gap-3">
<Icon :name="IconMap.SIGNAL" size="1.5em" />
<p>{{ $t("components.modal_share_page.signal") }}</p>
</div> -->
<div
@click="
copyToClipboard(
props?.event?.name
? props?.event?.name
: props?.organization?.name
? props?.organization?.name
: '',
getCurrentUrl(),
'https://signal.me/#p'
)
"
@keypress.space="
copyToClipboard(
props?.event?.name
? props?.event?.name
: props?.organization?.name
? props?.organization?.name
: '',
getCurrentUrl(),
'https://signal.me/#p'
)
"
@keypress.enter="
copyToClipboard(
props?.event?.name
? props?.event?.name
: props?.organization?.name
? props?.organization?.name
: '',
getCurrentUrl(),
'https://signal.me/#p'
)
"
class="focus-brand"
tabindex="0"
role="button"
>
<MetaTagSocialMedia
class="dark:hover:dark-distinct-text text-light-text hover:text-light-distinct-text dark:text-dark-text"
:iconName="IconMap.SIGNAL"
:text="$t('components.modal_share_page.signal')"
iconSize="1.5em"
/>
</div>
<div
@click="
copyToClipboard(
Expand Down Expand Up @@ -294,12 +335,19 @@ const nativeBehaviorOptions = {

const windowFeatures = {};

const copyToClipboard = async (name: string, url: string) => {
const copyToClipboard = async (
name: string,
url: string,
redirectURL?: string
) => {
try {
await navigator.clipboard.writeText(url);
contentCopied.value = true;
setTimeout(() => {
contentCopied.value = false;
if (redirectURL) {
window.open(redirectURL, "_blank");
}
}, 2000);
} catch (error) {
console.error(`Could not copy text: ${error}`);
Expand Down
Loading