31 lines
622 B
JavaScript
31 lines
622 B
JavaScript
import React from 'react';
|
|
import { Text, View } from 'react-native';
|
|
|
|
const CategoryItem = (props) => {
|
|
const { categoryTextStyle } = styles;
|
|
return (
|
|
<View style={containerStyle(props.categoryBackgroudColor)}>
|
|
<Text style={categoryTextStyle}>
|
|
{props.categoryName}
|
|
</Text>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const containerStyle = function (containerBackgroudColor) {
|
|
return {
|
|
backgroundColor: containerBackgroudColor,
|
|
justifyContent: 'center',
|
|
alignItems: 'center'
|
|
};
|
|
};
|
|
|
|
const styles = {
|
|
categoryTextStyle: {
|
|
fontSize: 20,
|
|
color: '#fff'
|
|
}
|
|
};
|
|
|
|
export default CategoryItem;
|