Skip to content

Instantly share code, notes, and snippets.

@mvbattan
Created April 7, 2017 14:40
Show Gist options
  • Save mvbattan/d4ee4540a590c659c5f021e4d44ecef1 to your computer and use it in GitHub Desktop.
Save mvbattan/d4ee4540a590c659c5f021e4d44ecef1 to your computer and use it in GitHub Desktop.
LevelSeparator.js
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