-
-
+ return
+
+
+
+ {this.faSmartphone()}
+
+
+
-
+
{/* TODO: refactor button.js */}
+ onClick={this.props.showQRcode.bind(this)}
+ />
-
+
}
- panelFooter () {
- if (this.props.ledgerData.get('buyURLFrame')) {
- return
- {/* TODO: refactor button.js */}
-
-
- } else if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
- return
-
- {/* TODO: refactor button.js */}
-
-
- } else {
- return
- {/* TODO: refactor button.js */}
-
-
- }
+ qrcodeOverlayContent () {
+ return
+
+
+
}
-
- openBuyURLTab () {
- // close parent dialog
- this.props.hideParentOverlay()
+ qrcodeOverlayFooter () {
+ if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
+ return
+ }
+ return null
}
bitcoinOverlayContent () {
- return
- }
-
- worldWidePanel () {
- return
+ return
}
copyToClipboard (text) {
@@ -277,14 +372,17 @@ class BitcoinDashboard extends ImmutableComponent {
window.addEventListener('message', this.onMessage.bind(this), false)
const ledgerData = this.props.ledgerData
- // TODO remove bitcoinDashboard class
- return
+ return
{
this.props.bitcoinOverlayVisible
?
@@ -294,221 +392,289 @@ class BitcoinDashboard extends ImmutableComponent {
this.props.qrcodeOverlayVisible
?
: null
}
-
- {
- (this.userInAmerica || ledgerData.get('buyURLFrame'))
- ? this.coinbasePanel()
- : this.exchangePanel()
- }
-
-
- {
- ledgerData.get('address')
- ?
- {
- ledgerData.get('hasBitcoinHandler') && ledgerData.get('paymentURL')
- ?
- :
- }
-
{ledgerData.get('address')}
- {/* TODO: refactor button.js */}
-
-
- :
- }
-
- {this.smartphonePanel()}
- {this.panelFooter()}
-
-
+ {
+ (this.userInAmerica || ledgerData.get('buyURLFrame'))
+ ? this.coinbasePanel()
+ : this.exchangePanel()
+ }
+ {this.bitcoinPanel()}
+ {this.smartphonePanel()}
+
}
}
+class BitcoinDashboardFooter extends ImmutableComponent {
+ get coinbaseCountries () {
+ return coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1
+ }
+
+ get coinbaseMessageWrapper () {
+ return
+ }
+
+ render () {
+ return
+ {
+ this.coinbaseCountries
+ ? this.coinbaseMessageWrapper
+ : null
+ }
+
+
+ }
+}
+
+const qrcodeLogoWidth = '130.5px'
+const qrcodeLogoHeight = '42.75px'
+const panelPadding = '25px'
+const panelPaddingBody = `calc(${panelPadding} - ${globalStyles.spacing.dialogInsideMargin})`
+const iconWrapperWidth = '55px'
+
const styles = StyleSheet.create({
- panel: {
- display: 'flex',
- paddingLeft: '100px'
+ faBitcoin: {
+ color: 'white',
+ transform: 'rotate(12deg)'
},
- panelFooter: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'flex-end'
+ faCircle: {
+ color: globalStyles.color.bitcoinOrange
},
- disabledPanel: {
- padding: '15px 0'
+ faCreditCard: {
+ fontSize: '30px'
+ },
+ faMobile: {
+ fontSize: '50px'
+ },
+
+ coinbaseLogo: {
+ width: '40px',
+ height: '40px',
+ display: 'inline-block',
+ marginTop: '1px',
+ marginRight: '10px',
+ background: `url(${CoinBase}) 0 0 / contain no-repeat`
},
+
+ // TODO: Refactor button to remove !important
panelButton: {
- minWidth: '180px'
+ minWidth: '180px !important'
},
- settingsPanelDivider: {
+
+ panel: {
+ display: 'flex'
+ },
+ panel__divider: {
width: '50%',
- position: 'relative',
+ boxSizing: 'border-box',
display: 'flex',
flexFlow: 'column'
},
- settingsPanelDividerFirst: {
+ panel__divider_left: {
alignItems: 'flex-start'
},
- settingsPanelDividerLast: {
+ panel__divider_right: {
alignItems: 'flex-end'
},
- bitcoinQRTitle: {
+
+ panel__divider_right__bitcoinPanel__walletLabelText: {
+ fontSize: '1em',
color: globalStyles.color.braveOrange,
- textAlign: 'center'
+ marginBottom: '5px'
},
- qrcodeOverlayFooter: {
+ panel__divider_right__bitcoinPanel__walletAddressText: {
+ fontSize: '13px',
+ color: 'black',
+ marginBottom: globalStyles.spacing.dialogInsideMargin,
+ cursor: 'initial',
+ userSelect: 'initial'
+ },
+ panel__divider_right__bitcoinPanel__paymentURL: {
+ marginBottom: globalStyles.spacing.dialogInsideMargin
+ },
+
+ panel__divider_left__titleWrapper: {
display: 'flex',
- justifyContent: 'center',
- background: globalStyles.color.gray,
- padding: '15px 0'
+ alignItems: 'flex-start'
},
- qrcodeLogo: {
- width: '130.5px',
- height: '42.75px',
- display: 'inline-block'
+ panel__divider_left__titleWrapper_noSubTitle: {
+ alignItems: 'center'
},
- qrcodeImage: {
- clear: 'both',
- display: 'block',
- margin: '0 auto'
+ panel__divider_left__titleWrapper__iconWrapper: {
+ display: 'flex',
+ justifyContent: 'center',
+ width: iconWrapperWidth
},
- appstoreLogo: {
- background: `url(${IOS})`,
- backgroundSize: '130.5px 42.75px',
- marginRight: '5px'
+ panel__divider_left__listTitleWrapper: {
+ maxWidth: `calc(100% - ${iconWrapperWidth})`
},
- playstoreLogo: {
- background: `url(${Andorid})`,
- backgroundSize: '130.5px 42.75px'
+ panel__divider_left__listTitleWrapper__title: {
+ color: '#444',
+ fontWeight: 'bold',
+ fontSize: '15px'
},
- coinbaseLogo: {
- width: '40px',
- height: '40px',
- display: 'inlineBlock',
- marginTop: '1px',
- marginRight: '10px',
- background: `url(${CoinBase}) 0 0 / contain no-repeat`
+ panel__divider_left__listTitleWrapper__subTitle: {
+ fontWeight: 'normal',
+ fontSize: '14px',
+ fontStyle: 'italic',
+ lineHeight: '1.3em',
+ marginTop: globalStyles.spacing.dialogInsideMargin
},
- settingsListTitle: {
- color: '#444444',
+ panel__divider_right__title: {
+ color: '#444',
fontWeight: 'bold',
- fontSize: '15px',
- margin: '0'
+ fontSize: '15px'
},
- subTitle: {
- clear: 'both',
+ panel__divider_right__subTitle: {
fontWeight: 'normal',
fontSize: '14px',
fontStyle: 'italic',
lineHeight: '1.3em',
- marginTop: '20px'
+ marginTop: globalStyles.spacing.dialogInsideMargin
+ },
+
+ panel__coinbase: {
+ background: 'initial',
+ padding: `${panelPaddingBody} 0 ${panelPadding}`,
+ borderBottom: `3px solid ${globalStyles.color.modalLightGray}`
},
- coinbaseFooter: {
- justifyContent: 'space-between'
+ panel__bitcoinPanel: {
+ padding: `${panelPadding} 0`,
+ borderBottom: `3px solid ${globalStyles.color.modalLightGray}`
},
- coinbase: {
+ panel__smartphonePanel: {
+ padding: `${panelPadding} 0 ${panelPaddingBody}`
+ },
+
+ modalOverlay__qrcodeOverlay: {
display: 'flex',
- alignItems: 'center'
+ flexFlow: 'column',
+ alignItems: 'center',
+ justifyContent: 'center',
+ border: 0,
+ width: '350px',
+ height: '350px',
+ margin: '100px auto 0 auto',
+ background: '#fff'
},
- coinbaseMessage: {
- display: 'inline-block',
- maxWidth: '450px'
+ modalOverlay__qrcodeOverlay__content: {
+ textAlign: 'center'
},
- bitcoinIcon: {
- position: 'absolute',
- left: '-5px',
- top: 0
+ modalOverlay__qrcodeOverlay__content__bitcoinQR: {
+ color: globalStyles.color.braveOrange
},
- walletLabelText: {
- fontSize: '1em',
- color: globalStyles.color.braveOrange,
- marginBottom: '5px'
+ modalOverlay__qrcodeOverlay__footerWrapper: {
+ width: '100%'
},
- walletAddressText: {
- fontSize: '12px',
- color: 'black',
- marginBottom: '15px'
+ modalOverlay__qrcodeOverlay__footerWrapper__footer: {
+ display: 'flex',
+ justifyContent: 'center',
+ background: globalStyles.color.gray,
+ padding: '15px 0',
+ width: '100%'
+ },
+ modalOverlay__qrcodeOverlay__footerWrapper__footer__qrcodeLogo: {
+ width: qrcodeLogoWidth,
+ height: qrcodeLogoHeight,
+ display: 'inline-block'
+ },
+ modalOverlay__qrcodeOverlay__footerWrapper__footer__appstoreLogo: {
+ background: `url(${IOS})`,
+ backgroundSize: `${qrcodeLogoWidth} ${qrcodeLogoHeight}`,
+ marginRight: '5px'
},
- hasBitcoinHandler: {
+ modalOverlay__qrcodeOverlay__footerWrapper__footer__playstoreLogo: {
+ background: `url(${Andorid})`,
+ backgroundSize: `${qrcodeLogoWidth} ${qrcodeLogoHeight}`
+ },
+
+ modalOverlay__coinbaseOverlay: {
display: 'flex',
- flexFlow: 'column',
- alignItems: 'flex-end'
+ alignItems: 'center',
+ justifyContent: 'center',
+ height: '100%',
+ width: '100%',
+ padding: 0,
+ margin: 0,
+ border: 0,
+ borderRadius: 0,
+ background: 'transparent',
+ boxShadow: 'none'
},
- alignMiddle: {
- justifyContent: 'center'
+ modalOverlay__coinbaseOverlay__header: {
+ padding: 0
},
- faCircle: {
- color: globalStyles.color.bitcoinOrange
+ modalOverlay__coinbaseOverlay__bodyWrapper: {
+ height: '100%',
+ width: '100%'
},
- faBitcoin: {
- color: 'white',
- transform: 'rotate(12deg)'
+ modalOverlay__coinbaseOverlay__bodyWrapper__body: {
+ padding: 0,
+ height: '100%',
+ width: '100%',
+ background: 'transparent'
},
- faCreditCard: {
- fontSize: '30px'
+ modalOverlay__coinbaseOverlay__bodyWrapper__body__iframe: {
+ display: 'block',
+ width: '100%',
+ height: '100%',
+ border: 'none',
+ boxSizing: 'border-box',
+ margin: 0,
+ padding: 0,
+ overflow: 'hidden'
},
- faMobile: {
- fontSize: '50px',
- left: '-40px'
+ modalOverlay__coinbaseOverlay__footer: {
+ padding: 0
},
- fa: {
- position: 'absolute',
- left: '-45px'
+
+ dashboardFooter: {
+ fontSize: '13px',
+ fontStyle: 'italic'
},
- dialogInsideMargin__bottom: {
- marginBottom: globalStyles.spacing.dialogInsideMargin
+ dashboardFooter_coinbaseFooter: {
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ width: '100%'
+ },
+ dashboardFooter_coinbaseFooter__coinbaseMessageWrapper: {
+ display: 'flex',
+ alignItems: 'center'
+ },
+ dashboardFooter_coinbaseFooter__coinbaseMessageWrapper__message: {
+ display: 'inline-block',
+ maxWidth: '450px'
+ },
+ dashboardFooter_coinbaseFooter__doneButton: {
+ // TODO (Cezar): Remove !important once button components are refactored
+ marginRight: '30px !important' // 20px + 30px -> align the done button with other panelButtons
}
})
-module.exports = BitcoinDashboard
+module.exports = {
+ BitcoinDashboard,
+ BitcoinDashboardFooter
+}
diff --git a/app/renderer/components/preferences/payment/disabledContent.js b/app/renderer/components/preferences/payment/disabledContent.js
index 597b3b7c3f..a8044cd1f0 100644
--- a/app/renderer/components/preferences/payment/disabledContent.js
+++ b/app/renderer/components/preferences/payment/disabledContent.js
@@ -20,7 +20,7 @@ const CoinBase2 = require('../../../../extensions/brave/img/coinbase_2x.png')
class DisabledContent extends ImmutableComponent {
render () {
- return
+ return
@@ -43,7 +43,7 @@ class DisabledContent extends ImmutableComponent {
-
+
}
}
diff --git a/app/renderer/components/preferences/payment/enabledContent.js b/app/renderer/components/preferences/payment/enabledContent.js
index 0866a6661f..507e2b84f1 100644
--- a/app/renderer/components/preferences/payment/enabledContent.js
+++ b/app/renderer/components/preferences/payment/enabledContent.js
@@ -82,7 +82,7 @@ class EnabledContent extends ImmutableComponent {
value = ledgerData.get('balance')
}
- return
+
}
lastReconcileMessage () {
@@ -116,10 +116,10 @@ class EnabledContent extends ImmutableComponent {
date: prevReconcileDateValue
}
- return
+
}
lastReconcileDate (transaction) {
@@ -157,17 +157,17 @@ class EnabledContent extends ImmutableComponent {
reconcileDate: nextReconcileDateRelative
}
- return
+
}
render () {
const ledgerData = this.props.ledgerData
const walletStatusText = walletStatus(ledgerData)
- return
+ return
@@ -233,7 +233,7 @@ class EnabledContent extends ImmutableComponent {
settings={this.props.settings}
onChangeSetting={this.props.onChangeSetting}
siteSettings={this.props.siteSettings} />
-
+
}
}
diff --git a/app/renderer/components/preferences/payment/history.js b/app/renderer/components/preferences/payment/history.js
index 3fee7d0a77..05e12cc040 100644
--- a/app/renderer/components/preferences/payment/history.js
+++ b/app/renderer/components/preferences/payment/history.js
@@ -113,7 +113,7 @@ class HistoryFooter extends ImmutableComponent {
reconcileDate: formattedTimeFromNow(timestamp)
}
- return
+ return
@@ -123,7 +123,7 @@ class HistoryFooter extends ImmutableComponent {
testId='paymentHistoryOKText'
onClick={this.props.hideOverlay.bind(this, 'paymentHistory')}
/>
-
+
}
}
@@ -153,8 +153,7 @@ const styles = StyleSheet.create({
headerContainer__wrapper: {
position: 'sticky',
- top: 0,
- background: paymentStylesVariables.color.paymentHistoryTableBackgroundColor
+ top: 0
},
headerContainer: {
paddingTop: columnPadding,
diff --git a/app/renderer/components/preferences/payment/ledgerBackup.js b/app/renderer/components/preferences/payment/ledgerBackup.js
index 197a2a2786..a6c23508eb 100644
--- a/app/renderer/components/preferences/payment/ledgerBackup.js
+++ b/app/renderer/components/preferences/payment/ledgerBackup.js
@@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const React = require('react')
-const {StyleSheet, css} = require('aphrodite')
+const {StyleSheet, css} = require('aphrodite/no-important')
// components
const ImmutableComponent = require('../../immutableComponent')
@@ -11,8 +11,6 @@ const Button = require('../../../../../js/components/button')
// style
const globalStyles = require('../../styles/global')
-const commonStyles = require('../../styles/commonStyles')
-const {paymentCommon} = require('../../styles/payment')
// other
const aboutActions = require('../../../../../js/about/aboutActions')
@@ -26,31 +24,33 @@ class LedgerBackupContent extends ImmutableComponent {
const paymentId = this.props.ledgerData.get('paymentId')
const passphrase = this.props.ledgerData.get('passphrase')
- return
-
-
-
-
-
-
- {paymentId}
-
+ return
+
+
+ {/* TODO: refactor button */}
+
+
+
+ {paymentId}
-
+
+ {/* TODO: refactor button */}
+
+
+
+ {passphrase}
-
+
}
}
@@ -74,20 +74,23 @@ class LedgerBackupFooter extends ImmutableComponent {
}
render () {
- return
-
+
}
}
@@ -95,30 +98,20 @@ const styles = StyleSheet.create({
copyKeyContainer: {
display: 'flex',
alignItems: 'flex-end',
- width: '75%',
- margin: `${globalStyles.spacing.paymentsMargin} auto`
+ justifyContent: 'center',
+ margin: `${globalStyles.spacing.dialogInsideMargin} auto`
},
keyContainer: {
marginLeft: '2em'
},
-
keyContainer__h3: {
marginBottom: globalStyles.spacing.modalPanelHeaderMarginBottom
},
-
keyContainer__span: {
- whiteSpace: 'nowrap'
- },
- ledgerBackupContent: {
- paddingLeft: '50px',
- paddingRight: '50px',
- marginTop: 0,
- marginBottom: 0
- },
- copyButton: {
- fontSize: '14px',
- margin: 0
+ whiteSpace: 'nowrap',
+ userSelect: 'initial',
+ cursor: 'initial'
}
})
diff --git a/app/renderer/components/preferences/payment/ledgerRecovery.js b/app/renderer/components/preferences/payment/ledgerRecovery.js
index 37876acbf4..31e9dfe7b0 100644
--- a/app/renderer/components/preferences/payment/ledgerRecovery.js
+++ b/app/renderer/components/preferences/payment/ledgerRecovery.js
@@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const React = require('react')
-const {StyleSheet, css} = require('aphrodite')
+const {StyleSheet, css} = require('aphrodite/no-important')
// util
const {btcToCurrencyString} = require('../../../../common/lib/ledgerUtil')
@@ -17,7 +17,6 @@ const {SettingsList, SettingItem} = require('../../settings')
// style
const globalStyles = require('../../styles/global')
const commonStyles = require('../../styles/commonStyles')
-const {paymentCommon} = require('../../styles/payment')
// other
const aboutActions = require('../../../../../js/about/aboutActions')
@@ -50,63 +49,64 @@ class LedgerRecoveryContent extends ImmutableComponent {
const recoveryError = this.props.ledgerData.getIn(['error', 'error'])
const isNetworkError = typeof recoveryError === 'object'
- return
+ return
{
recoverySucceeded === true
- ?
+
: null
}
{
(recoverySucceeded === false && recoveryError && isNetworkError)
- ?
+
: null
}
{
(recoverySucceeded === false && recoveryError && !isNetworkError)
- ?
+
: null
}
-
-
+
+
+
+
+
+
+
+
+
+
+
}
}
@@ -125,43 +125,42 @@ class LedgerRecoveryFooter extends ImmutableComponent {
}
render () {
- return
-
-
-
-
-
+ return
+
+
+
}
}
const styles = StyleSheet.create({
- recoveryContent: {
- paddingLeft: '50px',
- paddingRight: '50px',
- marginTop: 0,
- marginBottom: 0
- },
recoveryContent__h4: {
- marginBottom: globalStyles.spacing.paymentsMargin
+ marginBottom: globalStyles.spacing.dialogInsideMargin
},
recoveryContent__h3: {
marginBottom: globalStyles.spacing.modalPanelHeaderMarginBottom
},
ledgerRecoveryContent: {
- marginBottom: globalStyles.spacing.paymentsMargin
+ marginBottom: globalStyles.spacing.dialogInsideMargin
},
recoveryOverlay: {
+ display: 'flex',
+ flexFlow: 'column',
+ justifyContent: 'center',
+ alignItems: 'center',
backgroundColor: globalStyles.color.black75,
border: `1px solid ${globalStyles.color.black75}`,
position: 'absolute',
@@ -169,21 +168,13 @@ const styles = StyleSheet.create({
left: '-1px',
width: '100%',
height: '100%',
- textAlign: 'center',
zIndex: 999
},
- recoveryOverlay__h1: {
- color: '#fff',
- marginTop: '120px'
- },
- recoveryOverlay__p: {
+ recoveryOverlay__textColor: {
color: '#fff'
},
- spaceAround: {
+ recoveryOverlay__spaceAround: {
margin: '50px auto'
- },
- recoveryFooterButtons: {
- float: 'right'
}
})
diff --git a/app/renderer/components/preferences/payment/ledgerTable.js b/app/renderer/components/preferences/payment/ledgerTable.js
index b85b2807d1..d64534cd66 100644
--- a/app/renderer/components/preferences/payment/ledgerTable.js
+++ b/app/renderer/components/preferences/payment/ledgerTable.js
@@ -257,7 +257,7 @@ class LedgerTable extends ImmutableComponent {
})
}
- return
+ return
@@ -310,7 +310,7 @@ class LedgerTable extends ImmutableComponent {
: null
}
-
+
}
}
diff --git a/app/renderer/components/preferences/paymentsTab.js b/app/renderer/components/preferences/paymentsTab.js
index f42380bee3..719fe16629 100644
--- a/app/renderer/components/preferences/paymentsTab.js
+++ b/app/renderer/components/preferences/paymentsTab.js
@@ -21,7 +21,7 @@ const {
const DisabledContent = require('./payment/disabledContent')
const EnabledContent = require('./payment/enabledContent')
-const BitcoinDashboard = require('./payment/bitcoinDashboard')
+const {BitcoinDashboard, BitcoinDashboardFooter} = require('./payment/bitcoinDashboard')
const {AdvancedSettingsContent, AdvancedSettingsFooter} = require('./payment/advancedSettings')
const {HistoryContent, HistoryFooter} = require('./payment/history')
const {LedgerBackupContent, LedgerBackupFooter} = require('./payment/ledgerBackup')
@@ -102,7 +102,16 @@ class PaymentsTab extends ImmutableComponent {
})} data-test-id='paymentsContainer'>
{
this.enabled && this.props.addFundsOverlayVisible
- ?
+ ?
+ }
+ onHide={this.props.hideOverlay.bind(this, 'addFunds')}
+ />
: null
}
{
@@ -110,6 +119,9 @@ class PaymentsTab extends ImmutableComponent {
?
+ return
+
}
get postSetupContent () {
@@ -151,7 +151,7 @@ class SyncTab extends ImmutableComponent {
}
get devicesContent () {
- return
+ return
+
}
get qrcodeContent () {
@@ -169,7 +169,7 @@ class SyncTab extends ImmutableComponent {
return null
}
return this.props.syncQRVisible
- ?
+
:
-
}
- get overlayContent () {
- return
-
-
-
- -
-
- {this.qrcodeContent}
-
- -
-
- {this.passphraseContent}
-
-
-
-
+
+
-
+
+ {this.qrcodeContent}
+
+
-
-
-
-
+
+ {this.passphraseContent}
+
+
+ }
+
+ get newOverlayFooter () {
+ return
}
get defaultDeviceName () {
@@ -292,43 +292,34 @@ class SyncTab extends ImmutableComponent {
get deviceNameInputContent () {
return
-
- { this.deviceNameInput = node }}
- placeholder={this.defaultDeviceName} />
-
+ { this.deviceNameInput = node }}
+ placeholder={this.defaultDeviceName} />
}
get startOverlayContent () {
- return
-
- {this.deviceNameInputContent}
-
-
+ return
+ {this.deviceNameInputContent}
+
}
get startOverlayFooter () {
- return
-
-
+ return
}
get addOverlayContent () {
- return
+
}
get addOverlayFooter () {
- return
-
-
+ return
}
get resetOverlayContent () {
- return
+ return
}
get resetOverlayFooter () {
- return
+ return
+
}
enableRestore (e) {
@@ -455,14 +436,13 @@ class SyncTab extends ImmutableComponent {
}
render () {
- return
+ return
{
this.isSetup && this.props.syncNewDeviceOverlayVisible
?
: null
}
@@ -470,8 +450,6 @@ class SyncTab extends ImmutableComponent {
!this.isSetup && this.props.syncStartOverlayVisible
?
@@ -481,8 +459,6 @@ class SyncTab extends ImmutableComponent {
!this.isSetup && this.props.syncAddOverlayVisible
?
@@ -492,8 +468,6 @@ class SyncTab extends ImmutableComponent {
this.isSetup && this.props.syncResetOverlayVisible
?
@@ -558,7 +532,7 @@ class SyncTab extends ImmutableComponent {
? this.clearDataContent
: null
}
-
+
}
}
@@ -598,7 +572,8 @@ const styles = StyleSheet.create({
color: globalStyles.color.mediumGray,
margin: `${globalStyles.spacing.panelMargin} 0`,
padding: globalStyles.spacing.panelPadding,
- width: '500px'
+ boxSizing: 'border-box',
+ width: '600px'
},
device__item: {
flex: 1
@@ -613,7 +588,8 @@ const styles = StyleSheet.create({
devices__devicesList: {
// TODO: refactor sortableTable to remove !important
marginBottom: `${globalStyles.spacing.dialogInsideMargin} !important`,
- width: '34em !important'
+ boxSizing: 'border-box',
+ width: '600px !important'
},
devices__devicesListCell: {
padding: '4px 8px'
@@ -626,13 +602,11 @@ const styles = StyleSheet.create({
listItem__passphrase: {
margin: `${globalStyles.spacing.dialogInsideMargin} 0`,
- color: globalStyles.color.braveDarkOrange
+ color: globalStyles.color.braveDarkOrange,
+ userSelect: 'initial',
+ cursor: 'initial'
},
- syncOverlayBody__wrapper: {
- padding: `${globalStyles.spacing.dialogInsideMargin} 50px`,
- background: '#fff'
- },
syncOverlayBody__listWrapper: {
listStyle: 'none'
},
diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js
index f8793b5e53..19c50c6200 100644
--- a/app/renderer/components/styles/commonStyles.js
+++ b/app/renderer/components/styles/commonStyles.js
@@ -63,29 +63,6 @@ const styles = StyleSheet.create({
maxHeight: `calc(80vh - ${globalStyles.spacing.downloadsBarHeight})`
},
- // modalOverlay
- // TODO: refactor modalOverlay
- modalOverlay__dialog: {
- // TODO: refactor preferences.less to remove !important
- background: `linear-gradient(${globalStyles.color.modalVeryLightGray}, ${globalStyles.color.modalLightGray}) !important`,
- borderRadius: `${globalStyles.radius.borderRadiusModal} !important`
- },
- modalOverlay__title: {
- marginBottom: 0,
-
- // TODO: refactor modalOverlay.less to remove !important
- padding: '25px 0 !important'
- },
-
- modalOverlay__footer: {
- padding: '20px'
- },
- modalOverlay__footerButton: {
- display: 'flex',
- flexFlow: 'nowrap',
- justifyContent: 'flex-end'
- },
-
// itemList.less
listItem: {
cursor: 'default',
diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js
index 775073f9af..8d416d3f7e 100644
--- a/app/renderer/components/styles/global.js
+++ b/app/renderer/components/styles/global.js
@@ -142,7 +142,7 @@ const globalStyles = {
dialogLargeWidth: '600px',
dialogTopOffset: '30px',
dialogInsideMargin: '18px',
- paymentsMargin: '20px',
+ modalDialogPaddingHorizontal: '50px',
privateTabPaddingHorizontal: '30px',
privateTabPadding: '40px',
settingsListContainerMargin: '2rem',
@@ -189,6 +189,7 @@ const globalStyles = {
zindexPopUp: '3000',
zindexContextMenu: '3000',
zindexDialogs: '3000',
+ zindexModal: '3000',
zindexPopupWindow: '3000',
zindexForms: '3000',
zindexSuggestionText: '3100',
diff --git a/app/renderer/components/styles/payment.js b/app/renderer/components/styles/payment.js
index 427d4744d6..e39c27e581 100644
--- a/app/renderer/components/styles/payment.js
+++ b/app/renderer/components/styles/payment.js
@@ -2,9 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
-const {StyleSheet} = require('aphrodite')
-const globalStyles = require('./global')
-
const paymentStyles = {
font: {
regular: '14.5px'
@@ -24,34 +21,7 @@ const paymentStyles = {
}
}
-const paymentCommon = StyleSheet.create({
- board: {
- overflowX: 'hidden',
- clear: 'both'
- },
- panel: {
- background: '#fff',
- position: 'relative',
- marginTop: '8px',
- marginBottom: '8px',
- padding: '25px 20px'
- },
- panelFooter: {
- color: globalStyles.color.darkGray,
- fontSize: '13px',
- fontStyle: 'italic',
- padding: '20px 20px 20px 50px'
- },
- marginButtons: {
- marginLeft: globalStyles.spacing.overlayButtonMargin
- }
-})
-
const paymentStylesVariables = {
- color: {
- // See: .paymentsContainer .modal .dialog.paymentHistory .dialog-body
- paymentHistoryTableBackgroundColor: '#fff'
- },
spacing: {
paymentHistoryTablePadding: '30px'
}
@@ -59,6 +29,5 @@ const paymentStylesVariables = {
module.exports = {
paymentStyles,
- paymentCommon,
paymentStylesVariables
}
diff --git a/js/components/modalOverlay.js b/js/components/modalOverlay.js
index 905a926527..f4619dd249 100644
--- a/js/components/modalOverlay.js
+++ b/js/components/modalOverlay.js
@@ -5,6 +5,12 @@
const React = require('react')
const ImmutableComponent = require('../../app/renderer/components/immutableComponent')
const cx = require('../lib/classSet')
+const Button = require('./button')
+
+const {StyleSheet, css} = require('aphrodite/no-important')
+const globalStyles = require('../../app/renderer/components/styles/global')
+
+const closeButton = require('../../img/toolbar/stoploading_btn.svg')
/**
* Represents a modal overlay
@@ -44,47 +50,152 @@ class ModalOverlay extends ImmutableComponent {
get dialogContent () {
var close = null
- var button = null
var title = null
- let customTitleClassesStr = (this.props.customTitleClasses ? this.props.customTitleClasses : '')
- let customDialogClassesStr = (this.props.customDialogClasses ? this.props.customDialogClasses : '')
+ const customDialogClassesStr = this.props.customDialogClasses ? this.props.customDialogClasses : ''
+ const customDialogHeaderClassesStr = this.props.customDialogHeaderClasses ? this.props.customDialogHeaderClasses : ''
+ const customDialogBodyWrapperClassesStr = this.props.customDialogBodyWrapperClasses ? this.props.customDialogBodyWrapperClasses : ''
+ const customDialogBodyClassesStr = this.props.customDialogBodyClasses ? this.props.customDialogBodyClasses : ''
+ const customDialogFooterClassesStr = this.props.customDialogFooterClasses ? this.props.customDialogFooterClasses : ''
+ const customTitleClassesStr = this.props.customTitleClasses ? this.props.customTitleClasses : ''
if (!this.props.emptyDialog) {
- close = (this.props.onHide ? : null)
- title = (this.props.title ? : null)
+ close = (this.props.onHide
+ ? : null)
+ title = (this.props.title
+ ? : null)
}
- return
-
- {close}
+
+
-
- {this.props.content}
-
-
+ {close}
+
+
+
+
+ {this.props.content}
+
+
+
+
-
+
+
}
render () {
return
{this.dialogContent}
}
}
+const buttonSize = '15px'
+
+const styles = StyleSheet.create({
+ dialog__wrapper_modal: {
+ opacity: 1,
+ overflow: 'auto',
+ position: 'fixed',
+ background: 'transparent',
+ width: '100vw',
+ height: '100vh',
+ left: 0,
+ top: 0,
+ zIndex: globalStyles.zindex.zindexModal
+ },
+ dialog__wrapper_last: {
+ background: globalStyles.color.black25
+ },
+ dialog__wrapper_transparentBackground: {
+ background: 'transparent'
+ },
+
+ dialog: {
+ boxSizing: 'border-box',
+ cursor: 'default',
+ width: '700px',
+ margin: '0 auto',
+ marginTop: '50px',
+ background: `linear-gradient(${globalStyles.color.modalVeryLightGray}, ${globalStyles.color.modalLightGray})`,
+ border: `solid 1px ${globalStyles.color.lightGray}`,
+ borderRadius: globalStyles.radius.borderRadiusModal,
+ boxShadow: globalStyles.shadow.dialogShadow,
+ position: 'relative',
+ userSelect: 'none',
+ zIndex: globalStyles.zindex.zindexDialogs
+ },
+
+ dialog__header: {
+ padding: `25px ${globalStyles.spacing.modalDialogPaddingHorizontal}`
+ },
+ dialog__header__close: {
+ display: 'inline-block',
+ position: 'absolute',
+ right: buttonSize,
+ top: buttonSize,
+ height: buttonSize,
+ width: buttonSize,
+ cursor: 'pointer',
+
+ // TODO: refactor button to remove !important
+ padding: '0 !important',
+ background: `url(${closeButton}) center no-repeat !important`,
+ backgroundSize: `${buttonSize} ${buttonSize} !important`,
+
+ ':focus': {
+ outline: 'none'
+ }
+ },
+ dialog__header__title: {
+ fontSize: '22px',
+ color: globalStyles.color.darkGray,
+ marginBottom: 0
+ },
+
+ dialog__body__wrapper: {
+ borderRadius: globalStyles.radius.borderRadiusModal
+ },
+ dialog__body: {
+ background: '#fff',
+ padding: `${globalStyles.spacing.dialogInsideMargin} ${globalStyles.spacing.modalDialogPaddingHorizontal}`
+ },
+
+ dialog__footer: {
+ padding: '20px',
+ paddingLeft: globalStyles.spacing.modalDialogPaddingHorizontal,
+ display: 'flex',
+ flexFlow: 'nowrap',
+ justifyContent: 'flex-end'
+ }
+})
+
module.exports = ModalOverlay
diff --git a/less/about/common.less b/less/about/common.less
index bfbdc78f75..389e447cc1 100644
--- a/less/about/common.less
+++ b/less/about/common.less
@@ -1,6 +1,5 @@
@import "../variables.less";
@import "../button.less";
-@import "../modalOverlay.less";
@import "../switchControls.less";
@import "../sortableTable.less";
diff --git a/less/about/preferences.less b/less/about/preferences.less
index 3ede8c061e..af0f21c367 100644
--- a/less/about/preferences.less
+++ b/less/about/preferences.less
@@ -284,173 +284,6 @@ table.sortableTable {
margin: 0 auto;
width: 80%;
}
-
- // This defines the styling of modal dialogs on "Add funds..." and "Advanced Settings..."
- // TODO: Use modalOverlay in commonStyles.js
- .modal {
- .dialog {
- background: linear-gradient(@modalVeryLightGray, @modalLightGray);
- border-radius: @borderRadiusModal;
-
- // Specific properties of the Coinbase overlay displayed by clicking "Fund with debit/credit"
- &.coinbaseOverlay {
- background: transparent;
-
- .dialog-body {
- height: 100%;
- width: 100%;
- }
- }
-
- // Specific properties of the Payment History
- &.paymentHistory {
- .dialog-footer {
- padding: 20px 30px;
- }
-
- .dialog-body {
- background: #FFF;
- height: 300px;
- overflow-y: auto;
- padding-right: 0;
- padding-left: 0;
- }
-
- .dialog-footer {
- padding-top: 10px;
- padding-bottom: 10px;
- }
- }
-
- // General properties of the header on the modal dialogs
- .dialog-header {
- .sectionTitle {
- margin-bottom: 0;
- padding: 25px 0; // text-indent / 2
- }
- }
-
- // General properties of the body on the modal dialogs
- .dialog-body {
- .bitcoinDashboard {
- .modal {
- .qrcodeOverlay {
- border: 0;
- width: 350px;
- height: auto;
- margin: 100px auto 0 auto;
- background: white;
- box-shadow: @dialogShadow;
-
- &.fade {
- transition: @transitionFast;
- }
-
- .dialog-body {
- padding: 30px;
- }
- }
- }
- }
- }
- }
- }
-}
-
-.board {
- overflow-x: hidden;
- clear: both;
-
- .panel {
- background: #FFFFFF;
- position: relative;
- margin-top: 8px;
- margin-bottom: 8px;
- padding: 25px 20px;
-
- #bitcoinPaymentURL {
- cursor: pointer;
- background-color: @lightGray;
- &:hover {
- background-color: @gray;
- }
- font-size: 0.9em;
- }
-
- .settingsListTitle {
- color: @darkGray;
- font-weight: bold;
- font-size: 15px;
- margin: 0;
-
- &.subTitle {
- clear: both;
- font-weight: normal;
- font-size: 14px;
- font-style: italic;
- line-height: 1.3em;
- margin-top: 20px;
- }
- }
-
- span {
- display: inline;
- }
- a {
- text-decoration: none;
- }
-
- button > a {
- color: #fff;
- }
-
- .labelText {
- clear: both;
- font-size: 1em;
- color: @braveOrange;
- margin-bottom: 5px;
- }
-
- .primaryButton {
- min-width: 180px;
- }
-
- &:after {
- content:" ";
- display:block;
- clear:both;
- }
-
- .ledgerBackupContent {
- width: 75%;
- margin: 0 auto;
- display: block;
- line-height: 1.3em;
- margin-bottom: 60px;
- }
- }
-
- .panelFooter {
- color: @darkGray;
- font-size: 13px;
- font-style: italic;
- padding: 20px 20px 20px 50px;
- }
-
- &.contrast {
- background: @highlightBlue;
- color: white;
-
- * {
- color: white;
- }
- }
-
- .disabledPanel {
- div:nth-of-type(2) {
- padding: 15px 0;
- }
- }
}
#searchSelectIcon {
diff --git a/less/modalOverlay.less b/less/modalOverlay.less
deleted file mode 100644
index 3a55f095c5..0000000000
--- a/less/modalOverlay.less
+++ /dev/null
@@ -1,117 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@import "variables.less";
-
-.modal.last + .modal.last {
- background: transparent;
-}
-
-.modal {
- opacity: 1;
- overflow: auto;
- position: fixed;
- background: transparent;
- width: 100vw;
- height: 100vh;
- left: 0;
- top: 0;
- z-index: 8999;
-
- +.modal {
- background: transparent;
- }
-
- &.last {
- background: @black25;
-
- &.transparentBackground {
- background: transparent;
- }
- }
-
- &.hidden {
- opacity: 0;
- z-index: -1;
- }
-
- .modal {
- .dialog {
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
- background: transparent;
- box-shadow: none;
- border: none;
-
- iframe {
- display: block;
- width: 100%;
- height: 100%;
- border: none;
- box-sizing: border-box;
- margin: 0;
- padding: 0;
- overflow: hidden;
- }
- }
- }
-
- .dialog {
- width: 700px;
- margin: 0 auto;
- margin-top: 50px;
- background: linear-gradient(#FFFFFF, #DEDEDE);
- border: solid 1px @lightGray;
- border-radius: @borderRadius;
- box-shadow: @dialogShadow;
- position: relative;
- z-index: 9000;
- box-sizing: border-box;
-
- &.fade {
- transition: @transitionFast;
- }
-
- /* Copied to siteDetails.js */
- .sectionTitle {
- font-size: 22px;
- padding: 35px 0 10px 0;
- text-indent: 50px;
- color: @darkGray;
- }
- }
-
- button {
- &.close {
- display: inline-block;
- background: url('../img/toolbar/stoploading_btn.svg') center no-repeat;
- background-size: 15px 15px;
- height: 15px;
- width: 15px;
- cursor: pointer;
- border: none;
- position: absolute;
- right: 15px;
- top: 15px;
-
- &:focus {
- outline: none;
- }
-
- span {
- font-size: 2.5em;
- color: @gray;
- }
- }
-
- &.alt {
- background: @gray;
- border: solid 1px @gray;
- }
- }
-}
diff --git a/test/unit/about/preferencesTest.js b/test/unit/about/preferencesTest.js
index 7ed957c867..213c99cce4 100644
--- a/test/unit/about/preferencesTest.js
+++ b/test/unit/about/preferencesTest.js
@@ -50,6 +50,7 @@ describe('Preferences component', function () {
mockery.registerMock('../../../../extensions/brave/img/android_download.svg')
mockery.registerMock('../../../../extensions/brave/img/ios_download.svg')
mockery.registerMock('../../img/icon_pencil.svg')
+ mockery.registerMock('../../img/toolbar/stoploading_btn.svg')
window.chrome = fakeElectron
window.CustomEvent = {}
diff --git a/test/unit/app/renderer/paymentsTabTest.js b/test/unit/app/renderer/paymentsTabTest.js
index 4830e23c5e..1d15d20ea0 100644
--- a/test/unit/app/renderer/paymentsTabTest.js
+++ b/test/unit/app/renderer/paymentsTabTest.js
@@ -22,6 +22,7 @@ describe('PaymentsTab component', function () {
warnOnUnregistered: false,
useCleanCache: true
})
+ mockery.registerMock('../../img/toolbar/stoploading_btn.svg')
mockery.registerMock('../../less/switchControls.less', {})
mockery.registerMock('../../less/about/preferences.less', {})
mockery.registerMock('../../less/forms.less', {})