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E,EAAE,CACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CACpB,8BAAC,qBAAW,IACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EACzB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,EAC7B,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAChC,KAAK,EAAE,KAAK,GACZ,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,gBAAM,CAAC,MAAM,EAClE,OAAO,EACL,IAAI,CAAC,KAAK,CAAC,OAAO;gBAChB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAElD,IAAI,EAAE,IAAI,KAET,IAAI,CAAC,KAAK,CAAC,KAAK,CACV,CACV,CACI,CACR,CAAC;IACJ,CAAC;CACF;AA/CD,kCA+CC;AAED,kBAAe,WAAW,CAAC","names":[],"sources":["/Users/thomas/Source/react-native-core/source/components/CrossButton/CrossButton.tsx"],"sourcesContent":["import React from 'react';\n// @ts-ignore\nimport { Button } from 'react-native-paper';\nimport { ViewStyle, StyleProp, View, ButtonProps } from 'react-native';\nimport FontAwesome from 'react-native-vector-icons/FontAwesome';\nimport { Color } from 'csstype';\nimport _ from 'lodash';\nimport styles, { Colors } from '../../styles';\n\n/**\n * Cross button options\n * @typedef ICrossButtonProps\n */\nexport interface ICrossButtonProps {\n  /**\n   * Foreground (icon) color. Default is {@link Colors.CrossBlack}\n   */\n  color?: Color;\n  /**\n   * Font-Awesome icon name\n   *\n   * https://fontawesome.com/icons/\n   */\n  iconName?: string;\n  /**\n   * Background color. Default value is {@link Colors.NextButton} if {@link title} was supplied\n   */\n  backgroundColor?: Color;\n  style?: StyleProp<ViewStyle>;\n  title?: string;\n  /**\n   * Size of the icon\n   */\n  size?: number;\n  disabled?: boolean;\n  /**\n   * Button visual appearence. Default is 'text'\n   *\n   * https://callstack.github.io/react-native-paper/button.html\n   */\n  mode?: 'text' | 'outlined' | 'contained';\n  /**\n   * Optional button styles to apply\n   */\n  buttonStyle?: ButtonProps;\n  onPress?: () => void;\n  compact?: boolean;\n}\n\n/**\n * A custom button that displays as an icon if {@param title} is not supplied\n *\n * Remarks: use custom {@param onPressButton} event\n * @param param0 {@link ICrossButtonProps}\n */\nexport class CrossButton extends React.Component<ICrossButtonProps> {\n  render() {\n    const mode = this.props.mode || 'text';\n    return (\n      <View style={styles.container}>\n        {_.isNil(this.props.title) && !_.isNil(this.props.iconName) ? (\n          <FontAwesome.Button\n            {...this.props}\n            style={(this.props.style as ViewStyle) || styles.container}\n            onPress={() => {\n              if (this.props.onPress) {\n                this.props.onPress();\n              }\n            }}\n            color={this.props.color || Colors.CrossBlack}\n            name={this.props.iconName.toString()\n            }\n          />\n        ) : (\n          <Button\n            color={this.props.backgroundColor || Colors.NextButton}\n            disabled={this.props.disabled || false}\n            {...this.props}\n            icon={({ size, color }) =>\n              this.props.iconName ? (\n                <FontAwesome\n                  name={this.props.iconName}\n                  size={this.props.size || size}\n                  style={{ margin: 0, padding: 0 }}\n                  color={color}\n                />\n              ) : null\n            }\n            style={this.props.style || this.props.buttonStyle || styles.button}\n            onPress={\n              this.props.onPress\n                ? this.props.onPress\n                : () => console.log('** CrossButton press **')\n            }\n            mode={mode}\n          >\n            {this.props.title}\n          </Button>\n        )}\n      </View>\n    );\n  }\n}\n\nexport default CrossButton;\n"],"version":3}