import React from 'react'; import {ActivityIndicator, StyleSheet, Text} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {useTracked} from '../../provider'; import {PressableButton} from '../PressableButton'; import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils'; const BUTTON_TYPES = { transparent: { primary: 'transparent', text: 'accent', selected: 'shade', }, gray: { primary: 'transparent', text: 'icon', selected: 'nav', }, accent: { primary: 'accent', text: 'white', selected: 'accent', }, inverted: { primary: 'bg', text: 'accent', selected: 'bg', }, }; export const Button = ({ height = 40, width = null, onPress = () => {}, loading = false, title = '', icon, fontSize = SIZE.sm, type = 'transparent', }) => { const [state] = useTracked(); const {colors} = state; return ( {loading && } {icon && !loading && ( )} {title} ); }; const styles = StyleSheet.create({ activityText: { fontSize: SIZE.sm, textAlign: 'center', }, activityContainer: { alignItems: 'center', justifyContent: 'center', }, buttonText: { fontFamily: WEIGHT.bold, color: 'white', fontSize: SIZE.md, marginLeft: 5, }, });