forked from 24ark/react-native-step-indicator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultStepLabel.js
46 lines (40 loc) · 1.06 KB
/
DefaultStepLabel.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
import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
StyleSheet,
TouchableWithoutFeedback,
} from 'react-native';
const ViewPropTypes = require('react-native').ViewPropTypes || View.propTypes;
const styles = StyleSheet.create({
stepLabel: {
fontSize:12,
textAlign:'center',
fontWeight:'500'
},
stepLabelItem: {
flex:1,
alignItems:'center',
justifyContent:'center'
}
});
function DefaultStepLabel(props) {
const { index, label, onLabelPress, selectedStepLabelStyle, customStyles } = props;
return (
<TouchableWithoutFeedback style={styles.stepLabelItem} onPress={() => onLabelPress(index)}>
<View style={styles.stepLabelItem}>
<Text style={[styles.stepLabel, selectedStepLabelStyle , { fontSize: customStyles.labelSize }]}>
{label}
</Text>
</View>
</TouchableWithoutFeedback>
)
}
DefaultStepLabel.propTypes = {
onLabelPress: PropTypes.func
}
DefaultStepLabel.defaultProps = {
onLabelPress: () => ''
};
export default DefaultStepLabel;