-
-
{passphrase}
+
@@ -93,23 +85,36 @@ class LedgerBackupFooter extends ImmutableComponent {
}
const styles = StyleSheet.create({
- copyKeyContainer: {
+ ledgerBackupContent: {
+ // Align the buttons and keys even when the width of the strings is not equal
+ width: 'max-content',
+ margin: 'auto',
+ maxWidth: '100%'
+ },
+
+ ledgerBackupContent__copyKey: {
display: 'flex',
- alignItems: 'flex-end',
- justifyContent: 'center',
+ alignItems: 'center',
margin: `${globalStyles.spacing.dialogInsideMargin} auto`
},
- keyContainer: {
- marginLeft: '2em'
+ ledgerBackupContent__copyKey_second: {
+ marginBottom: 0
},
- keyContainer__h3: {
+
+ ledgerBackupContent__copyKey__key: {
+ marginLeft: `calc(${globalStyles.spacing.dialogInsideMargin} * 2)`
+ },
+
+ ledgerBackupContent__copyKey__key__header: {
marginBottom: globalStyles.spacing.modalPanelHeaderMarginBottom
},
- keyContainer__span: {
- whiteSpace: 'nowrap',
+
+ ledgerBackupContent__copyKey__key__phrase: {
userSelect: 'initial',
- cursor: 'initial'
+ cursor: 'initial',
+ color: '#D44600',
+ font: '18px monospace'
}
})
diff --git a/app/renderer/components/preferences/payment/ledgerRecovery.js b/app/renderer/components/preferences/payment/ledgerRecovery.js
index 78679519188..8962bc5701b 100644
--- a/app/renderer/components/preferences/payment/ledgerRecovery.js
+++ b/app/renderer/components/preferences/payment/ledgerRecovery.js
@@ -6,12 +6,11 @@ const React = require('react')
const {StyleSheet, css} = require('aphrodite/no-important')
// util
-const {btcToCurrencyString} = require('../../../../common/lib/ledgerUtil')
+const {batToCurrencyString} = require('../../../../common/lib/ledgerUtil')
// components
const ImmutableComponent = require('../../immutableComponent')
const BrowserButton = require('../../common/browserButton')
-const {RecoveryKeyTextbox} = require('../../common/textbox')
const {SettingsList, SettingItem} = require('../../common/settings')
// style
@@ -25,16 +24,11 @@ const appActions = require('../../../../../js/actions/appActions')
class LedgerRecoveryContent extends ImmutableComponent {
constructor () {
super()
- this.handleFirstRecoveryKeyChange = this.handleFirstRecoveryKeyChange.bind(this)
- this.handleSecondRecoveryKeyChange = this.handleSecondRecoveryKeyChange.bind(this)
+ this.handleRecoveryKeyChange = this.handleRecoveryKeyChange.bind(this)
}
- handleFirstRecoveryKeyChange (e) {
- this.props.handleFirstRecoveryKeyChange(e.target.value)
- }
-
- handleSecondRecoveryKeyChange (e) {
- this.props.handleSecondRecoveryKeyChange(e.target.value)
+ handleRecoveryKeyChange (e) {
+ this.props.handleRecoveryKeyChange(e.target.value)
}
clearRecoveryStatus () {
@@ -44,7 +38,7 @@ class LedgerRecoveryContent extends ImmutableComponent {
render () {
const l10nDataArgs = {
- balance: btcToCurrencyString(this.props.ledgerData.get('balance'), this.props.ledgerData)
+ balance: batToCurrencyString(this.props.ledgerData.get('balance'), this.props.ledgerData)
}
const recoverySucceeded = this.props.ledgerData.get('recoverySucceeded')
const recoveryError = this.props.ledgerData.getIn(['error', 'error'])
@@ -101,10 +95,16 @@ class LedgerRecoveryContent extends ImmutableComponent {
-
-
-
-
+
+
@@ -118,7 +118,7 @@ class LedgerRecoveryFooter extends ImmutableComponent {
}
recoverWallet () {
- aboutActions.ledgerRecoverWallet(this.props.state.FirstRecoveryKey, this.props.state.SecondRecoveryKey)
+ aboutActions.ledgerRecoverWallet(this.props.state.recoveryKey)
}
recoverWalletFromFile () {
@@ -153,6 +153,9 @@ const styles = StyleSheet.create({
recoveryContent__h3: {
marginBottom: globalStyles.spacing.modalPanelHeaderMarginBottom
},
+ recoveryContent__recoveryKey: {
+ height: '65px'
+ },
ledgerRecoveryContent: {
marginBottom: globalStyles.spacing.dialogInsideMargin
},
diff --git a/app/renderer/components/preferences/paymentsTab.js b/app/renderer/components/preferences/paymentsTab.js
index a025ed45f12..c3ef67cd11a 100644
--- a/app/renderer/components/preferences/paymentsTab.js
+++ b/app/renderer/components/preferences/paymentsTab.js
@@ -4,6 +4,7 @@
// Note that these are webpack requires, not CommonJS node requiring requires
const React = require('react')
+const Immutable = require('immutable')
const {StyleSheet, css} = require('aphrodite/no-important')
// Components
@@ -21,7 +22,8 @@ const {
const DisabledContent = require('./payment/disabledContent')
const EnabledContent = require('./payment/enabledContent')
-const {BitcoinDashboard, BitcoinDashboardFooter} = require('./payment/bitcoinDashboard')
+const AddFundsDialog = require('./payment/addFundsDialog/addFundsDialog')
+const AddFundsDialogFooter = require('./payment/addFundsDialog/addFundsDialogFooter')
const {AdvancedSettingsContent, AdvancedSettingsFooter} = require('./payment/advancedSettings')
const {HistoryContent, HistoryFooter} = require('./payment/history')
const {LedgerBackupContent, LedgerBackupFooter} = require('./payment/ledgerBackup')
@@ -32,31 +34,25 @@ const globalStyles = require('../styles/global')
const {paymentStyles, paymentStylesVariables} = require('../styles/payment')
const settingsIcon = require('../../../extensions/brave/img/ledger/icon_settings.svg')
const historyIcon = require('../../../extensions/brave/img/ledger/icon_history.svg')
+const batIcon = require('../../../extensions/brave/img/ledger/cryptoIcons/BAT_icon.svg')
// other
const getSetting = require('../../../../js/settings').getSetting
const settings = require('../../../../js/constants/settings')
-const coinbaseCountries = require('../../../../js/constants/coinbaseCountries')
+const {formatCurrentBalance, batToCurrencyString} = require('../../../common/lib/ledgerUtil')
class PaymentsTab extends ImmutableComponent {
constructor () {
super()
this.state = {
- FirstRecoveryKey: '',
- SecondRecoveryKey: ''
+ recoveryKey: ''
}
- this.handleFirstRecoveryKeyChange = this.handleFirstRecoveryKeyChange.bind(this)
- this.handleSecondRecoveryKeyChange = this.handleSecondRecoveryKeyChange.bind(this)
+ this.handleRecoveryKeyChange = this.handleRecoveryKeyChange.bind(this)
}
- handleFirstRecoveryKeyChange (key) {
- this.setState({FirstRecoveryKey: key})
- this.forceUpdate()
- }
-
- handleSecondRecoveryKeyChange (key) {
- this.setState({SecondRecoveryKey: key})
+ handleRecoveryKeyChange (key) {
+ this.setState({recoveryKey: key})
this.forceUpdate()
}
@@ -74,24 +70,39 @@ class PaymentsTab extends ImmutableComponent {
return getSetting(settings.PAYMENTS_ENABLED, this.props.settings)
}
- get overlayTitle () {
- if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
- return 'addFunds'
- } else {
- return 'addFundsAlternate'
- }
+ get overlayContent () {
+ const ledgerData = this.props.ledgerData || Immutable.Map()
+ const addresses = ledgerData.get('addresses') || Immutable.List()
+ const walletQR = ledgerData.get('walletQR') || Immutable.List()
+ const wizardData = ledgerData.get('wizardData') || Immutable.Map()
+ const funds = formatCurrentBalance(ledgerData)
+ const budget = getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT, this.props.settings)
+ const minAmount = batToCurrencyString(budget, ledgerData)
+
+ return
}
- get overlayContent () {
- return
+ get overlayFooter () {
+ const ledgerData = this.props.ledgerData || Immutable.Map()
+ const wizardData = ledgerData.get('wizardData') || Immutable.Map()
+
+ return (
+
+ )
+ }
+
+ get getOverlayFounds () {
+ const ledgerData = this.props.ledgerData || Immutable.Map()
+ return formatCurrentBalance(ledgerData)
}
render () {
@@ -103,13 +114,11 @@ class PaymentsTab extends ImmutableComponent {
{
this.enabled && this.props.addFundsOverlayVisible
?
- }
+ footer={this.overlayFooter}
onHide={this.props.hideOverlay.bind(this, 'addFunds')}
/>
: null
@@ -170,8 +179,7 @@ class PaymentsTab extends ImmutableComponent {
content={
}
footer={
+
Brave Payments
beta
@@ -304,6 +313,10 @@ const styles = StyleSheet.create({
minWidth: '240px'
},
+ batLogo: {
+ width: '40px'
+ },
+
switchWrap: {
width: paymentStyles.width.tableCell
},
diff --git a/app/renderer/components/preferences/preferenceNavigation.js b/app/renderer/components/preferences/preferenceNavigation.js
index 9d01b1608f5..cd4e1f20897 100644
--- a/app/renderer/components/preferences/preferenceNavigation.js
+++ b/app/renderer/components/preferences/preferenceNavigation.js
@@ -14,7 +14,8 @@ const iconExtensions = require('../../../extensions/brave/img/preferences/browse
const iconPlugins = require('../../../extensions/brave/img/preferences/browser_prefs_plugins.svg')
const iconSecurity = require('../../../extensions/brave/img/preferences/browser_prefs_security.svg')
const iconShields = require('../../../extensions/brave/img/preferences/browser_prefs_shields.svg')
-const iconPayments = require('../../../extensions/brave/img/preferences/browser_prefs_payments.svg')
+const iconPaymentsOn = require('../../../extensions/brave/img/preferences/browser_prefs_payments_on.svg')
+const iconPaymentsOff = require('../../../extensions/brave/img/preferences/browser_prefs_payments_off.svg')
// sync TBD
const iconSync = require('../../../extensions/brave/img/preferences/browser_prefs_sync.svg')
const iconAdvanced = require('../../../extensions/brave/img/preferences/browser_prefs_advanced.svg')
@@ -48,7 +49,9 @@ class PreferenceNavigation extends ImmutableComponent {
onClick={this.props.changeTab.bind(null, preferenceTabs.SYNC)}
selected={this.props.preferenceTab === preferenceTabs.SYNC}
/>
-