Added copy to clipboard tool
This commit is contained in:
parent
c72d3882c7
commit
2023f37289
|
|
@ -12,8 +12,19 @@ const ArticleEditor = (props) => {
|
|||
"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 (
|
||||
<div className="ArticleEditor">
|
||||
<div id="toolbar" className="toolbar">
|
||||
<div className="btn" onClick={copyToClipboard()}>Copy to Clipboard</div>
|
||||
</div>
|
||||
<Article article={article}/>
|
||||
<textarea onInput={e=>{setContent(e.target.value)}}></textarea>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,26 @@
|
|||
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 {
|
||||
max-height:100vh;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue