import React from 'react'; import { ActivityIndicator, StyleSheet, Text } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import { ph, pv, SIZE, WEIGHT } from '../../common/common'; import { useTracked } from '../../provider'; import { PressableButton } from '../PressableButton'; export const Button = ({ height = 40, width = '48%', onPress = () => {}, loading = false, grayed, title = '', icon, color = 'accent', key }) => { const [state, dispatch] = useTracked(); const {colors, tags, premiumUser} = state; const usedColor = 'accent' ? colors.accent : color; return ( {loading ? : null} {icon && !loading ? ( ) : null} {title} ); }; const styles = StyleSheet.create({ activityText: { fontSize: SIZE.sm, textAlign: 'center', }, activityContainer: { alignItems: 'center', justifyContent: 'center', }, buttonText: { fontFamily: WEIGHT.medium, color: 'white', fontSize: SIZE.sm, marginLeft: 5, }, });