import React, { useState } from 'react'; import { StyleSheet, View, TouchableHighlight, StyleProp, ViewStyle, } from 'react-native'; import type { Theme, Sizes } from '../../types'; import { withTheme } from '../../core/theming'; import { blockSizes, builtTextStyles } from '../../styles/styles'; import { Text } from '../..'; // TODO: add icon prop type Props = { disabled?: boolean; onPress: () => void; primary?: boolean; size?: Sizes; style?: StyleProp; theme: Theme; title: string; }; export const Item = ({ disabled, onPress, primary = false, size = 'md', style, theme, title, ...rest }: Props) => { const [isPressed, setIsPressed] = useState(false); const textStyles = builtTextStyles(theme); return ( setIsPressed(false)} onShowUnderlay={() => setIsPressed(true)} underlayColor='none' // TODO: which accessibilityRole put in here? accessibilityRole='menuitem' accessibilityState={{ disabled }} > {title} ); }; const styles = StyleSheet.create({ item: { position: 'relative', }, button: { flex: 1, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 8, }, content: { alignSelf: 'flex-start', }, }); export default withTheme(Item);