Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
lightning-bits
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
lightning-bits
Commits
33c91539
Unverified
Commit
33c91539
authored
Aug 27, 2019
by
Tankred Hase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate react-native-picker-select into NamedFieldSelect component
parent
0965f9a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
field.js
src/component/field.js
+26
-22
No files found.
src/component/field.js
View file @
33c91539
import
React
from
'react'
;
import
{
Text
as
RNText
,
StyleSheet
,
View
,
TouchableOpacity
,
ViewPropTypes
,
}
from
'react-native'
;
import
{
Text
as
RNText
,
StyleSheet
,
View
,
ViewPropTypes
}
from
'react-native'
;
import
RNPickerSelect
from
'react-native-picker-select'
;
import
PropTypes
from
'prop-types'
;
import
{
createStyles
,
maxWidth
}
from
'./media-query'
;
import
Text
from
'./text'
;
...
...
@@ -112,35 +107,44 @@ NamedField.propTypes = {
//
const
namedSelectStyles
=
StyleSheet
.
create
({
touchable
:
{
wrapper
:
{
flexDirection
:
'row'
,
alignItems
:
'center'
,
marginRight
:
15
,
},
name
:
{
});
const
pickerStyles
=
StyleSheet
.
create
({
inputIOS
:
{
fontFamily
:
'OpenSans Regular'
,
fontSize
:
font
.
sizeM
,
lineHeight
:
font
.
lineHeightM
+
3
,
height
:
font
.
lineHeightM
+
2
*
12
,
color
:
color
.
blackText
,
opacity
:
0.75
,
},
inputAndroid
:
{
fontFamily
:
'OpenSans Regular'
,
fontSize
:
font
.
sizeM
,
lineHeight
:
font
.
lineHeightM
+
2
*
12
,
marginRight
:
3
,
lineHeight
:
font
.
lineHeightM
+
3
,
height
:
font
.
lineHeightM
+
2
*
12
,
color
:
color
.
blackText
,
opacity
:
0.75
,
padding
:
0
,
},
});
export
const
NamedFieldSelect
=
({
onPress
,
name
,
children
,
style
})
=>
(
export
const
NamedFieldSelect
=
({
name
,
style
,
...
props
})
=>
(
<
View
style
=
{[
namedStyles
.
content
,
style
]}
>
<
TouchableOpacity
style
=
{
namedSelectStyles
.
touchable
}
onPress
=
{
onPress
}
>
<
Text
style
=
{
namedSelectStyles
.
name
}
>
{
name
}
<
/Text
>
<
ArrowDownIcon
height
=
{
22
}
width
=
{
22
}
stroke
=
"#4A4A4A"
/>
<
/TouchableOpacity
>
<
Text
style
=
{
namedStyles
.
text
}
numberOfLines
=
{
1
}
>
{
children
}
<
/Text
>
<
Text
style
=
{
namedStyles
.
name
}
>
{
name
}
<
/Text
>
<
View
style
=
{
namedSelectStyles
.
wrapper
}
>
<
RNPickerSelect
placeholder
=
{{}}
style
=
{
pickerStyles
}
{...
props
}
/
>
<
ArrowDownIcon
height
=
{
22
}
width
=
{
22
}
stroke
=
"#969596"
/>
<
/View
>
<
/View
>
);
NamedFieldSelect
.
propTypes
=
{
onPress
:
PropTypes
.
func
.
isRequired
,
name
:
PropTypes
.
string
,
children
:
PropTypes
.
oneOfType
([
PropTypes
.
string
,
PropTypes
.
array
]),
style
:
ViewPropTypes
.
style
,
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment