UNPKG

@uiw/react-native

Version:
28 lines 779 B
import React from 'react'; import Svg, { SvgXml, Path } from 'react-native-svg'; import svgPaths from '@uiw/icons/fonts/w-icon.json'; export default (props => { const { size = 26, name, fill = '#000000', stroke, xml, paths, color, ...otherProps } = props; if (xml) { return <SvgXml testID="RNE__Icon__svgXml" xml={xml} height={size} width={size} {...otherProps} />; } let pathData = paths; if (!pathData) { if (!name || !svgPaths[name]) { return null; } pathData = svgPaths[name]; } return <Svg testID="RNE__Icon__svg" fill={color || fill} stroke={stroke} height={size} width={size} viewBox="0 0 20 20" {...otherProps}> {pathData.map((d, i) => <Path key={i} d={d} fillRule="evenodd" />)} </Svg>; });