SvgIcon.js 555 B

1234567891011121314151617181920
  1. import * as React from 'react'
  2. import { svg, path } from 'react-native-svg'
  3. import { withTheme } from 'react-native-paper'
  4. import names from '../Utils/SvgUtils'
  5. function Icon(props) {
  6. const { name, width, height, type, theme } = props
  7. let { color } = props
  8. const { colors } = theme
  9. if (type) {
  10. color = colors[type]
  11. }
  12. return (
  13. <svg width={width || 32} height={height || 32} viewBox="0 0 1024 1024">
  14. <path fill={color || '#000000'} d={names[name || 'home']} />
  15. </svg>
  16. )
  17. }
  18. export default withTheme(Icon)