summaryrefslogtreecommitdiff
path: root/app/components/icon/icon.tsx
blob: f596bb2d135dc4ffedbfdc7f03055f6877ca251a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import * as React from 'react'
import { View, ImageStyle } from 'react-native'
import { AutoImage as Image } from '../auto-image/auto-image'
import { IconProps } from './icon.props'
import { icons } from './icons'

const ROOT: ImageStyle = {
  resizeMode: 'contain',
}

export function Icon(props: IconProps) {
  const { style: styleOverride, icon, containerStyle } = props

  return (
    <View style={containerStyle}>
      <Image style={[ROOT, styleOverride]} source={icons[icon]} />
    </View>
  )
}