@@ -6,12 +6,17 @@ const React = require('react')
66const Immutable = require ( 'immutable' )
77const messages = require ( '../constants/messages' )
88const SortableTable = require ( '../components/sortableTable' )
9+ const aboutActions = require ( './aboutActions' )
910
1011const ipc = window . chrome . ipc
1112
1213require ( '../../less/about/history.less' )
1314require ( '../../node_modules/font-awesome/css/font-awesome.css' )
1415
16+ const tranformVersionInfoToString = ( versionInformation ) =>
17+ versionInformation
18+ . reduce ( ( coll , entry ) => `${ coll } \n${ entry . get ( 'name' ) } : ${ entry . get ( 'version' ) } ` , '' )
19+
1520class AboutBrave extends React . Component {
1621 constructor ( ) {
1722 super ( )
@@ -21,6 +26,11 @@ class AboutBrave extends React.Component {
2126 this . setState ( { versionInformation : Immutable . fromJS ( versionInformation ) } )
2227 }
2328 } )
29+ this . onCopy = this . onCopy . bind ( this )
30+ }
31+
32+ onCopy ( ) {
33+ aboutActions . setClipboard ( tranformVersionInfoToString ( this . state . versionInformation ) )
2434 }
2535
2636 render ( ) {
@@ -30,7 +40,10 @@ class AboutBrave extends React.Component {
3040 </ div >
3141
3242 < div className = 'siteDetailsPageContent aboutAbout' >
33- < div className = 'sectionTitle' data-l10n-id = 'versionInformation' />
43+ < div className = 'title' >
44+ < span className = 'sectionTitle' data-l10n-id = 'versionInformation' />
45+ < span className = 'fa fa-clipboard' title = 'Copy password to clipboard' onClick = { this . onCopy } />
46+ </ div >
3447 < SortableTable
3548 headings = { [ 'Name' , 'Version' ] }
3649 rows = { this . state . versionInformation . map ( ( entry ) => [
0 commit comments