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

Commit

Permalink
Refactor buttons on about:preferences#payments (part 2)
Browse files Browse the repository at this point in the history
- Removed redundant classes from bookmarkButtons to fix the size difference between "Remove" and "Done" buttons, which was introduced with the commit 85e428a
- Introduced new classes "removeButton" and "doneButton" inside bookmarkButtons to make the width of the row same as the other rows
- Introduced a new class "copyButton" to keep the font-size of the recovery key copy buttons to 14px
- Indroduced a flexbox to copyKeyContainer to keep the buttons aligned

Auditors: @bradleyrichter

Test Plan:
1. Click the bookmark button on the URL bar
2. Make sure height of "Remove" and "Done" buttons is equal
3. Make sure "Remove" button is longer than "Done" button
4. Make sure color of "Remove" label is no longer white on hover
5. Make sure width of the row of the buttons is equal to the other rows
6. Open about:bookmarks and edit a bookmark
7. Make sure height and width of "Remove" and "Done" are equal
8. Open about:preferences#payments, click Advanced Settings and Backup your wallet
9. Make sure keys and buttons are aligned
10. Make sure font-size of the labels "Copy" is 14px
  • Loading branch information
Suguru Hirahara committed Nov 22, 2016
1 parent 75a754a commit 23207ed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/renderer/components/addEditBookmarkHanger.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ class AddEditBookmarkHanger extends ImmutableComponent {
<div className='bookmarkButtons'>
{
this.props.originalDetail
? <Button l10nId='remove' className='primaryButton whiteButton inlineButton' onClick={this.onRemoveBookmark} />
? <Button l10nId='remove' className='removeButton whiteButton' onClick={this.onRemoveBookmark} />
: null
}
<Button l10nId='done' disabled={!this.bookmarkNameValid} className='primaryButton' onClick={this.onSave} />
<Button l10nId='done' disabled={!this.bookmarkNameValid} className='doneButton primaryButton' onClick={this.onSave} />
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ class PaymentsTab extends ImmutableComponent {
<span data-l10n-id='ledgerBackupContent' />
<div className='copyKeyContainer'>
<div className='copyContainer'>
<Button l10nId='copy' className='whiteButton inlineButton' onClick={this.copyToClipboard.bind(this, paymentId)} />
<Button l10nId='copy' className='copyButton whiteButton wideButton' onClick={this.copyToClipboard.bind(this, paymentId)} />
</div>
<div className='keyContainer'>
<h3 data-l10n-id='firstKey' />
Expand All @@ -1067,7 +1067,7 @@ class PaymentsTab extends ImmutableComponent {
</div>
<div className='copyKeyContainer'>
<div className='copyContainer'>
<Button l10nId='copy' className='whiteButton inlineButton' onClick={this.copyToClipboard.bind(this, passphrase)} />
<Button l10nId='copy' className='copyButton whiteButton wideButton' onClick={this.copyToClipboard.bind(this, passphrase)} />
</div>
<div className='keyContainer'>
<h3 data-l10n-id='secondKey' />
Expand Down
12 changes: 9 additions & 3 deletions less/about/preferences.less
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ div.nextPaymentSubmission {
line-height: 1.3em;
}
span {
display: inline-block;
display: inline;
}
a {
text-decoration: none;
Expand Down Expand Up @@ -949,15 +949,21 @@ div.nextPaymentSubmission {

.copyKeyContainer {
display: flex;
align-items: flex-end;
justify-content: space-between;
width: 75%;
margin: 20px auto;

.copyContainer {
margin-top: 35px;
.copyButton {
font-size: 14px;
margin: 0;
}

}

.keyContainer {
margin-left: 75px;
margin-left: 1em;

h3 {
margin-bottom: 15px;
Expand Down
1 change: 0 additions & 1 deletion less/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ span.menuButton {
border: 2px solid white;
box-shadow: @buttonShadow;
cursor: pointer;
display: block;
font-weight: normal;
font-style: normal;
color: @darkGray;
Expand Down
4 changes: 4 additions & 0 deletions less/forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@

.bookmarkButtons {
margin: 20px 0 10px 0;

.doneButton {
margin-right: 0;
}
}

.bookmarkFormInner {
Expand Down
8 changes: 8 additions & 0 deletions less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@
}

#navigator {
.bookmarkButtons {
display: flex;

.removeButton {
flex-grow: 1;
}
}

.stopButton,
.reloadButton,
.homeButton {
Expand Down

1 comment on commit 23207ed

@luixxiul
Copy link
Contributor

@luixxiul luixxiul commented on 23207ed Dec 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For QA: 3. Make sure "Remove" button is longer than "Done" button of 23207ed will be is no longer necessary after #6000 is merged.

Please sign in to comment.