@@ -25,6 +25,9 @@ import TagSelect from 'boost/components/TagSelect'
2525import ModeSelect from 'boost/components/ModeSelect'
2626import activityRecord from 'boost/activityRecord'
2727
28+ const electron = require ( 'electron' )
29+ const clipboard = electron . clipboard
30+
2831const BRAND_COLOR = '#18AF90'
2932
3033const editDeleteTutorialElement = (
@@ -84,6 +87,10 @@ const modeSelectTutorialElement = (
8487 </ svg >
8588)
8689
90+ function notify ( ...args ) {
91+ return new window . Notification ( ...args )
92+ }
93+
8794function makeInstantArticle ( article ) {
8895 return Object . assign ( { } , article )
8996}
@@ -154,6 +161,13 @@ export default class ArticleDetail extends React.Component {
154161 )
155162 }
156163
164+ handleClipboardButtonClick ( e ) {
165+ clipboard . writeText ( this . props . activeArticle . content )
166+ notify ( 'Saved to Clipboard!' , {
167+ body : 'Paste it wherever you want!'
168+ } )
169+ }
170+
157171 handleEditButtonClick ( e ) {
158172 let { dispatch } = this . props
159173 dispatch ( switchMode ( EDIT_MODE ) )
@@ -219,6 +233,9 @@ export default class ArticleDetail extends React.Component {
219233 < div className = 'tags' > < i className = 'fa fa-fw fa-tags' /> { tags } </ div >
220234 </ div >
221235 < div className = 'right' >
236+ < button onClick = { e => this . handleClipboardButtonClick ( e ) } className = 'editBtn' >
237+ < i className = 'fa fa-fw fa-clipboard' /> < span className = 'tooltip' > Copy to clipboard</ span >
238+ </ button >
222239 < button onClick = { e => this . handleEditButtonClick ( e ) } className = 'editBtn' >
223240 < i className = 'fa fa-fw fa-edit' /> < span className = 'tooltip' > Edit (e)</ span >
224241 </ button >
0 commit comments