Skip to content

Commit 7a2e4f3

Browse files
a-morenovallsalvaromb
authored andcommitted
Solve Android styles issues (#1)
* Solve Android styles issues * Fix tests
1 parent 9691bce commit 7a2e4f3

File tree

3 files changed

+18
-46
lines changed

3 files changed

+18
-46
lines changed

__tests__/__snapshots__/CascadePicker.test.js.snap

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`renders correctly 1`] = `
4-
<View>
4+
<View
5+
style={
6+
Object {
7+
"backgroundColor": "white",
8+
"elevation": 4,
9+
}
10+
}
11+
>
512
<View
613
style={
714
Array [
@@ -75,25 +82,7 @@ exports[`renders correctly 1`] = `
7582
"margin": 10,
7683
"width": 300,
7784
},
78-
Array [
79-
Array [
80-
Object {
81-
"overflow": "hidden",
82-
},
83-
Object {
84-
"borderBottomWidth": 1,
85-
},
86-
Object {
87-
"backgroundColor": "grey",
88-
},
89-
],
90-
Object {
91-
"alignItems": "center",
92-
"flexDirection": "row",
93-
"height": 44,
94-
"justifyContent": "center",
95-
},
96-
],
85+
undefined,
9786
]
9887
}
9988
>
@@ -124,25 +113,7 @@ exports[`renders correctly 1`] = `
124113
"margin": 10,
125114
"width": 300,
126115
},
127-
Array [
128-
Array [
129-
Object {
130-
"overflow": "hidden",
131-
},
132-
Object {
133-
"borderBottomWidth": 1,
134-
},
135-
Object {
136-
"backgroundColor": "white",
137-
},
138-
],
139-
Object {
140-
"alignItems": "center",
141-
"flexDirection": "row",
142-
"height": 44,
143-
"justifyContent": "center",
144-
},
145-
],
116+
undefined,
146117
]
147118
}
148119
>

lib/CascadePicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class CascadePicker extends React.Component<Props, State> {
144144

145145
render() {
146146
return (
147-
<View>
147+
<View style={{ backgroundColor: this.props.mainColor, elevation: 4 }}>
148148
{this._renderButton()}
149149
<Animated.View style={[styles.options, { height: this._height }]}>
150150
{this._renderChilds()}

lib/OptionButton.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import React from 'react'
44
import {
5+
View,
56
Text,
67
Platform,
78
StyleSheet,
@@ -29,12 +30,12 @@ class OptionButton extends React.Component<Props> {
2930

3031
render() {
3132
return (
32-
<TouchableElement
33-
onPress={this._onPressElement}
34-
style={[this.props.style, styles.container]}>
35-
<Text style={[styles.text, this.props.textStyle]}>
36-
{this.props.children.toUpperCase()}
37-
</Text>
33+
<TouchableElement onPress={this._onPressElement}>
34+
<View style={[this.props.style, styles.container]}>
35+
<Text style={[styles.text, this.props.textStyle]}>
36+
{this.props.children.toUpperCase()}
37+
</Text>
38+
</View>
3839
</TouchableElement>
3940
)
4041
}

0 commit comments

Comments
 (0)