1import MaterialCommunityIcons from '@expo/vector-icons/build/MaterialCommunityIcons';
2import React from 'react';
3import { Platform } from 'react-native';
4
5import { Colors } from '../constants';
6
7type Props = {
8  name: string;
9  focused?: boolean;
10  size?: number;
11};
12
13const TabIcon = ({ size = 27, name, focused }: Props) => {
14  const color = focused ? Colors.tabIconSelected : Colors.tabIconDefault;
15  const platformSize = Platform.select({
16    ios: size,
17    default: size - 2,
18  });
19  return <MaterialCommunityIcons name={name as any} size={platformSize} color={color} />;
20};
21
22export default TabIcon;
23