import React from 'react'; import { StyleSheet, TouchableOpacity, ViewStyle } from 'react-native'; import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons' import { StyledQuantityControl } from './styles'; import { OText } from '../shared'; import { useTheme } from 'styled-components/native'; const QuantityControl = (props: Props) => { const theme = useTheme() const styles = StyleSheet.create({ quantityControlButton: { color: theme.colors.black, }, quantityControlButtonBorder: { borderWidth: 1, borderColor: theme.colors.black, }, quantityControlButtonDisabled: { opacity: 0.5, }, }); return ( {(!!props?.onDelete && props.val <= 1) ? : } {props.val.toString()} ); } interface Props { onDecremet?: () => void; onIncrement?: () => void; onDelete?: () => void; style?: ViewStyle; val: number; } export default QuantityControl;