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

make button styles consistent #5916

Merged
merged 3 commits into from
Dec 2, 2016
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
13 changes: 10 additions & 3 deletions app/extensions/brave/locales/en-US/styles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ h3=This is an h3
h4=This is an h4
forms=Forms
inputs=Inputs
switches=Switches
onByDefault=On by default
offByDefault=Off by default

buttons=Buttons
browserButton=Browser Button
whiteButton=White Button
inlineButton=Inline Button
wideButton=Wide Button
smallButton=Small Button
primaryButton=Primary Button
switches=Switches
onByDefault=On by default
offByDefault=Off by default
actionButton=Action Button
subtleButton=Subtle Button
2 changes: 1 addition & 1 deletion app/renderer/components/checkDefaultBrowserDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CheckDefaultBrowserDialog extends ImmutableComponent {
<SwitchControl className='checkDefaultOnStartup' rightl10nId='checkDefaultOnStartup'
checkedOn={this.props.checkDefaultOnStartup} onClick={this.onCheckDefaultOnStartup} />
<div className='checkDefaultBrowserButtons'>
<Button l10nId='notNow' className='secondaryAltButton' onClick={this.onNotNow} />
<Button l10nId='notNow' className='whiteButton' onClick={this.onNotNow} />
<Button l10nId='useBrave' className='primaryButton' onClick={this.onUseBrave} />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/importBrowserDataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ImportBrowserDataPanel extends ImmutableComponent {
<div data-l10n-id='importDataCloseBrowserWarning' />
</div>
<div className='formSection importBrowserDataButtons'>
<Button l10nId='cancel' className='secondaryAltButton' onClick={this.props.onHide} />
<Button l10nId='cancel' className='whiteButton' onClick={this.props.onHide} />
<Button l10nId='import' className='primaryButton' onClick={this.onImport} />
</div>
<div className='formSection importBrowserDataWarning'>
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/components/widevinePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ImportBrowserDataPanel extends ImmutableComponent {
<WidevineInfo newFrameAction={windowActions.newFrame} />
</div>
<div className='formSection commonFormButtons'>
<Button l10nId='cancel' className='secondaryAltButton' onClick={this.props.onHide} />
<Button l10nId='cancel' className='whiteButton' onClick={this.props.onHide} />
<Button l10nId='installAndAllow' className='primaryButton' onClick={this.onInstallAndAllow} />
</div>
<div className='formSection commonFormBottom'>
Expand Down
38 changes: 19 additions & 19 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,11 @@ class BitcoinDashboard extends ImmutableComponent {
<div className='settingsListTitle' data-l10n-id='outsideUSAPayment' />
</div>
<div className='settingsPanelDivider'>
<a target='_blank' className='browserButton primaryButton' href='https://www.buybitcoinworldwide.com/'>
buybitcoinworldwide.com
</a>
<button className='browserButton primaryButton'>
<a target='_blank' href='https://www.buybitcoinworldwide.com/'>
buybitcoinworldwide.com
</a>
</button>
</div>
</div>
}
Expand Down Expand Up @@ -415,9 +417,11 @@ class BitcoinDashboard extends ImmutableComponent {
<div className='settingsListTitle' data-l10n-id='outsideUSAPayment' />
</div>
<div className='settingsPanelDivider'>
<a target='_blank' className='browserButton primaryButton' href={url}>
{name}
</a>
<button className='browserButton primaryButton'>
<a target='_blank' href={url}>
{name}
</a>
</button>
</div>
</div>
}
Expand Down Expand Up @@ -923,7 +927,7 @@ class PaymentsTab extends ImmutableComponent {
const onButtonClick = this.props.ledgerData.get('created')
? this.props.showOverlay.bind(this, 'addFunds')
: (this.props.ledgerData.get('creating') ? () => {} : this.createWallet)
return <Button l10nId={buttonText} className='primaryButton addFunds' onClick={onButtonClick.bind(this)} disabled={this.props.ledgerData.get('creating')} />
return <Button l10nId={buttonText} className='primaryButton wideButton' onClick={onButtonClick.bind(this)} disabled={this.props.ledgerData.get('creating')} />
}

get paymentHistoryButton () {
Expand Down Expand Up @@ -1512,12 +1516,10 @@ class ShieldsTab extends ImmutableComponent {
<SettingCheckbox checked={this.props.braveryDefaults.get('safeBrowsing')} dataL10nId='safeBrowsing' onChange={this.onToggleSafeBrowsing} />
<SettingCheckbox checked={this.props.braveryDefaults.get('noScript')} dataL10nId='noScriptPref' onChange={this.onToggleNoScript} />
<SettingCheckbox dataL10nId='blockCanvasFingerprinting' prefKey={settings.BLOCK_CANVAS_FINGERPRINTING} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingItem>
<Button l10nId='manageAdblockSettings' className='primaryButton manageAdblockSettings'
onClick={aboutActions.newFrame.bind(null, {
location: 'about:adblock'
}, true)} />
</SettingItem>
<Button l10nId='manageAdblockSettings' className='primaryButton manageAdblockSettings'
onClick={aboutActions.newFrame.bind(null, {
location: 'about:adblock'
}, true)} />
</SettingsList>
<SitePermissionsPage siteSettings={this.props.siteSettings}
names={braveryPermissionNames}
Expand Down Expand Up @@ -1659,12 +1661,10 @@ class AdvancedTab extends ImmutableComponent {
<SettingCheckbox dataL10nId='usePDFJS' prefKey={settings.PDFJS_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='useTorrentViewer' prefKey={settings.TORRENT_VIEWER_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingCheckbox dataL10nId='enablePocket' prefKey={settings.POCKET_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
<SettingItem>
<Button l10nId='viewInstalledExtensions' className='primaryButton viewExtensionsInfo'
onClick={aboutActions.newFrame.bind(null, {
location: 'about:extensions'
}, true)} />
</SettingItem>
<Button l10nId='viewInstalledExtensions' className='primaryButton viewExtensionsInfo'
onClick={aboutActions.newFrame.bind(null, {
location: 'about:extensions'
}, true)} />
<div data-l10n-id='moreExtensionsComingSoon' className='moreExtensionsComingSoon' />
</SettingsList>
</div>
Expand Down
58 changes: 54 additions & 4 deletions js/about/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,67 @@ class AboutStyle extends ImmutableComponent {
&lt;/select>
</code></pre>
</div>

<h2 data-l10n-id='buttons' />
<span data-l10n-id='whiteButton' className='browserButton whiteButton inlineButton' onClick={this.onRemoveBookmark} />
<button data-l10n-id='browserButton' className='browserButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='done' className='browserButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='whiteButton' className='browserButton whiteButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;span data-l10n-id='cancel' className='browserButton whiteButton inlineButton'{'\n'}
&lt;button data-l10n-id='cancel' className='browserButton whiteButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>
<span data-l10n-id='primaryButton' className='browserButton primaryButton' onClick={this.onRemoveBookmark} />

<button data-l10n-id='inlineButton' className='browserButton whiteButton inlineButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;span data-l10n-id='done' className='browserButton primaryButton'{'\n'}
&lt;button data-l10n-id='done' className='browserButton whiteButton inlineButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='wideButton' className='browserButton whiteButton wideButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='cancel' className='browserButton whiteButton wideButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='smallButton' className='browserButton whiteButton smallButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='done' className='browserButton whiteButton smallButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='primaryButton' className='browserButton primaryButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='cancel' className='browserButton primaryButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='actionButton' className='browserButton actionButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='done' className='browserButton actionButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='subtleButton' className='browserButton subtleButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='cancel' className='browserButton subtleButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />
</code></pre>

<button data-l10n-id='primaryButton' className='browserButton primaryButton' onClick={this.onRemoveBookmark} /><button data-l10n-id='whiteButton' className='browserButton whiteButton' onClick={this.onRemoveBookmark} /><button data-l10n-id='wideButton' className='browserButton whiteButton wideButton' onClick={this.onRemoveBookmark} /><button data-l10n-id='primaryButton' className='browserButton primaryButton' onClick={this.onRemoveBookmark} />
<pre><code>
&lt;button data-l10n-id='cancel' className='browserButton primaryButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />{'\n'}
&lt;button data-l10n-id='cancel' className='browserButton whiteButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />{'\n'}
&lt;button data-l10n-id='cancel' className='browserButton whiteButton wideButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />{'\n'}
&lt;button data-l10n-id='cancel' className='browserButton primaryButton'{'\n'}
onClick={'{this.onRemoveBookmark}'} />{'\n'}
</code></pre>
</div>
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/components/autofillAddressPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class AutofillAddressPanel extends ImmutableComponent {
value={this.props.currentDetail.get('email')} />
</div>
<div className='formRow manageAutofillDataButtons'>
<Button l10nId='cancel' className='secondaryAltButton' onClick={this.props.onHide} />
<Button l10nId='cancel' className='whiteButton' onClick={this.props.onHide} />
<Button l10nId='save' className='primaryButton saveAddressButton' onClick={this.onSave}
disabled={this.disableSaveButton} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion js/components/autofillCreditCardPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AutofillCreditCardPanel extends ImmutableComponent {
</select>
</div>
<div className='formRow manageAutofillDataButtons'>
<Button l10nId='cancel' className='secondaryAltButton' onClick={this.props.onHide} />
<Button l10nId='cancel' className='whiteButton' onClick={this.props.onHide} />
<Button l10nId='save' className='primaryButton saveCreditCardButton' onClick={this.onSave}
disabled={this.disableSaveButton} />
</div>
Expand Down
6 changes: 3 additions & 3 deletions js/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const cx = require('../lib/classSet')
class Button extends ImmutableComponent {
render () {
if (this.props.iconClass) {
return <span disabled={this.props.disabled}
return <button disabled={this.props.disabled}
data-l10n-id={this.props.l10nId}
style={this.props.inlineStyles}
data-button-value={this.props.dataButtonValue}
Expand All @@ -21,7 +21,7 @@ class Button extends ImmutableComponent {
})}
onClick={this.props.onClick} />
}
return <span disabled={this.props.disabled}
return <button disabled={this.props.disabled}
data-l10n-id={this.props.l10nId}
data-l10n-args={JSON.stringify(this.props.l10nArgs || {})}
style={this.props.inlineStyles}
Expand All @@ -30,7 +30,7 @@ class Button extends ImmutableComponent {
[this.props.className]: !!this.props.className
})} onClick={this.props.onClick}>
{this.props.label}
</span>
</button>
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/components/clearBrowsingDataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ClearBrowsingDataPanel extends ImmutableComponent {
<SwitchControl className='siteSettingsSwitch' rightl10nId='savedSiteSettings' checkedOn={this.props.clearBrowsingDataDetail.get('savedSiteSettings')} onClick={this.onToggleSavedSiteSettings} />
</div>
<div className='formSection clearBrowsingDataButtons'>
<Button l10nId='cancel' className='secondaryAltButton' onClick={this.props.onHide} />
<Button l10nId='cancel' className='whiteButton' onClick={this.props.onHide} />
<Button l10nId='clear' className='primaryButton clearDataButton' onClick={this.onClear} />
</div>
<div className='formSection clearBrowsingDataWarning'>
Expand Down
2 changes: 1 addition & 1 deletion js/components/longPressButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class LongPressButton extends ImmutableComponent {
}

render () {
return <span data-l10n-id={this.props.l10nId}
return <button data-l10n-id={this.props.l10nId}
className={this.props.className}
disabled={this.props.disabled}
onClick={this.onClick}
Expand Down
22 changes: 12 additions & 10 deletions js/components/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,20 @@ class NavigationBar extends ImmutableComponent {
? null
: this.loading
? <span className='navigationButtonContainer'>
<span data-l10n-id='stopButton'
<button data-l10n-id='stopButton'
className='navigationButton stopButton'
onClick={this.onStop} />
</span>
: <span className='navigationButtonContainer'>
<span data-l10n-id='reloadButton'
<button data-l10n-id='reloadButton'
className='navigationButton reloadButton'
onClick={this.onReload} />
</span>
}
{
!this.titleMode && getSetting(settings.SHOW_HOME_BUTTON)
? <span className='navigationButtonContainer'>
<span data-l10n-id='homeButton'
<button data-l10n-id='homeButton'
className='navigationButton homeButton'
onClick={this.onHome} />
</span>
Expand All @@ -154,7 +154,7 @@ class NavigationBar extends ImmutableComponent {
{
!this.titleMode
? <span className='bookmarkButtonContainer'>
<span data-l10n-id={this.bookmarked ? 'removeBookmarkButton' : 'addBookmarkButton'}
<button data-l10n-id={this.bookmarked ? 'removeBookmarkButton' : 'addBookmarkButton'}
className={cx({
navigationButton: true,
bookmarkButton: true,
Expand Down Expand Up @@ -192,12 +192,14 @@ class NavigationBar extends ImmutableComponent {
{
!this.showNoScriptInfo
? null
: <Button iconClass='fa-ban'
l10nId='noScriptButton'
className={cx({
'noScript': true
})}
onClick={this.onNoScript} />
: <span className='noScriptButtonContainer'>
<Button iconClass='fa-ban'
l10nId='noScriptButton'
className={cx({
'noScript': true
})}
onClick={this.onNoScript} />
</span>
}
</div>
}
Expand Down
4 changes: 2 additions & 2 deletions js/components/siteInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SiteInfo extends ImmutableComponent {
<ul>
<li><span className='runInsecureContentWarning' data-l10n-id='runInsecureContentWarning' /></li>
<li>
<Button l10nId='allowRunInsecureContent' className='secondaryAltButton allowRunInsecureContentButton' onClick={this.onAllowRunInsecureContent} />
<Button l10nId='allowRunInsecureContent' className='whiteButton allowRunInsecureContentButton' onClick={this.onAllowRunInsecureContent} />
<Button l10nId='dismissAllowRunInsecureContent' className='primaryButton dismissAllowRunInsecureContentButton' onClick={this.props.onHide} />
</li>
</ul>
Expand All @@ -96,7 +96,7 @@ class SiteInfo extends ImmutableComponent {
<li><span className='denyRunInsecureContentWarning' data-l10n-id='denyRunInsecureContentWarning' /></li>
<li>
<Button l10nId='denyRunInsecureContent' className='primaryButton denyRunInsecureContentButton' onClick={this.onDenyRunInsecureContent} />
<Button l10nId='dismissDenyRunInsecureContent' className='secondaryAltButton dismissDenyRunInsecureContentButton' onClick={this.props.onHide} />
<Button l10nId='dismissDenyRunInsecureContent' className='whiteButton dismissDenyRunInsecureContentButton' onClick={this.props.onHide} />
</li>
</ul>
</li>
Expand Down
Loading