Added copy to clipboard tool
This commit is contained in:
parent
e835ac96b5
commit
e87a3b4981
|
|
@ -12,8 +12,19 @@ const ArticleEditor = (props) => {
|
||||||
"contents": content
|
"contents": content
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let copyToClipboard = () => {
|
||||||
|
navigator.clipboard.writeText(content).then(function() {
|
||||||
|
console.log('Async: Copying to clipboard was successful!');
|
||||||
|
}, function(err) {
|
||||||
|
console.error('Async: Could not copy text: ', err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ArticleEditor">
|
<div className="ArticleEditor">
|
||||||
|
<div id="toolbar" className="toolbar">
|
||||||
|
<div className="btn" onClick={copyToClipboard()}>Copy to Clipboard</div>
|
||||||
|
</div>
|
||||||
<Article article={article}/>
|
<Article article={article}/>
|
||||||
<textarea onInput={e=>{setContent(e.target.value)}}></textarea>
|
<textarea onInput={e=>{setContent(e.target.value)}}></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,26 @@
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ArticleEditor .toolbar {
|
||||||
|
width: 100%;
|
||||||
|
height: 56px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ArticleEditor .toolbar .btn {
|
||||||
|
color: white;
|
||||||
|
background-color: darkgreen;
|
||||||
|
text-align: center;
|
||||||
|
align-items:center;
|
||||||
|
justify-content: center;
|
||||||
|
display: flex;
|
||||||
|
padding-left: 3px;
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
|
.ArticleEditor .toolbar .btn:hover{
|
||||||
|
background-color: #005400
|
||||||
|
}
|
||||||
|
|
||||||
.article .open {
|
.article .open {
|
||||||
max-height:100vh;
|
max-height:100vh;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue