Skip to content

Commit fb4a36d

Browse files
authored
Merge pull request brave#5705 from luixxiul/refactoring-whiteButton
Refactor buttons on about:preferences#payments and bookmark dialog
2 parents 05e1231 + 23207ed commit fb4a36d

File tree

6 files changed

+60
-35
lines changed

6 files changed

+60
-35
lines changed

app/renderer/components/addEditBookmarkHanger.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ class AddEditBookmarkHanger extends ImmutableComponent {
188188
<div className='bookmarkButtons'>
189189
{
190190
this.props.originalDetail
191-
? <Button l10nId='remove' className='primaryButton whiteButton inlineButton' onClick={this.onRemoveBookmark} />
191+
? <Button l10nId='remove' className='removeButton whiteButton' onClick={this.onRemoveBookmark} />
192192
: null
193193
}
194-
<Button l10nId='done' disabled={!this.bookmarkNameValid} className='primaryButton' onClick={this.onSave} />
194+
<Button l10nId='done' disabled={!this.bookmarkNameValid} className='doneButton primaryButton' onClick={this.onSave} />
195195
</div>
196196
</div>
197197
</div>

js/about/preferences.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ class PaymentsTab extends ImmutableComponent {
10771077
<span data-l10n-id='ledgerBackupContent' />
10781078
<div className='copyKeyContainer'>
10791079
<div className='copyContainer'>
1080-
<Button l10nId='copy' className='whiteButton inlineButton' onClick={this.copyToClipboard.bind(this, paymentId)} />
1080+
<Button l10nId='copy' className='copyButton whiteButton wideButton' onClick={this.copyToClipboard.bind(this, paymentId)} />
10811081
</div>
10821082
<div className='keyContainer'>
10831083
<h3 data-l10n-id='firstKey' />
@@ -1086,7 +1086,7 @@ class PaymentsTab extends ImmutableComponent {
10861086
</div>
10871087
<div className='copyKeyContainer'>
10881088
<div className='copyContainer'>
1089-
<Button l10nId='copy' className='whiteButton inlineButton' onClick={this.copyToClipboard.bind(this, passphrase)} />
1089+
<Button l10nId='copy' className='copyButton whiteButton wideButton' onClick={this.copyToClipboard.bind(this, passphrase)} />
10901090
</div>
10911091
<div className='keyContainer'>
10921092
<h3 data-l10n-id='secondKey' />
@@ -1298,7 +1298,7 @@ class PaymentsTab extends ImmutableComponent {
12981298
<span data-l10n-id='off' />
12991299
<SettingCheckbox dataL10nId='on' prefKey={settings.PAYMENTS_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
13001300
</div>
1301-
{ this.props.ledgerData.get('created') && this.enabled ? <Button l10nId='advancedSettings' className='advancedSettings whiteButton inlineButton' onClick={this.props.showOverlay.bind(this, 'advancedSettings')} /> : null }
1301+
{ this.props.ledgerData.get('created') && this.enabled ? <Button l10nId='advancedSettings' className='advancedSettings whiteButton inlineButton wideButton' onClick={this.props.showOverlay.bind(this, 'advancedSettings')} /> : null }
13021302
</div>
13031303
</div>
13041304
{

less/about/preferences.less

+38-23
Original file line numberDiff line numberDiff line change
@@ -365,29 +365,35 @@ span.settingsListCopy {
365365
}
366366
}
367367

368-
span.browserButton.primaryButton {
369-
&.addFunds {
368+
span.browserButton {
369+
&.advancedSettings {
370370
font-size: 0.9em;
371-
margin-right: 50px;
372371
}
373372

374-
&.clearBrowsingDataButton,
375-
&.importNowButton,
376-
&.setAsDefaultButton,
377-
&.manageAdblockSettings,
378-
&.viewExtensionsInfo,
379-
&.manageAutofillDataButton {
380-
font-size: 0.9em;
381-
margin-top: 20px;
382-
padding: 5px 20px;
383-
}
373+
&.primaryButton {
374+
&.addFunds {
375+
font-size: 0.9em;
376+
margin-right: 50px;
377+
}
384378

385-
&.importNowButton {
386-
margin-top: 5px;
387-
}
379+
&.clearBrowsingDataButton,
380+
&.importNowButton,
381+
&.setAsDefaultButton,
382+
&.manageAdblockSettings,
383+
&.viewExtensionsInfo,
384+
&.manageAutofillDataButton {
385+
font-size: 0.9em;
386+
margin-top: 20px;
387+
padding: 5px 20px;
388+
}
388389

389-
&.setAsDefaultButton {
390-
margin-top: 5px;
390+
&.importNowButton {
391+
margin-top: 5px;
392+
}
393+
394+
&.setAsDefaultButton {
395+
margin-top: 5px;
396+
}
391397
}
392398
}
393399

@@ -898,7 +904,7 @@ div.nextPaymentSubmission {
898904
line-height: 1.3em;
899905
}
900906
span {
901-
display: inline-block;
907+
display: inline;
902908
}
903909
a {
904910
text-decoration: none;
@@ -943,15 +949,21 @@ div.nextPaymentSubmission {
943949

944950
.copyKeyContainer {
945951
display: flex;
952+
align-items: flex-end;
953+
justify-content: space-between;
946954
width: 75%;
947955
margin: 20px auto;
948956

949957
.copyContainer {
950-
margin-top: 35px;
958+
.copyButton {
959+
font-size: 14px;
960+
margin: 0;
961+
}
962+
951963
}
952964

953965
.keyContainer {
954-
margin-left: 75px;
966+
margin-left: 1em;
955967

956968
h3 {
957969
margin-bottom: 15px;
@@ -992,8 +1004,11 @@ div.nextPaymentSubmission {
9921004
}
9931005

9941006
.advancedSettingsFooter {
995-
padding: 20px 100px;
996-
text-align: right;
1007+
padding-top: 20px;
1008+
padding-bottom: 20px;
1009+
display: flex;
1010+
flex-wrap: wrap;
1011+
justify-content: center;
9971012
}
9981013

9991014
.recoveryOverlay {

less/button.less

+5-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
line-height: 22px;
1212
margin: 5px 5px 0px 0px;
1313
padding: 0px 20px;
14+
white-space: nowrap;
1415
}
1516

1617
span.buttonSeparator {
@@ -35,8 +36,6 @@ span.menuButton {
3536
}
3637
}
3738

38-
a.browserButton,
39-
span.browserButton,
4039
.browserButton {
4140
cursor: default;
4241
display: inline-block;
@@ -91,7 +90,8 @@ span.browserButton,
9190
&.wideButton,
9291
&.secondaryButton,
9392
&.secondaryAltButton,
94-
&.subtleButton {
93+
&.subtleButton,
94+
&.whiteButton {
9595
.buttonCommon;
9696
width: auto;
9797
height: auto;
@@ -121,20 +121,18 @@ span.browserButton,
121121
display: block;
122122
margin-right: 0px;
123123
margin-left: 0px;
124+
width: auto;
125+
padding: 3px 35px;
124126
}
125127

126128
&.whiteButton {
127129
background: linear-gradient(white, @lightGray);
128130
border: 2px solid white;
129131
box-shadow: @buttonShadow;
130132
cursor: pointer;
131-
display: block;
132133
font-weight: normal;
133134
font-style: normal;
134-
font-size: 14px;
135135
color: @darkGray;
136-
width: auto;
137-
padding: 3px 35px;
138136
}
139137

140138
&.inlineButton {

less/forms.less

+4
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,10 @@
569569

570570
.bookmarkButtons {
571571
margin: 20px 0 10px 0;
572+
573+
.doneButton {
574+
margin-right: 0;
575+
}
572576
}
573577

574578
.bookmarkFormInner {

less/navigationBar.less

+8
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,14 @@
610610
}
611611

612612
#navigator {
613+
.bookmarkButtons {
614+
display: flex;
615+
616+
.removeButton {
617+
flex-grow: 1;
618+
}
619+
}
620+
613621
.stopButton,
614622
.reloadButton,
615623
.homeButton {

0 commit comments

Comments
 (0)