2022-05-02 19:21:15 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
|
|
|
|
import { TextProps } from 'react-native';
|
|
|
|
|
|
|
|
import { mappedIcons } from './mappedIcons';
|
|
|
|
|
|
|
|
const icoMoonConfig = require('./selection.json');
|
|
|
|
|
|
|
|
export const IconSet = createIconSetFromIcoMoon(icoMoonConfig, 'custom', 'custom.ttf');
|
|
|
|
|
|
|
|
export type TIconsName = keyof typeof mappedIcons;
|
|
|
|
|
2022-07-06 13:23:02 +00:00
|
|
|
export interface ICustomIcon extends TextProps {
|
2022-05-02 19:21:15 +00:00
|
|
|
name: TIconsName;
|
|
|
|
size: number;
|
|
|
|
color: string;
|
|
|
|
}
|
|
|
|
|
2022-05-26 17:10:24 +00:00
|
|
|
const CustomIcon = ({ name, size, color, ...props }: ICustomIcon) => (
|
2022-05-02 19:21:15 +00:00
|
|
|
// @ts-ignore TODO remove this after update @types/react-native to 0.65.0
|
|
|
|
<IconSet name={name} size={size} color={color} {...props} />
|
|
|
|
);
|
|
|
|
export { CustomIcon };
|