Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Refactor notificationBar & updateBar #7831

Merged
merged 1 commit into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ const showDisabledNotifications = () => {
message: notificationTryPaymentsMessage,
buttons: [
{text: locale.translation('noThanks')},
{text: locale.translation('notificationTryPaymentsYes'), className: 'primary'}
{text: locale.translation('notificationTryPaymentsYes'), className: 'primaryButton'}
],
options: {
style: 'greetingStyle',
Expand Down Expand Up @@ -2062,7 +2062,7 @@ const showNotificationAddFunds = () => {
buttons: [
{text: locale.translation('turnOffNotifications')},
{text: locale.translation('updateLater')},
{text: locale.translation('addFunds'), className: 'primary'}
{text: locale.translation('addFunds'), className: 'primaryButton'}
],
options: {
style: 'greetingStyle',
Expand All @@ -2086,7 +2086,7 @@ const showNotificationReviewPublishers = (nextTime) => {
buttons: [
{text: locale.translation('turnOffNotifications')},
{text: locale.translation('dismiss')},
{text: locale.translation('reviewSites'), className: 'primary'}
{text: locale.translation('reviewSites'), className: 'primaryButton'}
],
options: {
style: 'greetingStyle',
Expand All @@ -2107,7 +2107,7 @@ const showNotificationPaymentDone = (transactionContributionFiat) => {
message: notificationPaymentDoneMessage,
buttons: [
{text: locale.translation('turnOffNotifications')},
{text: locale.translation('Ok'), className: 'primary'}
{text: locale.translation('Ok'), className: 'primaryButton'}
],
options: {
style: 'greetingStyle',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class AdvancedSettingsFooter extends ImmutableComponent {
render () {
return <div className={css(paymentCommon.advanceFooter)}>
<Button l10nId='backupLedger'
className={css(commonStyles.buttonPrimary)}
className={css(commonStyles.primaryButton)}
onClick={this.props.showOverlay.bind(this, 'ledgerBackup')}
/>
<Button l10nId='recoverLedger'
className={css(commonStyles.buttonPrimary, paymentCommon.marginButtons)}
className={css(commonStyles.primaryButton, paymentCommon.marginButtons)}
onClick={this.props.showOverlay.bind(this, 'ledgerRecovery')}
/>
<Button l10nId='done'
Expand Down
14 changes: 7 additions & 7 deletions app/renderer/components/preferences/payment/bitcoinDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class BitcoinDashboard extends ImmutableComponent {

bitcoinPurchaseButton () {
if (!this.props.ledgerData.get('buyURLFrame')) {
return <Button l10nId='add' className={css(commonStyles.buttonPrimary, styles.panelButton)} onClick={this.props.showOverlay.bind(this)} />
return <Button l10nId='add' className={css(commonStyles.primaryButton, styles.panelButton)} onClick={this.props.showOverlay.bind(this)} />
}

return <a href={this.props.ledgerData.get('buyURL')} target='_blank' onClick={this.openBuyURLTab}>
<Button l10nId='add' className={css(commonStyles.buttonPrimary, styles.panelButton)} />
<Button l10nId='add' className={css(commonStyles.primaryButton, styles.panelButton)} />
</a>
}

Expand Down Expand Up @@ -137,7 +137,7 @@ class BitcoinDashboard extends ImmutableComponent {
</div>
<div className={css(styles.settingsPanelDivider, styles.settingsPanelDividerLast)}>
<a target='_blank' href={url}>
<button className={css(commonStyles.browserButton, commonStyles.buttonPrimary, styles.panelButton)}>{name}</button>
<button className={css(commonStyles.browserButton, commonStyles.primaryButton, styles.panelButton)}>{name}</button>
</a>
</div>
</div>
Expand All @@ -156,7 +156,7 @@ class BitcoinDashboard extends ImmutableComponent {
<div className={css(styles.settingsListTitle)} data-l10n-id='smartphoneTitle' />
</div>
<div className={css(styles.settingsPanelDivider, styles.settingsPanelDividerLast, styles.alignMiddle)}>
<Button className={css(commonStyles.buttonPrimary, styles.panelButton)} l10nId='displayQRCode' onClick={this.props.showQRcode.bind(this)} />
<Button className={css(commonStyles.primaryButton, styles.panelButton)} l10nId='displayQRCode' onClick={this.props.showQRcode.bind(this)} />
</div>
</div>
}
Expand Down Expand Up @@ -205,7 +205,7 @@ class BitcoinDashboard extends ImmutableComponent {
<a target='_blank' href='https://www.buybitcoinworldwide.com/'>
<button className={cx({
browserButton: true,
[css(commonStyles.buttonPrimary)]: true,
[css(commonStyles.primaryButton)]: true,
[css(styles.panelButton)]: true
})}>buybitcoinworldwide.com</button>
</a>
Expand Down Expand Up @@ -299,7 +299,7 @@ class BitcoinDashboard extends ImmutableComponent {
? <div className={css(styles.hasBitcoinHandler)}>
<a href={ledgerData.get('paymentURL')} target='_blank'>
<Button l10nId='bitcoinVisitAccount'
className={css(commonStyles.buttonPrimary, styles.bitcoinAddressButton)}
className={css(commonStyles.primaryButton, styles.bitcoinAddressButton)}
/>
</a>
<div data-l10n-id='bitcoinAddress' className={css(styles.walletLabelText)} />
Expand All @@ -309,7 +309,7 @@ class BitcoinDashboard extends ImmutableComponent {
</div>
}
<div className={css(styles.walletAddressText)}>{ledgerData.get('address')}</div>
<Button className={css(commonStyles.buttonPrimary, styles.panelButton)}
<Button className={css(commonStyles.primaryButton, styles.panelButton)}
l10nId='copyToClipboard'
onClick={this.copyToClipboard.bind(this, ledgerData.get('address'))}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EnabledContent extends ImmutableComponent {
testId={buttonText}
test2Id={'addFunds'}
l10nId={buttonText}
className={css(commonStyles.buttonPrimary, styles.addFunds)}
className={css(commonStyles.primaryButton, styles.addFunds)}
onClick={onButtonClick.bind(this)}
disabled={ledgerData.get('creating')}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/preferences/payment/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class HistoryFooter extends ImmutableComponent {
<span data-l10n-id={l10nDataId} data-l10n-args={JSON.stringify(l10nDataArgs)} />
</div>
<Button l10nId='paymentHistoryOKText'
className={css(commonStyles.buttonPrimary)}
className={css(commonStyles.primaryButton)}
onClick={this.props.hideOverlay.bind(this, 'paymentHistory')}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/components/preferences/payment/ledgerBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class LedgerBackupFooter extends ImmutableComponent {
render () {
return <div className={css(paymentCommon.advanceFooter)}>
<Button l10nId='printKeys'
className={css(commonStyles.buttonPrimary)}
className={css(commonStyles.primaryButton)}
onClick={this.printKeys}
/>
<Button l10nId='saveRecoveryFile'
className={css(commonStyles.buttonPrimary, paymentCommon.marginButtons)}
className={css(commonStyles.primaryButton, paymentCommon.marginButtons)}
onClick={this.saveKeys}
/>
<Button l10nId='done'
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/components/preferences/payment/ledgerRecovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class LedgerRecoveryFooter extends ImmutableComponent {
return <div className={css(paymentCommon.advanceFooter)}>
<div className={css(styles.recoveryFooterButtons)}>
<Button l10nId='recover'
className={css(commonStyles.buttonPrimary)}
className={css(commonStyles.primaryButton)}
onClick={this.recoverWallet}
/>
<Button l10nId='recoverFromFile'
className={css(commonStyles.buttonPrimary, paymentCommon.marginButtons)}
className={css(commonStyles.primaryButton, paymentCommon.marginButtons)}
onClick={this.recoverWalletFromFile}
/>
<Button l10nId='cancel'
Expand Down
91 changes: 71 additions & 20 deletions app/renderer/components/styles/commonStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,6 @@ const styles = StyleSheet.create({
textAlign: 'left',
top: globalStyles.spacing.dialogTopOffset
},
browserButton: {
margin: '0',
whiteSpace: 'nowrap',
outline: 'none',
cursor: 'default',
display: 'inline-block',
lineHeight: globalStyles.spacing.buttonHeight,
height: globalStyles.spacing.buttonHeight,
width: globalStyles.spacing.buttonWidth,
fontSize: globalStyles.spacing.defaultFontSize,
color: globalStyles.color.buttonColor,
borderRadius: globalStyles.radius.borderRadius,
textAlign: 'center',
transition: '.1s opacity, .1s background',
WebkitUserSelect: 'none',
backgroundSize: '16px',
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat'
},

// itemList.less
listItem: {
Expand Down Expand Up @@ -81,8 +62,28 @@ const styles = StyleSheet.create({
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
},

// Buttons
buttonPrimary: {
browserButton: {
margin: '0',
whiteSpace: 'nowrap',
outline: 'none',
cursor: 'default',
display: 'inline-block',
lineHeight: globalStyles.spacing.buttonHeight,
height: globalStyles.spacing.buttonHeight,
width: globalStyles.spacing.buttonWidth,
fontSize: globalStyles.spacing.defaultFontSize,
color: globalStyles.color.buttonColor,
borderRadius: globalStyles.radius.borderRadius,
textAlign: 'center',
transition: '.1s opacity, .1s background',
WebkitUserSelect: 'none',
backgroundSize: '16px',
backgroundPosition: 'center center',
backgroundRepeat: 'no-repeat'
},
primaryButton: {
background: 'linear-gradient(#FF7A1D, #ff5000)',
borderLeft: '2px solid transparent',
borderRight: '2px solid transparent',
Expand Down Expand Up @@ -127,6 +128,7 @@ const styles = StyleSheet.create({
inlineButton: {
display: 'inline'
},

// margin/padding
noMarginTop: {
marginTop: 0
Expand All @@ -151,6 +153,55 @@ const styles = StyleSheet.create({
},
noPaddingRight: {
paddingRight: 0
},

// notificationBar
notificationBar: {
display: 'inline-block',
boxSizing: 'border-box',
width: '100%',
cursor: 'default',
WebkitUserSelect: 'none',
marginTop: globalStyles.spacing.navbarMenubarMargin
},
notificationBar__notificationItem: {
backgroundColor: '#ffefc0',
boxSizing: 'border-box',
borderTop: `1px solid ${globalStyles.color.tabsToolbarBorderColor}`,
borderBottom: `1px solid ${globalStyles.color.tabsToolbarBorderColor}`,
lineHeight: '24px',
padding: '8px 20px'
},
notificationBar__greetingStyle: {
backgroundColor: '#fff',
padding: '8px 20px',
width: '100%'
},
notificationItem__greeting: {
color: globalStyles.color.braveOrange,
fontSize: '16px',
margin: 'auto 10px auto 0',
userSelect: 'none'
},
notificationItem__message: {
color: '#000',
fontSize: '15px',
margin: 'auto 6px auto 0',
userSelect: 'none',
cursor: 'default'
},
notificationItem__secondaryMessage: {
color: '#888',
fontSize: '14px',
padding: '0',
margin: 'auto 0 auto 10px'
},
notificationItem__button: {
fontSize: '13px',
marginRight: '10px',
padding: '2px 15px',
textTransform: 'capitalize',
width: 'auto'
}
})

Expand Down
5 changes: 4 additions & 1 deletion app/renderer/components/styles/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const globalStyles = {
chromeSecondary: '#d3d3d3',
chromeTertiary: '#c7c7c7',
chromeText: '#555555',
tabsBackground: '#dddddd',
tabsBackground: '#ddd',
tabsBackgroundInactive: '#ddd',
tabsToolbarBorderColor: '#bbb',
navigationBarBackground: 'white',
chromeControlsBackground: '#bbb',
chromeControlsBackground2: 'white',
Expand Down Expand Up @@ -102,6 +104,7 @@ const globalStyles = {
bookmarksToolbarWithFaviconsHeight: '28px',
bookmarksFileIconSize: '13px',
bookmarksFolderIconSize: '15px',
navbarMenubarMargin: '7px',
navbarButtonSpacing: '4px',
navbarButtonWidth: '20px',
navbarBraveButtonWidth: '23px',
Expand Down
Loading