diff --git a/app/renderer/components/preferences/payment/enabledContent.js b/app/renderer/components/preferences/payment/enabledContent.js index f8106077f5e..c3cfba58c9b 100644 --- a/app/renderer/components/preferences/payment/enabledContent.js +++ b/app/renderer/components/preferences/payment/enabledContent.js @@ -53,7 +53,7 @@ class EnabledContent extends ImmutableComponent { /> - - - + return } lastReconcileMessage () { @@ -254,57 +249,84 @@ class EnabledContent extends ImmutableComponent { const gridStyles = StyleSheet.create({ row1col1: { gridRow: 1, - gridColumn: 1 + gridColumn: 1, + marginTop: globalStyles.spacing.panelPadding, + marginLeft: globalStyles.spacing.panelPadding }, row1col2: { gridRow: 1, - gridColumn: 2 + gridColumn: 2, + marginTop: globalStyles.spacing.panelPadding, + marginRight: `calc(${globalStyles.spacing.panelPadding} / 2)`, + marginLeft: `calc(${globalStyles.spacing.panelPadding} / 2)` }, row1col3: { gridRow: 1, - gridColumn: 3 + gridColumn: 3, + marginRight: globalStyles.spacing.panelPadding }, row2col1: { gridRow: 2, - gridColumn: 1 + gridColumn: 1, + marginLeft: globalStyles.spacing.panelPadding }, row2col2: { gridRow: 2, - gridColumn: 2 + gridColumn: 2, + marginRight: `calc(${globalStyles.spacing.panelPadding} / 2)`, + marginLeft: `calc(${globalStyles.spacing.panelPadding} / 2)` }, row2col3: { gridRow: 2, - gridColumn: 3 + gridColumn: 3, + marginRight: globalStyles.spacing.panelPadding }, row3col1: { gridRow: 3, - gridColumn: 1 + gridColumn: 1, + marginBottom: globalStyles.spacing.panelPadding, + marginLeft: globalStyles.spacing.panelPadding }, row3col2: { gridRow: 3, - gridColumn: 2 + gridColumn: 2, + marginRight: `calc(${globalStyles.spacing.panelPadding} / 2)`, + marginBottom: globalStyles.spacing.panelPadding, + marginLeft: `calc(${globalStyles.spacing.panelPadding} / 2)` }, row3col3: { gridRow: 3, - gridColumn: 3 + gridColumn: 3, + marginRight: globalStyles.spacing.panelPadding, + marginBottom: globalStyles.spacing.panelPadding } }) const styles = StyleSheet.create({ + iconLink: { + color: globalStyles.color.mediumGray, + fontSize: globalStyles.payments.fontSize.regular, + marginLeft: '10px', + textDecoration: 'none', + + ':hover': { + textDecoration: 'none !important' + } + }, + enabledContent__walletBar: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', background: globalStyles.color.lightGray, borderRadius: globalStyles.radius.borderRadiusUIbox, - padding: globalStyles.spacing.panelPadding, margin: `${globalStyles.spacing.panelMargin} 0` }, @@ -320,22 +342,6 @@ const styles = StyleSheet.create({ marginTop: globalStyles.spacing.panelPadding }, - balance: { - display: 'flex', - alignItems: 'center' - }, - - balance__iconLink: { - color: globalStyles.color.mediumGray, - fontSize: globalStyles.payments.fontSize.regular, - marginLeft: '5px', - textDecoration: 'none', - - ':hover': { - textDecoration: 'none !important' - } - }, - enabledContent: { position: 'relative', zIndex: 2 diff --git a/app/renderer/components/preferences/payment/ledgerTable.js b/app/renderer/components/preferences/payment/ledgerTable.js index 9797655a479..d33654ca1bc 100644 --- a/app/renderer/components/preferences/payment/ledgerTable.js +++ b/app/renderer/components/preferences/payment/ledgerTable.js @@ -166,14 +166,14 @@ class LedgerTable extends ImmutableComponent { value: '' }, { - html:
- + html:
+ { faviconURL - ? {siteName} - : + ? {siteName} + : } - {siteName} + {siteName}
, value: publisherKey @@ -184,7 +184,7 @@ class LedgerTable extends ImmutableComponent { small disabled checkedOn - switchClassName={css(styles.switchControl_center)} + customWrapperClassName={css(styles.switchControl_center)} indicatorClassName={css(styles.pinnedToggle)} testId='pinnedDisabled' onClick={() => {}} @@ -276,16 +276,17 @@ class LedgerTable extends ImmutableComponent { return
-
- -
+
+ return
{ - this.enabled && this.props.addFundsOverlayVisible + this.enabled && this.props.addFundsOverlayVisible ? } - footer={} - onHide={this.props.hideOverlay.bind(this, 'paymentHistory')} - /> - : null + ? } + footer={} + onHide={this.props.hideOverlay.bind(this, 'paymentHistory')} + /> + : null } { this.enabled && this.props.advancedSettingsOverlayVisible @@ -181,7 +178,8 @@ class PaymentsTab extends ImmutableComponent { footer={} - onHide={this.props.hideOverlay.bind(this, 'ledgerBackup')} /> + onHide={this.props.hideOverlay.bind(this, 'ledgerBackup')} + /> : null } { @@ -202,36 +200,42 @@ class PaymentsTab extends ImmutableComponent { } -
+
{ /* Note: This div cannot be replaced with SectionTitleLabelWrapper */ }
- + Brave Payments beta
{ this.enabled - ?
-
-
- -
-
-
+ ?
+ + } @@ -301,7 +301,10 @@ class PaymentsTab extends ImmutableComponent { const gridStyles = StyleSheet.create({ row1col1: { gridRow: 1, - gridColumn: 1 + gridColumn: 1, + + // Ensure the spacing between switch__label on a small viewport + paddingRight: globalStyles.spacing.panelPadding }, row1col2: { @@ -316,89 +319,90 @@ const gridStyles = StyleSheet.create({ }) const styles = StyleSheet.create({ - flexAlignCenter: { - display: 'flex', - alignItems: 'center' + payments: { + width: '805px', + + // cf: padding of .prefTabContainer + paddingBottom: '40px' }, - paymentsContainer: { - position: 'relative', - overflowX: 'hidden', - width: '805px', - paddingBottom: '40px' // cf: padding of .prefTabContainer + payments__history__header: { + paddingLeft: `${paymentStylesVariables.spacing.paymentHistoryTablePadding} !important` }, - titleWrapper: { - display: 'grid', - gridTemplateColumns: '1fr 1fr 1fr', - alignItems: 'center', - width: '100%', - padding: `0 ${globalStyles.spacing.panelPadding}` + payments__history__body: { + height: '300px', + overflowY: 'auto', + padding: '0 !important' }, - titleWrapper__title: { - position: 'relative', - right: globalStyles.spacing.panelPadding + payments__history__footer: { + display: 'block !important', + paddingLeft: `${paymentStylesVariables.spacing.paymentHistoryTablePadding} !important`, + paddingTop: '10px !important', + paddingBottom: '10px !important' }, - titleWrapper__logo: { - width: '40px' + payments__history__title: { + // TODO: refactor preferences.less to remove !important + color: `${globalStyles.color.braveMediumOrange} !important`, + textIndent: '0 !important' }, - titleWrapper__switchWrap: { - display: 'flex', + payments__title: { + display: 'grid', + gridTemplateColumns: '1fr 1fr 1fr', alignItems: 'center', width: '100%' }, - switchWrap__label: { - color: '#999', - fontWeight: 'bold' + payments__title__icon_bat: { + width: globalStyles.spacing.batIconWidth }, - switchWrap__label_left: { - paddingRight: '.75ch !important' + payments__title__switch: { + display: 'flex', + alignItems: 'center' }, - switchWrap__label_right: { - // TODO: Add 'position: relative' and 'bottom: 1px' for macOS (en_US) only. - paddingLeft: '.75ch !important', - color: globalStyles.color.braveOrange + payments__title__switch__moreInfo: { + color: globalStyles.color.commonTextColor, + position: 'relative', + left: '3px', + cursor: 'pointer', + fontSize: globalStyles.payments.fontSize.regular, + + // TODO: refactor preferences.less to remove !important + ':hover': { + textDecoration: 'none !important' + } }, - switchWrap__right: { + payments__title__actions: { display: 'flex', alignItems: 'center', - justifyContent: 'space-between', - width: `calc(100% + ${globalStyles.spacing.panelPadding})` + justifyContent: 'space-between' }, - // Auto suggest switch - switchWrap__autoSuggestSwitch: { + payments__title__actions__autoSuggest: { + fontSize: globalStyles.fontSize.settingItemSubtext, + display: 'flex', + alignItems: 'center', + // TODO: Refactor switchControls.less position: 'relative', - right: '5px', top: '1px' }, - autoSuggestSwitch__subtext: { - fontSize: globalStyles.fontSize.settingItemSubtext - }, - autoSuggestSwitch__moreInfo: { - color: globalStyles.color.commonTextColor - }, - autoSuggestSwitch__moreInfoBtnSuggest: { - // TODO: refactor preferences.less to remove !important - ':hover': { - textDecoration: 'none !important' - } - }, - // History and settings icons - switchWrap__mainIconsRight: { + payments__title__actions__icons: { position: 'relative', - top: '3.5px' + top: '3.5px', + + // See: #11580 + whiteSpace: 'nowrap' }, - switchWrap__mainIcons: { + + payments__title__actions__icons__icon: { backgroundColor: globalStyles.color.braveOrange, width: '25px', height: '26px', @@ -409,15 +413,17 @@ const styles = StyleSheet.create({ backgroundColor: globalStyles.color.braveDarkOrange } }, - mainIcons__historyIcon: { + + payments__title__actions__icons__icon_history: { right: '5px', - WebkitMaskImage: `url(${historyIcon})`, + WebkitMaskImage: `url(${historyIcon})` + }, - ':hover': { - backgroundColor: globalStyles.color.braveDarkOrange - } + payments__title__actions__icons__icon_settings: { + WebkitMaskImage: `url(${settingsIcon})` }, - mainIcons__historyDisabled: { + + payments__title__actions__icons__icon_disabled: { backgroundColor: globalStyles.color.chromeTertiary, cursor: 'default', @@ -425,42 +431,29 @@ const styles = StyleSheet.create({ backgroundColor: globalStyles.color.chromeTertiary } }, - mainIcons__settingsIcon: { - WebkitMaskImage: `url(${settingsIcon})`, - ':hover': { - backgroundColor: globalStyles.color.braveDarkOrange - } + switch__switchControl: { + // TODO: Refactor switchControls.less + padding: '0 !important' }, - mainIcons__settingsIconDisabled: { - backgroundColor: globalStyles.color.chromeTertiary, - cursor: 'default', - ':hover': { - backgroundColor: globalStyles.color.chromeTertiary - } + switch__label: { + fontWeight: 'bold', + color: globalStyles.color.braveOrange }, - paymentHistoryOverlay__header: { - paddingLeft: `${paymentStylesVariables.spacing.paymentHistoryTablePadding} !important` - }, - paymentHistoryOverlay__body: { - background: '#fff', - height: '300px', - overflowY: 'auto', - padding: '0 !important' + switch__label_left: { + paddingRight: '.75ch !important' }, - paymentHistoryOverlay__footer: { - display: 'block !important', - paddingLeft: `${paymentStylesVariables.spacing.paymentHistoryTablePadding} !important`, - paddingTop: '10px !important', - paddingBottom: '10px !important' + + switch__label_left_off: { + color: '#999' }, - paymentHistoryOverlay__title: { - // TODO: refactor preferences.less to remove !important - color: `${globalStyles.color.braveMediumOrange} !important`, - textIndent: '0 !important' + switch__label_right: { + // TODO: Add 'position: relative' and 'bottom: 1px' for macOS (en_US) only. + paddingLeft: '.75ch !important', + color: globalStyles.color.braveOrange } }) diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js index fc95d8c63ba..68ea04f0dfc 100644 --- a/app/renderer/components/styles/global.js +++ b/app/renderer/components/styles/global.js @@ -176,7 +176,8 @@ const globalStyles = { panelMargin: '15px', panelItemMargin: '12px', panelPadding: '18px', - addFundsDialogMinHeight: '250px' + addFundsDialogMinHeight: '250px', + batIconWidth: '40px' }, shadow: { switchShadow: 'inset 0 1px 4px rgba(0, 0, 0, 0.35)',