-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (29 loc) · 922 Bytes
/
index.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
import React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import BaseComponent from './BaseComponent'
export default class Divider extends BaseComponent {
static propTypes = {
height: React.PropTypes.number,
color: React.PropTypes.string,
width: React.PropTypes.number
}
render() {
const height = this.props.height
const color = this.props.color
const customDivider = {}
_.assign(customDivider,
height ? { height: height } : {},
color ? { backgroundColor: color } : {},
this.props.width ? { width: this.props.width } : {}
)
return (
<View style={StyleSheet.flatten([styles.divider, customDivider, this.props.style])}/>
)
}
}
const styles = {
divider: {
backgroundColor: '#D5D5D5',
height: 0.5
}
}