This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 973
Syncing styling #7152
Merged
Merged
Syncing styling #7152
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ const niceware = require('niceware') | |
// Components | ||
const ModalOverlay = require('../../../../js/components/modalOverlay') | ||
const Button = require('../../../../js/components/button') | ||
const {DeviceNameTextbox} = require('../textbox') | ||
const {SettingsList, SettingItem} = require('../settings') | ||
|
||
const aboutActions = require('../../../../js/about/aboutActions') | ||
const getSetting = require('../../../../js/settings').getSetting | ||
|
@@ -35,19 +35,28 @@ class SyncTab extends ImmutableComponent { | |
|
||
get setupContent () { | ||
// displayed before a sync userId has been created | ||
return <div> | ||
return <div className='setupContent'> | ||
<Button l10nId='syncStart' className='primaryButton' onClick={this.props.showOverlay.bind(this, 'syncStart')} /> | ||
<Button l10nId='syncAdd' className='whiteButton' onClick={this.props.showOverlay.bind(this, 'syncAdd')} /> | ||
</div> | ||
} | ||
|
||
get postSetupContent () { | ||
const {SettingCheckbox} = require('../../../../js/about/preferences') | ||
return <div><div className='settingsList' id='syncEnableSwitch'> | ||
<SettingCheckbox dataL10nId='syncEnable' prefKey={settings.SYNC_ENABLED} settings={this.props.settings} onChangeSetting={this.toggleSync} /> | ||
</div> | ||
<Button l10nId='syncNewDevice' className='whiteButton syncNewDeviceButton' onClick={this.props.showOverlay.bind(this, 'syncNewDevice')} /> | ||
</div> | ||
return <SettingsList> | ||
<div className='device'> | ||
<SettingCheckbox dataL10nId='syncEnable' id='syncEnableSwitch' prefKey={settings.SYNC_ENABLED} settings={this.props.settings} onChangeSetting={this.toggleSync} /> | ||
<div> | ||
<span className='syncDeviceLabel' data-l10n-id='syncDeviceName' /> | ||
<div className='deviceName'> | ||
{getSetting(settings.SYNC_DEVICE_NAME, this.props.settings)} | ||
</div> | ||
</div> | ||
</div> | ||
<SettingItem> | ||
<Button l10nId='syncNewDevice' className='whiteButton' onClick={this.props.showOverlay.bind(this, 'syncNewDevice')} /> | ||
</SettingItem> | ||
</SettingsList> | ||
} | ||
|
||
get qrcodeContent () { | ||
|
@@ -56,7 +65,7 @@ class SyncTab extends ImmutableComponent { | |
} | ||
return this.props.syncQRVisible | ||
? <div> | ||
<div><Button l10nId='syncHideQR' className='whiteButton syncToggleButton' onClick={this.props.hideQR} /></div> | ||
<div><Button l10nId='syncHideQR' className='whiteButton wideButton syncToggleButton' onClick={this.props.hideQR} /></div> | ||
<img id='syncQR' title='Brave sync QR code' src={this.props.syncData.get('seedQr')} /> | ||
</div> | ||
: <Button l10nId='syncShowQR' className='whiteButton syncToggleButton' onClick={this.props.showQR} /> | ||
|
@@ -76,7 +85,7 @@ class SyncTab extends ImmutableComponent { | |
] | ||
return this.props.syncPassphraseVisible | ||
? <div> | ||
<Button l10nId='syncHidePassphrase' className='whiteButton syncToggleButton' onClick={this.props.hidePassphrase} /> | ||
<Button l10nId='syncHidePassphrase' className='whiteButton wideButton syncToggleButton' onClick={this.props.hidePassphrase} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
<pre id='syncPassphrase'>{words.join('\n')}</pre> | ||
</div> | ||
: <Button l10nId='syncShowPassphrase' className='whiteButton syncToggleButton' onClick={this.props.showPassphrase} /> | ||
|
@@ -106,34 +115,45 @@ class SyncTab extends ImmutableComponent { | |
const placeholder = process.platform | ||
? [(osName[process.platform] || process.platform), 'Laptop'].join(' ') | ||
: getSetting(settings.SYNC_DEVICE_NAME, this.props.settings) | ||
return <div> | ||
<span data-l10n-id='syncDeviceName' /> | ||
<DeviceNameTextbox spellCheck='false' | ||
return <SettingItem> | ||
<span data-l10n-id='syncDeviceNameInput' /> | ||
<input className='deviceNameInput formControl' spellCheck='false' | ||
ref={(node) => { this.deviceNameInput = node }} | ||
data-isDeviceName | ||
placeholder={placeholder} /> | ||
</div> | ||
</SettingItem> | ||
} | ||
|
||
get addOverlayContent () { | ||
return <div className='syncOverlay'> | ||
<p data-l10n-id='syncEnterPassphrase' /> | ||
<textarea spellCheck='false' | ||
ref={(node) => { this.passphraseInput = node }} | ||
className='form-control' /> | ||
<div>{this.deviceNameInputContent}</div> | ||
<Button l10nId='syncCreate' className='primaryButton' | ||
onClick={this.onRestore} | ||
disabled={!!this.passphraseInput} /> | ||
<SettingsList> | ||
<SettingItem> | ||
<span data-l10n-id='syncEnterPassphrase' /> | ||
<textarea spellCheck='false' | ||
ref={(node) => { this.passphraseInput = node }} | ||
className='form-control' /> | ||
</SettingItem> | ||
{this.deviceNameInputContent} | ||
</SettingsList> | ||
</div> | ||
} | ||
|
||
get addOverlayFooter () { | ||
return <Button l10nId='syncCreate' className='primaryButton' | ||
onClick={this.onRestore} | ||
disabled={!!this.passphraseInput} /> | ||
} | ||
|
||
get startOverlayContent () { | ||
return <div className='syncOverlay'> | ||
{this.deviceNameInputContent} | ||
<div> | ||
<Button l10nId='syncCreate' className='primaryButton' onClick={this.onSetup} /> | ||
</div> | ||
<SettingsList> | ||
{this.deviceNameInputContent} | ||
</SettingsList> | ||
</div> | ||
} | ||
|
||
get startOverlayFooter () { | ||
return <div className='panel'> | ||
<Button l10nId='syncCreate' className='primaryButton' onClick={this.onSetup} /> | ||
</div> | ||
} | ||
|
||
|
@@ -173,20 +193,20 @@ class SyncTab extends ImmutableComponent { | |
|
||
render () { | ||
const {SettingsList, SettingCheckbox} = require('../../../../js/about/preferences') | ||
return <div id='syncContainer'> | ||
return <div className='syncContainer'> | ||
{ | ||
this.isSetup && this.props.syncNewDeviceOverlayVisible | ||
? <ModalOverlay title={'syncNewDevice'} content={this.overlayContent} onHide={this.props.hideOverlay.bind(this, 'syncNewDevice')} /> | ||
: null | ||
} | ||
{ | ||
!this.isSetup && this.props.syncStartOverlayVisible | ||
? <ModalOverlay title={'syncStart'} content={this.startOverlayContent} onHide={this.props.hideOverlay.bind(this, 'syncStart')} /> | ||
? <ModalOverlay title={'syncStart'} content={this.startOverlayContent} footer={this.startOverlayFooter} onHide={this.props.hideOverlay.bind(this, 'syncStart')} /> | ||
: null | ||
} | ||
{ | ||
!this.isSetup && this.props.syncAddOverlayVisible | ||
? <ModalOverlay title={'syncAdd'} content={this.addOverlayContent} onHide={this.props.hideOverlay.bind(this, 'syncAdd')} /> | ||
? <ModalOverlay title={'syncAdd'} content={this.addOverlayContent} footer={this.addOverlayFooter} onHide={this.props.hideOverlay.bind(this, 'syncAdd')} /> | ||
: null | ||
} | ||
<div className='sectionTitle' data-l10n-id='syncTitle' /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -276,10 +276,6 @@ a { | |||
margin: 1.2em 2px 7px; | ||||
} | ||||
|
||||
.syncTitleMessage { | ||||
display: inline-block; | ||||
} | ||||
|
||||
.settingsList .subtext { | ||||
&.flashText { | ||||
margin-top: 0; | ||||
|
@@ -1561,56 +1557,74 @@ table.sortableTable { | |||
} | ||||
} | ||||
|
||||
.syncOverlay { | ||||
input { | ||||
margin-left: 20px; | ||||
display: inline; | ||||
.syncContainer { | ||||
.modal { | ||||
textarea { | ||||
width: 80%; | ||||
height: 100px; | ||||
font-size: 18px; | ||||
font-family: monospace; | ||||
} | ||||
li { | ||||
margin: 1em; | ||||
} | ||||
.settingsListContainer { | ||||
margin-bottom: 1.5em; | ||||
} | ||||
.dialog-body, .dialog-footer { | ||||
padding-left: 50px; | ||||
padding-right: 50px; | ||||
} | ||||
.dialog-footer { | ||||
margin-top: 1.5em; | ||||
padding-bottom: 2em; | ||||
display: flex; | ||||
flex-wrap: wrap; | ||||
justify-content: flex-start; | ||||
} | ||||
} | ||||
textarea { | ||||
width: 80%; | ||||
height: 100px; | ||||
font-size: 18px; | ||||
font-family: monospace; | ||||
.browserButton + .browserButton { | ||||
margin-left: 0.75em; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be already covered with browser-laptop/less/button.less Line 52 in 2aa39bb
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5px was insufficient :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Surely! |
||||
} | ||||
padding-left: 50px; | ||||
padding-bottom: 50px; | ||||
div, input, textarea, span { | ||||
margin-top: 20px; | ||||
.setupContent { | ||||
margin: 1em 0; | ||||
} | ||||
li { | ||||
margin: 10px; | ||||
.deviceNameInput { | ||||
width: 50%; | ||||
} | ||||
.device { | ||||
background-color: @lightGray; | ||||
border-radius: @borderRadiusUIbox; | ||||
color: @mediumGray; | ||||
display: table; | ||||
line-height: 1.8em; | ||||
margin: 1em 0; | ||||
padding: 0.5em 1em; | ||||
width: 500px; | ||||
& > div, .settingItem { | ||||
display: table-cell; | ||||
vertical-align: middle; | ||||
} | ||||
#syncEnableSwitch { | ||||
width: 40%; | ||||
} | ||||
.syncDeviceLabel { | ||||
font-size: 0.9em; | ||||
margin: 0; | ||||
} | ||||
.deviceName { | ||||
margin-bottom: 0.5em; | ||||
} | ||||
} | ||||
} | ||||
|
||||
#syncEnableSwitch { | ||||
display: inline-block; | ||||
margin-right: 20px; | ||||
margin-top: 20px; | ||||
} | ||||
|
||||
.syncNewDeviceButton { | ||||
margin-right: 20px; | ||||
} | ||||
|
||||
.syncWarning { | ||||
color: #ff0400; | ||||
margin-top: 20px; | ||||
font-weight: 500; | ||||
} | ||||
|
||||
.syncToggleButton { | ||||
margin-bottom: 10px; | ||||
} | ||||
|
||||
#syncPassphrase { | ||||
margin-top: 20px; | ||||
margin-left: 20px; | ||||
margin: 1em; | ||||
color: #ff0400; | ||||
font-size: 15px; | ||||
font-family: monospace; | ||||
} | ||||
|
||||
#syncQR { | ||||
margin-top: 20px; | ||||
margin-left: 20px; | ||||
margin: 1em; | ||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need
wideButton
for this? the min-width of the buttons has been set globally with #6387There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied this class as a hack to make the "button pressed / secret visible" state have a larger button. wideButton might be inappropriate so I can explicitly set a width for these buttons.