// @flow
import * as React from 'react'
import {StyleSheet, Platform} from 'react-native'
import Icon from 'react-native-vector-icons/Ionicons'

const styles = StyleSheet.create({
	icon: {
		fontSize: Platform.select({
			ios: 30,
			android: 24,
		}),
	},
})

type Props = {
	tintColor: string,
	focused: boolean,
}

export const platformPrefixIcon = (name: string) => {
	return Platform.OS === 'ios' ? `ios-${name}` : `md-${name}`
}

export const TabBarIcon = (icon: string) => ({tintColor}: Props) => (
	<Icon name={`ios-${icon}`} style={[styles.icon, {color: tintColor}]} />
)

@@ -365,16 +365,218 @@
 g) =%3E %7B%0A
+%09let isAvailable = Icon.hasIcon(name)%0A%09let isAvailableOnBothPlatforms =%0A%09%09Icon.hasIcon(%60ios-$%7Bname%7D%60) && Icon.hasIcon(%60md-$%7Bname%7D%60)%0A%0A%09if (isAvailable && !isAvailableOnBothPlatforms) %7B%0A%09%09return name%0A%09%7D%0A%0A
 %09return 

Return given input if criteria not met