@@ -54,18 +67,34 @@ class SettingCheckbox extends ImmutableComponent {
render () {
const props = {
style: this.props.style,
- className: 'settingItem'
+ className: cx({
+ settingItem: true,
+ [this.props.className]: !!this.props.className
+ })
}
+
if (this.props.id) {
props.id = this.props.id
}
+
+ const labelClass = cx({
+ [css(settingCheckboxStyles.label)]: this.props.small,
+ [this.props.labelClassName]: !!this.props.labelClassName
+
+ })
+
return
}
@@ -97,12 +126,18 @@ class SiteSettingCheckbox extends ImmutableComponent {
}
render () {
- return
+ return
+ checkedOn={this.props.checked}
+ className={this.props.switchClassName}
+ />
}
}
diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js
index 7df6af3a60a..e95ab2d217c 100644
--- a/app/renderer/components/styles/commonStyles.js
+++ b/app/renderer/components/styles/commonStyles.js
@@ -32,7 +32,6 @@ const styles = StyleSheet.create({
top: globalStyles.spacing.dialogTopOffset
},
browserButton: {
- border: 'none',
margin: '0',
whiteSpace: 'nowrap',
outline: 'none',
@@ -81,6 +80,77 @@ const styles = StyleSheet.create({
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
+ },
+ // Buttons
+ buttonPrimary: {
+ background: 'linear-gradient(#FF7A1D, #ff5000)',
+ borderLeft: '2px solid transparent',
+ borderRight: '2px solid transparent',
+ borderTop: '2px solid #FF7A1D',
+ borderBottom: '2px solid #ff5000',
+ boxShadow: '0px 1px 5px -1px rgba(0, 0, 0, 0.5)',
+ fontWeight: '500',
+ fontSize: '0.9rem',
+ padding: '8px 20px',
+ margin: 0,
+ color: '#fff',
+ lineHeight: '1.25',
+ width: 'auto',
+ height: 'auto',
+ minWidth: '78px',
+
+ ':hover': {
+ border: '2px solid white',
+ color: 'white',
+ cursor: 'pointer'
+ }
+ },
+ whiteButton: {
+ background: 'linear-gradient(white, #ececec)',
+ border: '1px solid white',
+ boxShadow: '0px 1px 5px -1px rgba(0, 0, 0, 0.5)',
+ cursor: 'pointer',
+ color: '#444444',
+ lineHeight: 1.25,
+ width: 'auto',
+ height: 'auto',
+ minWidth: '78px',
+ fontSize: '0.9rem',
+ padding: '8px 20px',
+ margin: 0,
+
+ ':hover': {
+ border: `1px solid ${globalStyles.color.gray}`,
+ color: '#000'
+ }
+ },
+ inlineButton: {
+ display: 'inline'
+ },
+ // margin/padding
+ noMarginTop: {
+ marginTop: 0
+ },
+ noMarginBottom: {
+ marginBottom: 0
+ },
+ noMarginLeft: {
+ marginLeft: 0
+ },
+ noMarginRight: {
+ marginRight: 0
+ },
+ noPaddingTop: {
+ paddingTop: 0
+ },
+ noPaddingBottom: {
+ paddingBottom: 0
+ },
+ noPaddingLeft: {
+ paddingLeft: 0
+ },
+ noPaddingRight: {
+ paddingRight: 0
}
})
diff --git a/app/renderer/components/styles/payment.js b/app/renderer/components/styles/payment.js
new file mode 100644
index 00000000000..33f6eaf1718
--- /dev/null
+++ b/app/renderer/components/styles/payment.js
@@ -0,0 +1,57 @@
+/* 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 {StyleSheet} = require('aphrodite')
+const globalStyles = require('./global')
+
+const paymentStyles = {
+ font: {
+ regular: '14.5px'
+ },
+ margin: {
+ bar: '15px',
+ barItem: '12px'
+ },
+ padding: {
+ bar: '18px' // margin.barItem * 1.5
+ },
+ width: {
+ tableRow: '235px',
+ tableCell: '265px' // width.tableRow + 30px
+ }
+}
+
+const paymentCommon = StyleSheet.create({
+ board: {
+ overflowX: 'hidden',
+ clear: 'both'
+ },
+ panel: {
+ background: '#FFFFFF',
+ 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: '8px'
+ },
+ advanceFooter: {
+ padding: '20px',
+ display: 'flex',
+ flexWrap: 'wrap',
+ justifyContent: 'flex-end'
+ }
+})
+
+module.exports = {
+ paymentStyles,
+ paymentCommon
+}
diff --git a/js/about/preferences.js b/js/about/preferences.js
index f937827bb42..63d9063566a 100644
--- a/js/about/preferences.js
+++ b/js/about/preferences.js
@@ -10,7 +10,6 @@ const UrlUtil = require('../lib/urlutil')
// Components
const PreferenceNavigation = require('../../app/renderer/components/preferences/preferenceNavigation')
-const ModalOverlay = require('../components/modalOverlay')
const {SettingsList, SettingItem, SettingCheckbox} = require('../../app/renderer/components/settings')
const {SettingTextbox} = require('../../app/renderer/components/textbox')
const {SettingDropdown} = require('../../app/renderer/components/dropdown')
@@ -29,7 +28,6 @@ const preferenceTabs = require('../constants/preferenceTabs')
const messages = require('../constants/messages')
const settings = require('../constants/settings')
const {changeSetting} = require('../../app/renderer/lib/settingsUtil')
-const coinbaseCountries = require('../constants/coinbaseCountries')
const {passwordManagers, extensionIds} = require('../constants/passwordManagers')
const {startsWithOption, newTabMode, bookmarksToolbarMode, tabCloseAction, fullscreenOption} = require('../../app/common/constants/settingsEnums')
@@ -85,224 +83,6 @@ const braveryPermissionNames = {
'noScript': ['boolean', 'number']
}
-class BitcoinDashboard extends ImmutableComponent {
- constructor () {
- super()
- this.buyCompleted = false
- this.openBuyURLTab = this.openBuyURLTab.bind(this)
- }
- openBuyURLTab () {
- // close parent dialog
- this.props.hideParentOverlay()
- }
- get ledgerData () {
- return this.props.ledgerData
- }
- get bitcoinOverlayContent () {
- return
- }
- get bitcoinPurchaseButton () {
- if (!this.ledgerData.get('buyURLFrame')) return
- return
- }
- get qrcodeOverlayContent () {
- return
-
-
-
- }
- get qrcodeOverlayFooter () {
- if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
- return
- } else {
- return null
- }
- }
- get currency () {
- return this.props.ledgerData.get('currency') || 'USD'
- }
- get amount () {
- return getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT, this.props.settings) || 0
- }
- get canUseCoinbase () {
- if (!this.props.ledgerData.get('buyMaximumUSD')) return true
-
- return this.currency === 'USD' && this.amount < this.props.ledgerData.get('buyMaximumUSD')
- }
- get userInAmerica () {
- const countryCode = this.props.ledgerData.get('countryCode')
- return !(countryCode && countryCode !== 'US')
- }
- get worldWidePanel () {
- return
- }
- get coinbasePanel () {
- if (this.canUseCoinbase) {
- return
-
-
- {this.bitcoinPurchaseButton}
-
-
-
- } else {
- return
- }
- }
- get exchangePanel () {
- const url = this.props.ledgerData.getIn(['exchangeInfo', 'exchangeURL'])
- const name = this.props.ledgerData.getIn(['exchangeInfo', 'exchangeName'])
- // Call worldWidePanel if we don't have the URL or Name
- if (!url || !name) {
- return this.worldWidePanel
- } else {
- return
- }
- }
- get smartphonePanel () {
- return
- }
- get panelFooter () {
- if (this.ledgerData.get('buyURLFrame')) {
- return
-
-
- } else if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
- return
- } else {
- return
-
-
- }
- }
- copyToClipboard (text) {
- aboutActions.setClipboard(text)
- }
- onMessage (e) {
- if (!e.data || e.origin !== config.coinbaseOrigin) {
- return
- }
- if (e.data.event === 'modal_closed') {
- if (this.buyCompleted) {
- this.props.hideParentOverlay()
- this.buyCompleted = false
- } else {
- this.props.hideOverlay()
- }
- } else if (e.data.event === 'buy_completed') {
- this.buyCompleted = true
- }
- }
- render () {
- window.addEventListener('message', this.onMessage.bind(this), false)
- var emptyDialog = true
- return
- {
- this.props.bitcoinOverlayVisible
- ?
- : null
- }
- {
- this.props.qrcodeOverlayVisible
- ?
- : null
- }
-
- {
- (this.userInAmerica || this.ledgerData.get('buyURLFrame'))
- ? this.coinbasePanel
- : this.exchangePanel
- }
-
-
- {
- this.ledgerData.get('address')
- ?
- {
- this.ledgerData.get('hasBitcoinHandler') && this.ledgerData.get('paymentURL')
- ?
- :
- }
-
{this.ledgerData.get('address')}
-
-
- :
- }
-
- {this.smartphonePanel}
- {this.panelFooter}
-
-
- }
-}
-
class GeneralTab extends ImmutableComponent {
constructor (e) {
super()
@@ -1138,6 +918,5 @@ class AboutPreferences extends React.Component {
}
module.exports = {
- AboutPreferences:
,
- BitcoinDashboard
+ AboutPreferences:
}
diff --git a/js/components/button.js b/js/components/button.js
index cb8bf46f114..a2083b40e81 100644
--- a/js/components/button.js
+++ b/js/components/button.js
@@ -11,6 +11,8 @@ class Button extends ImmutableComponent {
if (this.props.iconClass) {
return