Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 1597632

Browse files
authored
Merge pull request #6107 from gyandeeps/issue5790
Update: Add copy to clipboard for about brave page (fixes #5790)
2 parents cfd2b5d + 942e95c commit 1597632

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ httpse.leveldb
6464

6565
# vim swap files
6666
*.swp
67+
68+
# webstrom
69+
.idea

js/about/brave.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ const React = require('react')
66
const Immutable = require('immutable')
77
const messages = require('../constants/messages')
88
const SortableTable = require('../components/sortableTable')
9+
const aboutActions = require('./aboutActions')
910

1011
const ipc = window.chrome.ipc
1112

1213
require('../../less/about/history.less')
1314
require('../../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+
1520
class 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) => [

less/about/siteDetails.less

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ body {
7878
display: block;
7979
clear: both;
8080

81+
.title {
82+
width: 400px;
83+
display: flex;
84+
justify-content: space-between;
85+
margin-left: @aboutPageSectionPadding;
86+
}
87+
8188
.sectionTitle {
8289
font-size: 16px;
8390
margin-bottom: 12px;
84-
padding-left: @aboutPageSectionPadding;
8591
}
8692
}
8793
}

0 commit comments

Comments
 (0)