eletrotupi / tcc/ frontend/components/ui/icon-symbol.ios.tsx1aeaa809d02f213c64fe61e202ea9d415158127c
598 B | 32 lines Raw
1
import { SymbolView, SymbolViewProps, SymbolWeight } from 'expo-symbols';
2
import { StyleProp, ViewStyle } from 'react-native';
3

4
export function IconSymbol({
5
  name,
6
  size = 24,
7
  color,
8
  style,
9
  weight = 'regular',
10
}: {
11
  name: SymbolViewProps['name'];
12
  size?: number;
13
  color: string;
14
  style?: StyleProp<ViewStyle>;
15
  weight?: SymbolWeight;
16
}) {
17
  return (
18
    <SymbolView
19
      weight={weight}
20
      tintColor={color}
21
      resizeMode="scaleAspectFit"
22
      name={name}
23
      style={[
24
        {
25
          width: size,
26
          height: size,
27
        },
28
        style,
29
      ]}
30
    />
31
  );
32
}