From 28f0e55475ecac41034e3fac8c48ea0a332d364c Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Wed, 13 May 2020 23:34:12 -0700 Subject: on new paste modal --- frontend/src/components/modals/PasteModal.js | 69 ++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 frontend/src/components/modals/PasteModal.js (limited to 'frontend/src/components/modals/PasteModal.js') diff --git a/frontend/src/components/modals/PasteModal.js b/frontend/src/components/modals/PasteModal.js new file mode 100644 index 0000000..75c28a8 --- /dev/null +++ b/frontend/src/components/modals/PasteModal.js @@ -0,0 +1,69 @@ +import React from 'react'; +import Modal from 'react-modal'; +import { LeftPad, ModalHeader, RightPad } from './shared' +import { useHistory } from 'react-router-dom'; +import { PasteURLInput } from '../Inputs' +import { useClipboard } from 'use-clipboard-copy'; + +const modalStyles = { + content: { + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '500px', + height: '250px', + border: '1px solid #11111188' + } +}; + +const PasteModal = (props) => { + const history = useHistory(); + const fullURL = `${window.location.href}${props.hash}`; + const clipboard = useClipboard({ copiedTimeout: 3000 }); + Modal.setAppElement('body'); + + const redir = () => { + const redirUrl = `/${props.hash}` + history.push(redirUrl); + } + + return ( + +
+ + 📎 paste created + + + + + + + + + +
+
+ ); +} + +export default PasteModal \ No newline at end of file -- cgit v1.2.3