UNPKG

web-social-share

Version:

A Web Component to share urls and text on social networks

10 lines (9 loc) 433 B
import { openNewWindow, shareEncodedUrl } from "../utils/utils"; export const telegram = async ({ socialShareUrl, socialShareText, openWindowTarget: target }) => { let urlString = `https://t.me/share/url?url=${shareEncodedUrl(socialShareUrl)}`; if (socialShareText) { urlString += `&text=${encodeURIComponent(socialShareText)}`; } openNewWindow({ urlString, target }); }; //# sourceMappingURL=telegram.js.map