diff --git a/public/src/assets/odnoklassniki.png b/public/src/assets/odnoklassniki.png index cca164cd..0c003e49 100644 Binary files a/public/src/assets/odnoklassniki.png and b/public/src/assets/odnoklassniki.png differ diff --git a/public/src/assets/viber.png b/public/src/assets/viber.png deleted file mode 100644 index 7f5c00db..00000000 Binary files a/public/src/assets/viber.png and /dev/null differ diff --git a/public/src/assets/vk.png b/public/src/assets/vk.png index 87960829..2d4306b8 100644 Binary files a/public/src/assets/vk.png and b/public/src/assets/vk.png differ diff --git a/public/src/assets/whatsapp.png b/public/src/assets/whatsapp.png index a5057519..c1cbd90f 100644 Binary files a/public/src/assets/whatsapp.png and b/public/src/assets/whatsapp.png differ diff --git a/public/src/components/SharePanel/SharePanel.sass b/public/src/components/SharePanel/SharePanel.sass index 5af56092..0f37cd38 100644 --- a/public/src/components/SharePanel/SharePanel.sass +++ b/public/src/components/SharePanel/SharePanel.sass @@ -98,6 +98,8 @@ .social-icon cursor: pointer transition: 0.2s + width: 40px + height: 40px &:hover transform: scale(1.1) diff --git a/public/src/components/SharePanel/SharePanel.tsx b/public/src/components/SharePanel/SharePanel.tsx index 7a207fa0..55d16200 100644 --- a/public/src/components/SharePanel/SharePanel.tsx +++ b/public/src/components/SharePanel/SharePanel.tsx @@ -3,8 +3,34 @@ import {Button} from "../Button/Button"; import "./SharePanel.sass" import {ToggleButton} from "../ToggleButton/ToggleButton"; import {Img} from "../Image/Image"; +import {AppNotesStore} from "../../modules/stores/NotesStore"; +import {parseNoteTitle} from "../../modules/utils"; export class SharePanel extends ScReact.Component { + + shareToVK = () => { + const url = "https://vk.com/share.php?url=" + window.location.href + "&title=" + parseNoteTitle(AppNotesStore.state.selectedNote.title) + this.openShareWindow(url) + } + + shareToOdnoklassniki = () => { + const url = "https://connect.ok.ru/offer?url=" + window.location.href + "&title=" + parseNoteTitle(AppNotesStore.state.selectedNote.title) + this.openShareWindow(url) + } + + shareToWhatsApp = () => { + const url = "https://wa.me/?text=" + window.location.href + this.openShareWindow(url) + } + + openShareWindow = (url:string) => { + const width = 800, height = 500; + const left = (window.screen.width - width) / 2; + const top = (window.screen.height - height) / 2; + const social_window = window.open(url, "share_window", "height=" + height + ",width=" + width + ",top=" + top + ",left=" + left); + social_window.focus(); + } + render() { return (
@@ -27,10 +53,9 @@ export class SharePanel extends ScReact.Component {

Поделиться через соц. сети

- - - - + + +