From 9e87d14e90f8442dcd7bc609cedbbabea7bcb50f Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Thu, 26 Sep 2019 14:54:29 +0300 Subject: [PATCH] SharePrompt not using separate functions --- src/common/SharePrompt/SharePrompt.js | 40 ++++++++++----------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/src/common/SharePrompt/SharePrompt.js b/src/common/SharePrompt/SharePrompt.js index be29ada01..621aea78c 100644 --- a/src/common/SharePrompt/SharePrompt.js +++ b/src/common/SharePrompt/SharePrompt.js @@ -6,37 +6,17 @@ const Button = require('stremio/common/Button'); const TextInput = require('stremio/common/TextInput'); const styles = require('./styles'); -const renderInput = ({ className, href, icon, label }) => { - return ( - - ); -}; - -const renderUrl = (url) => { +const SharePrompt = (props) => { const inputRef = React.useRef(null); const copyToClipboard = () => { inputRef.current.select(); document.execCommand('copy'); }; - if (url.length === 0) { + if (props.url.length === 0) { return null; } - return ( -
- - -
- ); -}; - -const SharePrompt = (props) => { return (
+ +
+
+ +
- {renderUrl(props.url)} );