forked from calebnance/expo-spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineItemCategory.js
More file actions
51 lines (47 loc) · 1.29 KB
/
LineItemCategory.js
File metadata and controls
51 lines (47 loc) · 1.29 KB
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
47
48
49
50
51
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import PropTypes from 'prop-types';
import { Feather } from '@expo/vector-icons';
import { colors, fonts, gStyle } from '../api';
const LineItemCategory = ({ icon, onPress, title }) => (
<TouchableOpacity
activeOpacity={gStyle.activeOpacity}
onPress={onPress}
style={styles.container}
>
<View style={gStyle.flexRowCenterAlign}>
<Feather color={colors.greyInactive} name={icon} size={24} />
<Text style={styles.title}>{title}</Text>
</View>
<View style={styles.containerRight}>
<Feather color={colors.greyInactive} name="chevron-right" size={20} />
</View>
</TouchableOpacity>
);
LineItemCategory.propTypes = {
// required
icon: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
title: PropTypes.string.isRequired
};
const styles = StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between',
paddingHorizontal: 24,
paddingVertical: 10,
width: '100%'
},
title: {
color: colors.white,
fontFamily: fonts.spotifyRegular,
fontSize: 14,
marginLeft: 16
},
containerRight: {
alignItems: 'flex-end',
flex: 1
}
});
export default LineItemCategory;