UNPKG

web-social-share

Version:

A Web Component to share urls and text on social networks

13 lines (12 loc) 587 B
import { openNewWindow, shareEncodedUrl } from "../utils/utils"; export const pinterest = async ({ socialShareUrl, socialShareMedia, socialShareText, openWindowTarget: target }) => { let urlString = `https://www.pinterest.com/pin/create/button/?url=${shareEncodedUrl(socialShareUrl)}`; if (socialShareMedia) { urlString += `&media=${encodeURIComponent(socialShareMedia)}`; } if (socialShareText) { urlString += `&description=${encodeURIComponent(socialShareText)}`; } openNewWindow({ urlString, target }); }; //# sourceMappingURL=pinterest.js.map