UNPKG

@kietpt2003/react-native-core-ui

Version:
41 lines (40 loc) 2.55 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { scale } from '../utils'; import { colors } from '../themes'; import { IconAlertCircle, IconAngleLeft, IconAngleRight, IconCheckBox, IconCheckBoxOutlineBlank, IconCheckBoxWithBg, IconChevronDown, IconChevronUp, IconHome, IconPerson, IconPlayCircle, IconPlus } from './components'; /** * The SvgIcon component provide a variety of custom icon * that based on react-native-svg package. This not the best * choice, but it's can be perfect for specific cases. */ const SvgIcon = ({ name = 'angle-left', size = scale(23), color = colors.black, strokeWidth = scale(1), fill = 'none', style, }) => { switch (name) { case 'person': return (_jsx(IconPerson, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'play-circle': return (_jsx(IconPlayCircle, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'plus': return (_jsx(IconPlus, { size: size, color: color, strokeWidth: strokeWidth, style: style })); case 'check-box': return (_jsx(IconCheckBox, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'check-box-with-bg': return (_jsx(IconCheckBoxWithBg, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'check-box-outline-blank': return (_jsx(IconCheckBoxOutlineBlank, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'alert-circle': return (_jsx(IconAlertCircle, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'angle-right': return (_jsx(IconAngleRight, { size: size, color: color, strokeWidth: strokeWidth, style: style })); case 'home': return (_jsx(IconHome, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'chevron-up': return (_jsx(IconChevronUp, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'chevron-down': return (_jsx(IconChevronDown, { size: size, color: color, strokeWidth: strokeWidth, fill: fill, style: style })); case 'angle-left': default: return (_jsx(IconAngleLeft, { size: size, color: color, strokeWidth: strokeWidth, style: style })); } }; SvgIcon.displayName = 'SvgIcon'; export default SvgIcon;