diff --git a/app/browser/reducers/ledgerReducer.js b/app/browser/reducers/ledgerReducer.js
index 63dc63c6f15..b871c668df8 100644
--- a/app/browser/reducers/ledgerReducer.js
+++ b/app/browser/reducers/ledgerReducer.js
@@ -267,6 +267,15 @@ const ledgerReducer = (state, action, immutableAction) => {
ledgerApi.addFoundClosed(state)
break
}
+ case appConstants.APP_ON_CHANGE_ADD_FUNDS_DIALOG_STEP:
+ {
+ // CC Nejc move this to a helper method as needed
+ state = state.mergeIn(['addFunds'], {
+ currentPage: action.get('page'),
+ currency: action.get('currency')
+ })
+ break
+ }
case appConstants.APP_ON_WALLET_RECOVERY:
{
state = ledgerApi.onWalletRecovery(state, action.get('error'), action.get('result'))
diff --git a/app/browser/tabs.js b/app/browser/tabs.js
index 289fe974b70..1c7476f45c0 100644
--- a/app/browser/tabs.js
+++ b/app/browser/tabs.js
@@ -164,6 +164,7 @@ const updateAboutDetails = (tab, tabValue) => {
allSiteSettings = allSiteSettings.mergeDeep(appState.get('temporarySiteSettings'))
}
const extensionsValue = appState.get('extensions')
+ const addFundsDialogState = appState.get('addFunds')
const sync = appState.get('sync')
const braveryDefaults = siteSettings.braveryDefaults(appState, appConfig)
const history = aboutHistoryState.getHistory(appState)
@@ -200,6 +201,7 @@ const updateAboutDetails = (tab, tabValue) => {
tab.send(messages.SYNC_UPDATED, sync.toJS())
tab.send(messages.BRAVERY_DEFAULTS_UPDATED, braveryDefaults)
tab.send(messages.EXTENSIONS_UPDATED, extensionsValue.toJS())
+ tab.send(messages.ADD_FUNDS_DIALOG_UPDATED, addFundsDialogState.toJS())
} else if (location === 'about:bookmarks') {
const bookmarksData = getBookmarksData(appState)
if (bookmarksData.bookmarks) {
diff --git a/app/extensions/brave/img/ledger/cryptoIcons/BAT_icon.svg b/app/extensions/brave/img/ledger/cryptoIcons/BAT_icon.svg
new file mode 100644
index 00000000000..2154658f32b
--- /dev/null
+++ b/app/extensions/brave/img/ledger/cryptoIcons/BAT_icon.svg
@@ -0,0 +1,22 @@
+
+
+
diff --git a/app/extensions/brave/img/ledger/cryptoIcons/BTC_icon.svg b/app/extensions/brave/img/ledger/cryptoIcons/BTC_icon.svg
new file mode 100644
index 00000000000..04079be30bc
--- /dev/null
+++ b/app/extensions/brave/img/ledger/cryptoIcons/BTC_icon.svg
@@ -0,0 +1,7 @@
+
+
diff --git a/app/extensions/brave/img/ledger/cryptoIcons/ETH_icon.svg b/app/extensions/brave/img/ledger/cryptoIcons/ETH_icon.svg
new file mode 100644
index 00000000000..f02465a5f7c
--- /dev/null
+++ b/app/extensions/brave/img/ledger/cryptoIcons/ETH_icon.svg
@@ -0,0 +1,35 @@
+
+
+
+
+
diff --git a/app/extensions/brave/img/ledger/cryptoIcons/LTC_icon.svg b/app/extensions/brave/img/ledger/cryptoIcons/LTC_icon.svg
new file mode 100644
index 00000000000..3150b4e0d94
--- /dev/null
+++ b/app/extensions/brave/img/ledger/cryptoIcons/LTC_icon.svg
@@ -0,0 +1,16 @@
+
+
+
diff --git a/app/extensions/brave/img/ledger/fakeQRcode.png b/app/extensions/brave/img/ledger/fakeQRcode.png
new file mode 100644
index 00000000000..6b2ebdd0acc
Binary files /dev/null and b/app/extensions/brave/img/ledger/fakeQRcode.png differ
diff --git a/app/extensions/brave/img/ledger/uphold-logo.png b/app/extensions/brave/img/ledger/uphold-logo.png
new file mode 100644
index 00000000000..c4f4bef4392
Binary files /dev/null and b/app/extensions/brave/img/ledger/uphold-logo.png differ
diff --git a/app/extensions/brave/img/ledger/wallet_icon.svg b/app/extensions/brave/img/ledger/wallet_icon.svg
new file mode 100644
index 00000000000..c73d949cd29
--- /dev/null
+++ b/app/extensions/brave/img/ledger/wallet_icon.svg
@@ -0,0 +1,12 @@
+
+
+
diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties
index 7e37bebc25f..602c41a0932 100644
--- a/app/extensions/brave/locales/en-US/preferences.properties
+++ b/app/extensions/brave/locales/en-US/preferences.properties
@@ -3,7 +3,28 @@ accountBalance=account balance
accountBalanceConnectionError=Please check your Internet connection.
actions=Actions
add=Fund with debit/credit
-addFunds=Three ways to add funds to your Brave Wallet
+addFundsHeader=Add funds to your Brave Wallet
+uphold=All transactions are processed by Uphold.
+learnMore=Learn more...
+backWithArrow=‹ Back
+nextWithArrow=Next ›
+balance=Balance:
+helloBat=Hello, and thank you for using Brave Payments!
+helloBatText1=Brave Payments allows you to make anonymous, monthly
+contributions to the publishers you visit on the internet.
+helloBatText2=Please note that your Brave Payments Wallet is unidirectional, and the money you transfer from outside accounts can not be retrieved or refunded. The wallet’s primary purpose is to send your contributions to publishers each month, based on your control and advisement.
+batContributionTitle=Introducing BAT Contribution Matching!
+batContributionText1=To say thanks to our early adopters, Brave is matching the next 5.00 USD of BATs that you add to your wallet.
+batContributionText2=Just transfer any amount from your crypto-currency wallet and we’ll match the next 5.00 USD.
+batContributionText3= Note: No need to do anything to participate after transferring funds. Your Brave wallet balance just increases by up to 5.00 USD. This promotion is available for a limited time
+addFundsWizardMainHeader=Brave makes it easy to transfer funds from your existing crypto-currency wallet to your Brave BAT Wallet.
+addFundsWizardMainOptions=Select one of the currencies below to begin a new transfer.
+addFundsWizardMainReminder=Reminder: The Brave Wallet is unidirectional and BAT flows to publisher sites. For more information about Brave Payments, please visit
+theFAQ=the FAQ.
+addFundsWizardAddressHeader=Go to your external Bitcoin account and send a minimum of 5.00 USD in bitcoin to your Brave wallet address below:
+addFundsWizardAddressNote=Note: Your BTC will be converted to BAT and appear in your Brave wallet in minutes.
+or=or
+qrCodeVersion=QR Code Version
addFundsAlternate=Add funds to your Brave Wallet
addFundsTitle=Add funds…
advanced=Advanced
diff --git a/app/renderer/components/common/clipboardButton.js b/app/renderer/components/common/clipboardButton.js
index c7ddead3f4f..3ff9b219d58 100644
--- a/app/renderer/components/common/clipboardButton.js
+++ b/app/renderer/components/common/clipboardButton.js
@@ -36,6 +36,7 @@ class ClipboardButton extends React.Component {
return
: null)
+ subTitle = (this.props.subTitle
+ ? : null)
}
return
{title}
+ {subTitle}
{close}
@@ -154,7 +168,10 @@ const styles = StyleSheet.create({
},
dialog__header: {
- padding: `25px ${globalStyles.spacing.modalDialogPaddingHorizontal}`
+ padding: `25px ${globalStyles.spacing.modalDialogPaddingHorizontal}`,
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'center'
},
dialog__header__close: {
display: 'inline-block',
@@ -180,6 +197,22 @@ const styles = StyleSheet.create({
marginBottom: 0
},
+ dialog__header__subTitle: {
+ display: 'flex',
+ justifyContent: 'flex-end',
+ alignItems: 'center'
+ },
+
+ dialog__header__subTitle_text: {
+ fontSize: '14px',
+ color: globalStyles.color.darkGray
+ },
+
+ dialog__header__subTitle_args: {
+ fontSize: '14px',
+ color: globalStyles.color.braveOrange
+ },
+
dialog__body__wrapper: {
borderRadius: globalStyles.radius.borderRadiusModal
},
diff --git a/app/renderer/components/common/sectionTitle.js b/app/renderer/components/common/sectionTitle.js
index 7491df3a331..f03b9ddb009 100644
--- a/app/renderer/components/common/sectionTitle.js
+++ b/app/renderer/components/common/sectionTitle.js
@@ -43,6 +43,7 @@ class AboutPageSectionTitle extends ImmutableComponent {
styles.sectionTitle,
styles.prefSectionTitle,
styles.aboutPageSectionTitle,
+ this.props['data-canWrap'] && styles.aboutPageSectionTitle_canWrap,
this.props['data-subTitle'] && styles.aboutPageSectionSubTitle
)} {...this.props} />
}
@@ -93,6 +94,9 @@ const styles = StyleSheet.create({
display: 'block',
whiteSpace: 'nowrap'
},
+ aboutPageSectionTitle_canWrap: {
+ whiteSpace: 'normal'
+ },
aboutPageSectionSubTitle: {
fontSize: '16px',
marginBottom: '12px',
diff --git a/app/renderer/components/common/textbox.js b/app/renderer/components/common/textbox.js
index 6de92ffa90d..2251ac8e814 100644
--- a/app/renderer/components/common/textbox.js
+++ b/app/renderer/components/common/textbox.js
@@ -31,6 +31,28 @@ class FormTextbox extends ImmutableComponent {
}
}
+class GroupedFormTextbox extends ImmutableComponent {
+ render () {
+ return (
+
+
+
+ {this.props.groupedItem}
+
+
+ )
+ }
+}
+
class SettingTextbox extends ImmutableComponent {
render () {
return
@@ -93,12 +115,48 @@ const styles = StyleSheet.create({
},
isDefault: {
fontSize: globalStyles.spacing.textAreaFontSize // Issue #6851
+ },
+
+ groupedFormTextBox: {
+ display: 'flex',
+ flex: 1
+ },
+
+ groupedFormTextBox__firstGroupedItem: {
+ boxSizing: 'border-box',
+ background: '#fff',
+ borderTopLeftRadius: '4px',
+ borderBottomLeftRadius: '4px',
+ borderTopRightRadius: 0,
+ borderBottomRightRadius: 0,
+ boxShadow: 'inset 0 1px 1px rgba(0, 0, 0, 0.1)',
+ display: 'block',
+ border: 'solid 1px rgba(0, 0, 0, 0.2)',
+ fontSize: '14.5px',
+ height: '2.25em',
+ outline: 'none',
+ padding: '0.4em',
+ width: '100%',
+ color: 'rgb(68, 68, 68)'
+ },
+
+ groupedFormTextBox__lastGroupedItem: {
+ border: 'solid 1px rgba(0, 0, 0, 0.2)',
+ borderTopLeftRadius: 0,
+ borderBottomLeftRadius: 0,
+ borderTopRightRadius: '4px',
+ borderBottomRightRadius: '4px',
+ width: '30px',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center'
}
})
module.exports = {
Textbox,
FormTextbox,
+ GroupedFormTextbox,
SettingTextbox,
RecoveryKeyTextbox,
TextArea,
diff --git a/app/renderer/components/preferences/payment/addFounds.js b/app/renderer/components/preferences/payment/addFounds.js
deleted file mode 100644
index 6ed099431bd..00000000000
--- a/app/renderer/components/preferences/payment/addFounds.js
+++ /dev/null
@@ -1,18 +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/. */
-
-const React = require('react')
-
-// Components
-const ImmutableComponent = require('../../immutableComponent')
-
-class AddFounds extends ImmutableComponent {
- render () {
- return
- Add founds
-
- }
-}
-
-module.exports = AddFounds
diff --git a/app/renderer/components/preferences/payment/addFoundsFooter.js b/app/renderer/components/preferences/payment/addFoundsFooter.js
deleted file mode 100644
index 0a1ae9dd625..00000000000
--- a/app/renderer/components/preferences/payment/addFoundsFooter.js
+++ /dev/null
@@ -1,18 +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/. */
-
-const React = require('react')
-
-// Components
-const ImmutableComponent = require('../../immutableComponent')
-
-class AddFoundsFooter extends ImmutableComponent {
- render () {
- return
- Add founds footer
-
- }
-}
-
-module.exports = AddFoundsFooter
diff --git a/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialog.js b/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialog.js
new file mode 100644
index 00000000000..f9adccbb083
--- /dev/null
+++ b/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialog.js
@@ -0,0 +1,77 @@
+/* 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/. */
+
+// Components
+const React = require('react')
+const {BatWelcomeScreen, BatContribMatching} = require('./steps/addFundsBatScreen')
+const AddFundsWizardMain = require('./steps/addFundsWizardMain')
+const AddFundsWizardAddress = require('./steps/addFundsWizardAddress')
+
+// NEJC EXCLUDE ME
+const qrCode = require('../../../../../extensions/brave/img/ledger/fakeQRCode.png')
+
+class AddFundsDialog extends React.Component {
+ get currentPage () {
+ return this.props.addFundsDialog.get('currentPage')
+ }
+
+ get currency () {
+ return this.props.addFundsDialog.get('currency')
+ }
+
+ get currencyQRCode () {
+ return qrCode
+ }
+
+ get currencyAddress () {
+ const fakeETH = 'ETH FOR THE ETH GOD'
+ const fakeBTC = 'BTC FOR THE BTC GOD'
+ const fakeLTC = 'LTC FOR THE ADVENTUROUS'
+ const fakeBAT = 'BAT FOR THE BRAVE GOD'
+
+ switch (this.currency) {
+ case 'eth':
+ return fakeETH
+ case 'btc':
+ return fakeBTC
+ case 'ltc':
+ return fakeLTC
+ case 'bat':
+ return fakeBAT
+ default:
+ return 'MONEY TALKS'
+ }
+ }
+
+ get currentView () {
+ switch (this.currentPage) {
+ case 'batContribMatching':
+ return
+ case 'addFundsWizardMain':
+ return
+ case 'addFundsWizardAddress':
+ return (
+
+ )
+ default:
+ return
+ }
+ }
+
+ render () {
+ return (
+
+ {
+ this.currentView
+ }
+
+ )
+ }
+}
+
+module.exports = AddFundsDialog
diff --git a/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialogFooter.js b/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialogFooter.js
new file mode 100644
index 00000000000..e45460e7157
--- /dev/null
+++ b/app/renderer/components/preferences/payment/addFundsDialog/addFundsDialogFooter.js
@@ -0,0 +1,164 @@
+/* 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/. */
+
+// Components
+const React = require('react')
+const BrowserButton = require('../../../common/browserButton')
+
+// Actions
+const appActions = require('../../../../../../js/actions/appActions')
+
+// Styles
+const {StyleSheet, css} = require('aphrodite')
+const upholdLogo = require('../../../../../extensions/brave/img/ledger/uphold-logo.png')
+
+class AddFundsDialogFooter extends React.Component {
+ constructor (props) {
+ super(props)
+ this.onBack = this.onBack.bind(this)
+ this.onNext = this.onNext.bind(this)
+ this.onDone = this.onDone.bind(this)
+ }
+
+ get currentPage () {
+ return this.props.addFundsDialog.get('currentPage')
+ }
+
+ onBack () {
+ switch (this.currentPage) {
+ case 'batContribMatching':
+ appActions.onChangeAddFundsDialogStep('batWelcomeScreen')
+ break
+ case 'addFundsWizardMain':
+ appActions.onChangeAddFundsDialogStep('batContribMatching')
+ break
+ case 'addFundsWizardAddress':
+ appActions.onChangeAddFundsDialogStep('addFundsWizardMain')
+ break
+ default:
+ break
+ }
+ }
+
+ onNext () {
+ switch (this.currentPage) {
+ case 'batContribMatching':
+ appActions.onChangeAddFundsDialogStep('addFundsWizardMain')
+ break
+ case 'addFundsWizardMain':
+ appActions.onChangeAddFundsDialogStep('addFundsWizardAddress')
+ break
+ default:
+ appActions.onChangeAddFundsDialogStep('batContribMatching')
+ break
+ }
+ }
+
+ onDone () {
+ // close the dialog and set default page
+ // to add funds wizard to avoid
+ // user seeing welcome greetings all the time
+ this.props.onHide()
+ appActions.onChangeAddFundsDialogStep('addFundsWizardMain')
+ }
+
+ get showBackButton () {
+ return (
+ this.currentPage != null &&
+ this.currentPage !== 'batWelcomeScreen'
+ )
+ }
+
+ get showNextButton () {
+ return (
+ this.currentPage !== 'addFundsWizardMain' &&
+ this.currentPage !== 'addFundsWizardAddress'
+ )
+ }
+
+ get showDoneButton () {
+ return (
+ this.currentPage === 'addFundsWizardMain' ||
+ this.currentPage === 'addFundsWizardAddress'
+ )
+ }
+
+ render () {
+ return (
+
+