2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
2022-01-17 16:10:39 +00:00
|
|
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
2022-05-02 19:21:15 +00:00
|
|
|
import { CustomIcon, TIconsName } from '../CustomIcon';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { ICON_SIZE } from './constants';
|
|
|
|
|
|
|
|
interface IListIcon {
|
2022-05-02 19:21:15 +00:00
|
|
|
name: TIconsName;
|
2024-04-18 10:19:54 +00:00
|
|
|
color?: string;
|
2022-01-17 16:10:39 +00:00
|
|
|
style?: StyleProp<ViewStyle>;
|
|
|
|
testID?: string;
|
2022-04-15 03:11:36 +00:00
|
|
|
size?: number;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
icon: {
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-04-18 10:19:54 +00:00
|
|
|
const ListIcon = ({ name, color, style, testID, size }: IListIcon): React.ReactElement => (
|
|
|
|
<View style={[styles.icon, style]}>
|
|
|
|
<CustomIcon name={name} color={color} size={size ?? ICON_SIZE} testID={testID} />
|
|
|
|
</View>
|
|
|
|
);
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
ListIcon.displayName = 'List.Icon';
|
|
|
|
|
2022-03-25 18:09:02 +00:00
|
|
|
export default ListIcon;
|