Skip to content

Commit ed87ab6

Browse files
authored
split off styles (#230)
1 parent 8c30402 commit ed87ab6

File tree

7 files changed

+81
-76
lines changed

7 files changed

+81
-76
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 6.3.3
2+
3+
##### Chore
4+
5+
- Split off styles into separate file
6+
7+
---
8+
19
### 6.3.2
210

311
##### Bugfix

demo/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from 'react-native';
1212
import {Chevron} from 'react-native-shapes';
1313
// import { Ionicons } from '@expo/vector-icons';
14-
import RNPickerSelect, {defaultStyles} from './rnpickerselect';
14+
import RNPickerSelect, {defaultStyles} from './react-native-picker-select';
1515

1616
const sports = [
1717
{

demo/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* @format
3-
*/
4-
51
import {AppRegistry} from 'react-native';
62
import App from './App';
73
import {name as appName} from './app.json';
File renamed without changes.

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-picker-select",
3-
"version": "6.3.2",
3+
"version": "6.3.3",
44
"description": "A Picker component for React Native which emulates the native <select> interfaces for each platform",
55
"license": "MIT",
66
"author": "Michael Lefkowitz <[email protected]>",
@@ -20,10 +20,8 @@
2020
"items"
2121
],
2222
"files": [
23-
"LICENSE",
24-
"README.md",
2523
"index.d.ts",
26-
"src/index.js"
24+
"/src"
2725
],
2826
"dependencies": {
2927
"lodash.isequal": "^4.5.0"

src/index.js

+2-67
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Modal,
66
Picker,
77
Platform,
8-
StyleSheet,
98
Text,
109
TextInput,
1110
TouchableOpacity,
@@ -14,6 +13,7 @@ import {
1413
} from 'react-native';
1514
import PropTypes from 'prop-types';
1615
import isEqual from 'lodash.isequal';
16+
import { defaultStyles } from './styles';
1717

1818
export default class RNPickerSelect extends PureComponent {
1919
static propTypes = {
@@ -517,69 +517,4 @@ export default class RNPickerSelect extends PureComponent {
517517
}
518518
}
519519

520-
export const defaultStyles = StyleSheet.create({
521-
viewContainer: {
522-
alignSelf: 'stretch',
523-
},
524-
iconContainer: {
525-
position: 'absolute',
526-
right: 0,
527-
},
528-
modalViewTop: {
529-
flex: 1,
530-
},
531-
modalViewMiddle: {
532-
height: 44,
533-
flexDirection: 'row',
534-
justifyContent: 'space-between',
535-
alignItems: 'center',
536-
paddingHorizontal: 10,
537-
backgroundColor: '#EFF1F2',
538-
borderTopWidth: 0.5,
539-
borderTopColor: '#919498',
540-
zIndex: 2,
541-
},
542-
chevronContainer: {
543-
flexDirection: 'row',
544-
},
545-
chevron: {
546-
width: 15,
547-
height: 15,
548-
backgroundColor: 'transparent',
549-
borderColor: '#D0D4DB',
550-
borderTopWidth: 1.5,
551-
borderRightWidth: 1.5,
552-
},
553-
chevronUp: {
554-
marginLeft: 11,
555-
transform: [{ translateY: 4 }, { rotate: '-45deg' }],
556-
},
557-
chevronDown: {
558-
marginLeft: 22,
559-
transform: [{ translateY: -5 }, { rotate: '135deg' }],
560-
},
561-
chevronActive: {
562-
borderColor: '#007AFE',
563-
},
564-
done: {
565-
color: '#007AFE',
566-
fontWeight: 'bold',
567-
fontSize: 15,
568-
paddingTop: 1,
569-
paddingRight: 2,
570-
},
571-
modalViewBottom: {
572-
justifyContent: 'center',
573-
backgroundColor: '#D0D4DB',
574-
},
575-
placeholder: {
576-
color: '#C7C7CD',
577-
},
578-
headlessAndroidPicker: {
579-
position: 'absolute',
580-
width: '100%',
581-
height: '100%',
582-
color: 'transparent',
583-
opacity: 0,
584-
},
585-
});
520+
export { defaultStyles };

src/styles.js

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
export const defaultStyles = StyleSheet.create({
4+
viewContainer: {
5+
alignSelf: 'stretch',
6+
},
7+
iconContainer: {
8+
position: 'absolute',
9+
right: 0,
10+
},
11+
modalViewTop: {
12+
flex: 1,
13+
},
14+
modalViewMiddle: {
15+
height: 44,
16+
flexDirection: 'row',
17+
justifyContent: 'space-between',
18+
alignItems: 'center',
19+
paddingHorizontal: 10,
20+
backgroundColor: '#EFF1F2',
21+
borderTopWidth: 0.5,
22+
borderTopColor: '#919498',
23+
zIndex: 2,
24+
},
25+
chevronContainer: {
26+
flexDirection: 'row',
27+
},
28+
chevron: {
29+
width: 15,
30+
height: 15,
31+
backgroundColor: 'transparent',
32+
borderColor: '#D0D4DB',
33+
borderTopWidth: 1.5,
34+
borderRightWidth: 1.5,
35+
},
36+
chevronUp: {
37+
marginLeft: 11,
38+
transform: [{ translateY: 4 }, { rotate: '-45deg' }],
39+
},
40+
chevronDown: {
41+
marginLeft: 22,
42+
transform: [{ translateY: -5 }, { rotate: '135deg' }],
43+
},
44+
chevronActive: {
45+
borderColor: '#007AFE',
46+
},
47+
done: {
48+
color: '#007AFE',
49+
fontWeight: 'bold',
50+
fontSize: 15,
51+
paddingTop: 1,
52+
paddingRight: 2,
53+
},
54+
modalViewBottom: {
55+
justifyContent: 'center',
56+
backgroundColor: '#D0D4DB',
57+
},
58+
placeholder: {
59+
color: '#C7C7CD',
60+
},
61+
headlessAndroidPicker: {
62+
position: 'absolute',
63+
width: '100%',
64+
height: '100%',
65+
color: 'transparent',
66+
opacity: 0,
67+
},
68+
});

0 commit comments

Comments
 (0)