diff --git a/index.js b/index.js index 86940fe..0029ca7 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; -import { Image } from 'react-native'; +import { Image, TouchableOpacity } from 'react-native'; import * as flags from './flags'; type Props = { @@ -9,17 +9,25 @@ type Props = { code: string, type?: 'flat' | 'shiny', style?: any, + onPress: void }; -const Flag = ({ size = 64, code, type = 'shiny', style }: Props) => { +const Flag = ({ size = 64, code, type = 'shiny', style, onPress }: Props) => { const flag = flags[type][`icons${size}`][code]; const unknownFlag = flags[type][`icons${size}`]['unknown']; - return ( + const flagImage = + + if (!onPress) return flagImage; + + return ( + + {flagImage} + ); };