Made the necessary changes requested in the review
parent
64f7e8d947
commit
b1af98b111
|
@ -13,10 +13,7 @@ import "./shareon.css";
|
||||||
* media?: string,
|
* media?: string,
|
||||||
* text?: string,
|
* text?: string,
|
||||||
* via?: string,
|
* via?: string,
|
||||||
* fbAppId?: string,
|
* fbAppId?: string
|
||||||
* posttype?: string,
|
|
||||||
* tags?:[string],
|
|
||||||
* content?: string || [string]
|
|
||||||
* }) => string}}
|
* }) => string}}
|
||||||
*/
|
*/
|
||||||
const urlBuilderMap = {
|
const urlBuilderMap = {
|
||||||
|
@ -30,11 +27,11 @@ const urlBuilderMap = {
|
||||||
reddit: (d) => `https://www.reddit.com/submit?title=${d.title}&url=${d.url}`,
|
reddit: (d) => `https://www.reddit.com/submit?title=${d.title}&url=${d.url}`,
|
||||||
teams: (d) => `https://teams.microsoft.com/share?href=${d.url}${d.text ? `&msgText=${d.text}` : ''}`,
|
teams: (d) => `https://teams.microsoft.com/share?href=${d.url}${d.text ? `&msgText=${d.text}` : ''}`,
|
||||||
telegram: (d) => `https://telegram.me/share/url?url=${d.url}${d.text ? `&text=${d.text}` : ''}`,
|
telegram: (d) => `https://telegram.me/share/url?url=${d.url}${d.text ? `&text=${d.text}` : ''}`,
|
||||||
|
tumblr: (d) => `https://www.tumblr.com/widgets/share/tool?posttype=${d.url}&tags=${d.hashtags}${d.title? `&title=${d.title}`:''}&content=${d.content}${d.text? `&caption=${d.text}`:''}${d.via? `&show-via=${d.via}`:''}`,
|
||||||
twitter: (d) => `https://twitter.com/intent/tweet?url=${d.url}&text=${d.title}${d.via ? `&via=${d.via}` : ''}${d.hashtags? `&hashtags=${d.hashtags}` : ''}`,
|
twitter: (d) => `https://twitter.com/intent/tweet?url=${d.url}&text=${d.title}${d.via ? `&via=${d.via}` : ''}${d.hashtags? `&hashtags=${d.hashtags}` : ''}`,
|
||||||
viber: (d) => `viber://forward?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}`,
|
viber: (d) => `viber://forward?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}`,
|
||||||
vkontakte: (d) => `https://vk.com/share.php?url=${d.url}&title=${d.title}${d.media ? `&image=${d.media}` : ''}`,
|
vkontakte: (d) => `https://vk.com/share.php?url=${d.url}&title=${d.title}${d.media ? `&image=${d.media}` : ''}`,
|
||||||
whatsapp: (d) => `https://wa.me/?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}`,
|
whatsapp: (d) => `https://wa.me/?text=${d.title}%0D%0A${d.url}${d.text ? `%0D%0A%0D%0A${d.text}` : ''}`
|
||||||
tumblr: (d) => `https://www.tumblr.com/widgets/share/tool?posttype=${d.posttype}&tags=${d.tags}${d.title? `&title=${d.title}`:''}&content=${d.content}${d.caption? `&caption=${d.caption}`:''}${d.via? `&show-via=${d.via}`:''}`,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openUrl = (buttonUrl) => () => {
|
const openUrl = (buttonUrl) => () => {
|
||||||
|
|
Loading…
Reference in New Issue