Created
April 7, 2017 14:40
-
-
Save mvbattan/d4ee4540a590c659c5f021e4d44ecef1 to your computer and use it in GitHub Desktop.
LevelSeparator.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, StyleSheet, Text } from 'react-native'; | |
export default function LevelSeparator({ label, height }) { | |
return ( | |
<View style={[styles.container, { height }]}> | |
<Text style={styles.label}> | |
{label.toFixed(0)} | |
</Text> | |
<View style={styles.separatorRow}/> | |
</View> | |
); | |
} | |
LevelSeparator.propTypes = { | |
label: React.PropTypes.number.isRequired, | |
height: React.PropTypes.number.isRequired | |
}; | |
export const styles = StyleSheet.create({ | |
container: { | |
flexDirection: 'row', | |
alignItems: 'center', | |
justifyContent: 'center' | |
}, | |
label: { | |
textAlign: 'right', | |
width: 20 | |
}, | |
separatorRow: { | |
width: 250, | |
height: 1, | |
borderWidth: 0.5, | |
borderColor: 'rgba(0,0,0,0.3)', | |
marginHorizontal: 5 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment