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

Commit 46d07ec

Browse files
committedJan 17, 2017
Pulled common styles into a file to be shared w/ Textbox + Dropdown
Implement feedback from #6689 (review) Auditors: @luixxiul
1 parent 9744c75 commit 46d07ec

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed
 

‎app/renderer/components/dropdown.js

+3-15
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ const React = require('react')
66
const ImmutableComponent = require('../../../js/components/immutableComponent')
77
const {StyleSheet, css} = require('aphrodite')
88
const globalStyles = require('./styles/global')
9+
const commonStyles = require('./styles/commonStyles')
10+
911
const caretDownGrey = require('../../extensions/brave/img/caret_down_grey.svg')
1012

1113
class Dropdown extends ImmutableComponent {
1214
render () {
1315
const className = css(
14-
this.props['data-isFormControl'] && styles.formControl,
16+
this.props['data-isFormControl'] && commonStyles.formControl,
1517
styles.dropdown,
1618
this.props['data-isSettings'] && styles.settings
1719
)
@@ -37,20 +39,6 @@ class SettingDropdown extends ImmutableComponent {
3739
const selectPadding = '0.4em'
3840

3941
const styles = StyleSheet.create({
40-
'formControl': {
41-
background: 'white',
42-
border: `solid 1px ${globalStyles.color.black20}`,
43-
borderRadius: globalStyles.radius.borderRadius,
44-
boxShadow: `inset 0 1px 1px ${globalStyles.color.black10}`,
45-
boxSizing: 'border-box',
46-
display: 'block',
47-
color: globalStyles.color.darkGray,
48-
fontSize: '14.5px',
49-
height: '2.25em',
50-
outline: 'none',
51-
padding: '0.4em',
52-
width: '100%'
53-
},
5442
'dropdown': {
5543
background: `url(${caretDownGrey}) calc(100% - ${selectPadding}) 50% / contain no-repeat`,
5644
backgroundColor: '#fefefe',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
3+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
const {StyleSheet} = require('aphrodite')
6+
const globalStyles = require('./global')
7+
8+
const styles = StyleSheet.create({
9+
'formControl': {
10+
background: 'white',
11+
border: `solid 1px ${globalStyles.color.black20}`,
12+
borderRadius: globalStyles.radius.borderRadius,
13+
boxShadow: `inset 0 1px 1px ${globalStyles.color.black10}`,
14+
boxSizing: 'border-box',
15+
display: 'block',
16+
color: globalStyles.color.darkGray,
17+
fontSize: '14.5px',
18+
height: '2.25em',
19+
outline: 'none',
20+
padding: '0.4em',
21+
width: '100%'
22+
}
23+
})
24+
25+
module.exports = styles

‎app/renderer/components/textbox.js

+2-15
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const React = require('react')
66
const ImmutableComponent = require('../../../js/components/immutableComponent')
77
const {StyleSheet, css} = require('aphrodite')
88
const globalStyles = require('./styles/global')
9+
const commonStyles = require('./styles/commonStyles')
910

1011
class Textbox extends ImmutableComponent {
1112
render () {
1213
const className = css(
13-
this.props['data-isFormControl'] && styles.formControl,
14+
this.props['data-isFormControl'] && commonStyles.formControl,
1415
styles.textbox,
1516
this.props['data-isSettings'] && styles.isSettings,
1617
(this.props.readonly || this.props.readOnly) ? styles.readOnly : styles.outlineable,
@@ -40,20 +41,6 @@ class RecoveryKeyTextbox extends ImmutableComponent {
4041
}
4142

4243
const styles = StyleSheet.create({
43-
'formControl': {
44-
background: 'white',
45-
border: `solid 1px ${globalStyles.color.black20}`,
46-
borderRadius: globalStyles.radius.borderRadius,
47-
boxShadow: `inset 0 1px 1px ${globalStyles.color.black10}`,
48-
boxSizing: 'border-box',
49-
display: 'block',
50-
color: globalStyles.color.darkGray,
51-
fontSize: '14.5px',
52-
height: '2.25em',
53-
outline: 'none',
54-
padding: '0.4em',
55-
width: '100%'
56-
},
5744
'textbox': {
5845
boxSizing: 'border-box',
5946
width: 'auto'

0 commit comments

Comments
 (0)