Add Facebook

This commit is contained in:
Nikita Karamov 2020-03-25 23:06:55 +01:00
parent 45660ad51e
commit 5086d68e9c
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ interface PublishPreset {
type UrlBuilder = (data: PublishPreset) => string;
const NETWORKS: { [name: string]: UrlBuilder } = {
facebook: (d) => `https://www.facebook.com/sharer/sharer.php?u=${d.url}`,
telegram: (d) => `https://telegram.me/share/url?url=${d.url}${d.extra.text ? `&text=${d.extra.text}` : ''}`,
twitter: (d) => `https://twitter.com/intent/tweet?url=${d.url}&text=${d.title}${d.extra.via ? `&via=${d.extra.via}` : ''}`,
whatsapp: (d) => `whatsapp://send?text=${d.title}%0D%0A${d.url}${d.extra.text ? `%0D%0A%0D%0A${d.extra.text}` : ''}`,

View File

@ -66,6 +66,14 @@ $width: $button-size - 2*$padding-hor;
}
&.facebook {
background-color: #1877F2;
&::before {
background-image: url("data:image/svg+xml,%3Csvg fill='%23fff' viewBox='0 2 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.671 15.469L17.203 12h-3.328V9.749c0-.949.465-1.874 1.956-1.874h1.513V4.922s-1.374-.235-2.686-.235c-2.741 0-4.533 1.662-4.533 4.669V12H7.078v3.469h3.047V24h3.75v-8.531h2.796z'/%3E%3C/svg%3E");
}
}
&.telegram {
background-color: #27A7E5;