From f767b6a99806b5e19fd326ffbef57c7ffa134533 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 28 Jun 2017 09:06:46 -0300 Subject: [PATCH] Removing old --- .../client/components/CopyButton.js | 16 --- .../client/components/Permalink.js | 107 ------------------ 2 files changed, 123 deletions(-) delete mode 100644 plugins/talk-plugin-permalink/client/components/CopyButton.js delete mode 100644 plugins/talk-plugin-permalink/client/components/Permalink.js diff --git a/plugins/talk-plugin-permalink/client/components/CopyButton.js b/plugins/talk-plugin-permalink/client/components/CopyButton.js deleted file mode 100644 index 405468a6e..000000000 --- a/plugins/talk-plugin-permalink/client/components/CopyButton.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import {t} from 'plugin-api/beta/client/services'; -import {withCopyToClipboard} from 'plugin-api/beta/client/hocs'; -import {Button} from 'plugin-api/beta/client/components/ui'; - -class ButtonCopyToClipboard extends React.Component { - render () { - return ( - - ); - } -} - -export default withCopyToClipboard(ButtonCopyToClipboard); diff --git a/plugins/talk-plugin-permalink/client/components/Permalink.js b/plugins/talk-plugin-permalink/client/components/Permalink.js deleted file mode 100644 index 68406472e..000000000 --- a/plugins/talk-plugin-permalink/client/components/Permalink.js +++ /dev/null @@ -1,107 +0,0 @@ -import React from 'react'; -import cn from 'classnames'; -import styles from './styles.css'; -import {t} from 'plugin-api/beta/client/services'; -import {ClickOutside} from 'plugin-api/beta/client/components'; -import {Icon, Button} from 'plugin-api/beta/client/components/ui'; - -const name = 'talk-plugin-permalink'; - -export default class PermalinkButton extends React.Component { - constructor (props) { - super(props); - - this.state = { - popoverOpen: false, - copySuccessful: null, - copyFailure: null - }; - - } - - toggle = () => { - this.popover.style.top = `${this.linkButton.offsetTop - 80}px`; - - this.setState({ - popoverOpen: !this.state.popoverOpen - }); - } - - handleClickOutside = () => { - this.setState({ - popoverOpen: false - }); - } - - copyPermalink = () => { - this.permalinkInput.select(); - try { - document.execCommand('copy'); - this.setState({ - copySuccessful: true, - copyFailure: null - }); - } catch (err) { - this.setState({ - copyFailure: true, - copySuccessful: null - }); - } - - this.timeout = window.setTimeout(() => { - this.setState({ - copyFailure: null, - copySuccessful: null - }); - }, 3000); - } - - componentWillUnmount() { - window.clearTimeout(this.timeout); - } - - render () { - const {copySuccessful, copyFailure, popoverOpen} = this.state; - const {asset} = this.props; - return ( - -
- - - -
this.popover = ref} - className={cn([`${name}-popover`, styles.popover, {[styles.active]: popoverOpen}])}> - - this.permalinkInput = input} - defaultValue={`${asset.url}#${this.props.commentId}`} - /> - - - -
-
-
- ); - } -}