-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathSwitchField.android.js
54 lines (42 loc) · 1.04 KB
/
SwitchField.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
import React from 'react';
let { View, StyleSheet, Text, Switch} = require('react-native');
import {SwitchComponent} from '../lib/SwitchComponent';
export class SwitchField extends React.Component{
setValue(value){
this.refs.fieldComponent.setValue(value)
}
render(){
return(<SwitchComponent
{...this.props}
ref='fieldComponent'
containerStyle={[
formStyles.fieldContainer,
formStyles.horizontalContainer,
this.props.containerStyle
]}
labelStyle = {[
formStyles.fieldText,
this.props.labelStyle
]}
switchStyle={[
{marginTop: 7, position:'absolute', right: 10},
this.props.switchStyle
]}
/>
)
}
}
let formStyles = StyleSheet.create({
fieldContainer:{
borderBottomWidth: 1,
borderBottomColor: '#C8C7CC',
backgroundColor: 'white',
justifyContent: 'center',
height: 45
},
horizontalContainer:{
flexDirection: 'row',
justifyContent: 'flex-start'
},
});