2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View, StyleSheet } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
import { CustomIcon } from '../../lib/Icons';
|
|
|
|
import { withTheme } from '../../theme';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
icon: {
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-11-30 21:47:05 +00:00
|
|
|
const ListIcon = React.memo(({
|
|
|
|
theme,
|
|
|
|
name,
|
|
|
|
color,
|
|
|
|
style
|
|
|
|
}) => (
|
|
|
|
<View style={[styles.icon, style]}>
|
2020-10-30 13:59:44 +00:00
|
|
|
<CustomIcon
|
|
|
|
name={name}
|
|
|
|
color={color ?? themes[theme].auxiliaryText}
|
|
|
|
size={20}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
));
|
|
|
|
|
|
|
|
ListIcon.propTypes = {
|
|
|
|
theme: PropTypes.string,
|
|
|
|
name: PropTypes.string,
|
2020-11-30 21:47:05 +00:00
|
|
|
color: PropTypes.string,
|
|
|
|
style: PropTypes.object
|
2020-10-30 13:59:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ListIcon.displayName = 'List.Icon';
|
|
|
|
|
|
|
|
export default withTheme(ListIcon);
|