diff --git a/Icon.js b/Icon.js index 3a33f43..6c2242d 100644 --- a/Icon.js +++ b/Icon.js @@ -1,13 +1,22 @@ import React from "react"; import PropTypes from "prop-types"; -import { View, TouchableOpacity } from "react-native" +import { TouchableOpacity } from "react-native" import { Svg, Path } from "react-native-svg"; import { findIconDefinition } from "@fortawesome/fontawesome-svg-core"; import { prefixTypes } from "./config"; const DEFAULT_ICON = "question-circle"; -const Icon = ( { name, size, color, type, containerStyle, iconStyle, onPress, activeOpacity } ) => { +const Icon = ({ + name = '', + size = 20, + color = 'black', + type = 'regular', + activeOpacity = 0.2, + containerStyle, + iconStyle, + onPress +}) => { const prefix = prefixTypes[type]; let icon = findIconDefinition( { prefix, iconName: name } ); @@ -70,12 +79,4 @@ Icon.propTypes = { activeOpacity: PropTypes.number }; -Icon.defaultProps = { - name: "", - size: 20, - color: "black", - type: "regular", - activeOpacity: 0.2 -}; - export default Icon;