import { Feather } from '@expo/vector-icons' import React from 'react' import { Pressable, StyleSheet, Text } from 'react-native' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' type PropsBase = { onPress: () => void disabled?: boolean buttonSize?: 'S' | 'M' } export interface PropsText extends PropsBase { text: string icon?: any size?: 'S' | 'M' | 'L' } export interface PropsIcon extends PropsBase { text?: string icon: any size?: 'S' | 'M' | 'L' } const ButtonRow: React.FC = ({ onPress, disabled = false, buttonSize = 'M', text, icon, size = 'M' }) => { const { theme } = useTheme() return ( {icon ? ( ) : ( {text} )} ) } const styles = StyleSheet.create({ button: { paddingLeft: StyleConstants.Spacing.M, paddingRight: StyleConstants.Spacing.M, borderWidth: 1, borderRadius: 100 }, text: { textAlign: 'center' } }) export default React.memo(ButtonRow, (prev, next) => { let skipUpdate = true skipUpdate = prev.disabled === next.disabled return skipUpdate })