SHARE
TWEET

Untitled

a guest Aug 13th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from "react";
  2. import { FiCopy, FiDownload } from "react-icons/fi";
  3. import { CopyToClipboard } from "react-copy-to-clipboard";
  4. import { BrowserRouter, Link } from "react-router-dom";
  5.  
  6. class PlayerCaption extends React.Component {
  7.   constructor(props) {
  8.     super(props);
  9.     this.downloadVid = this.downloadVid.bind(this);
  10.     this.onCopy = this.onCopy.bind(this);
  11.     this.state = {
  12.       copied: false,
  13.       value: "default text"
  14.     };
  15.   }
  16.   downloadVid() {
  17.     this.props.dwn_url();
  18.   }
  19.   onCopy = () => {
  20.     this.setState({ copied: true });
  21.   };
  22.  
  23.   render() {
  24.     return (
  25.       <div className="caption">
  26.         <p className="video-buttons">
  27.           <CopyToClipboard text={this.props.copy()} onCopy={this.onCopy}>
  28.             <button type="button" id={this.props.id}>
  29.               <FiCopy size={30} />
  30.             </button>
  31.           </CopyToClipboard>
  32.           {this.state.copied ? <span>Copied!</span> : null}
  33.           <BrowserRouter>
  34.             <Link
  35.               to={this.props.dwn_url()}
  36.               onClick={e => e.preventDefault()}
  37.               download={this.props.dwn_url()}
  38.             >
  39.               <FiDownload size={30} />
  40.             </Link>
  41.           </BrowserRouter>
  42.         </p>
  43.       </div>
  44.     );
  45.   }
  46. }
  47.  
  48. export default PlayerCaption;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top