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';
|
2021-06-15 20:13:42 +00:00
|
|
|
import { ICON_SIZE } from './constants';
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
icon: {
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-11-30 21:47:05 +00:00
|
|
|
const ListIcon = React.memo(({
|
|
|
|
theme,
|
|
|
|
name,
|
|
|
|
color,
|
2021-06-15 20:13:42 +00:00
|
|
|
style,
|
|
|
|
testID
|
2020-11-30 21:47:05 +00:00
|
|
|
}) => (
|
|
|
|
<View style={[styles.icon, style]}>
|
2020-10-30 13:59:44 +00:00
|
|
|
<CustomIcon
|
|
|
|
name={name}
|
|
|
|
color={color ?? themes[theme].auxiliaryText}
|
2021-06-15 20:13:42 +00:00
|
|
|
size={ICON_SIZE}
|
|
|
|
testID={testID}
|
2020-10-30 13:59:44 +00:00
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
));
|
|
|
|
|
|
|
|
ListIcon.propTypes = {
|
|
|
|
theme: PropTypes.string,
|
|
|
|
name: PropTypes.string,
|
2020-11-30 21:47:05 +00:00
|
|
|
color: PropTypes.string,
|
2021-06-15 20:13:42 +00:00
|
|
|
style: PropTypes.object,
|
|
|
|
testID: PropTypes.string
|
2020-10-30 13:59:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ListIcon.displayName = 'List.Icon';
|
|
|
|
|
|
|
|
export default withTheme(ListIcon);
|