Add Telegram

This commit is contained in:
Nikita Karamov 2020-03-25 22:11:25 +01:00
parent 2aa431ff95
commit 7d07c4fe67
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,7 @@ interface PublishPreset {
type UrlBuilder = (data: PublishPreset) => string;
const NETWORKS: { [name: string]: UrlBuilder } = {
telegram: (d) => `https://telegram.me/share/url?url=${encodeURIComponent(d.url)}${(d.extra && d.extra.text) ? `&text=${encodeURIComponent(d.extra.text)}` : ''}`,
};
function initShareonChild(child: HTMLElement, preset: PublishPreset) {

View File

@ -64,6 +64,15 @@ $width: $button-size - 2*$padding-hor;
content: '';
vertical-align: bottom;
}
&.telegram {
background-color: #27A7E5;
&::before {
background-image: url("data:image/svg+xml,%3Csvg viewBox='4.4 5 14 14' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M4.987 11.948c3.69-1.487 6.151-2.468 7.382-2.941 3.515-1.352 4.245-1.587 4.721-1.595.105-.002.339.022.491.136a.482.482 0 01.18.317c.017.091.038.299.021.461-.19 1.851-1.015 6.343-1.434 8.417-.177.877-.529 1.065-.867 1.094-.736.062-1.291-.343-2.003-.775-1.114-.675-1.788-.987-2.869-1.646-1.25-.762-.15-1.118.562-1.802.186-.179 3.371-3.042 3.357-3.128-.005-.032-.099-.34-.173-.401s-.184-.04-.262-.024c-.112.024-1.892 1.112-5.339 3.264-.506.321-.963.477-1.373.469-.452-.009-1.321-.236-1.968-.43-.792-.239-1.085-.351-1.03-.756.028-.211.23-.431.604-.66z'/%3E%3C/svg%3E");
}
}
}
}