UNPKG

@uiw/react-native

Version:
41 lines 1.37 kB
import React from 'react'; import { View, Dimensions, TouchableHighlight, StyleSheet, useColorScheme } from 'react-native'; import { useTheme } from '@shopify/restyle'; import Text from '../Typography/Text'; let MainWidth = Dimensions.get('window').width; export default function ActionSheetItem(props) { const theme = useTheme(); const colorScheme = useColorScheme(); const { onPress = () => {}, activeOpacity = 1, underlayColor = colorScheme === 'light' ? theme.colors.background : '#1A1A22', containerStyle, textStyle, disabled = false, children } = props; return <TouchableHighlight style={styles.touchableHighlightItem} activeOpacity={activeOpacity} underlayColor={underlayColor} onPress={onPress} disabled={disabled}> <View style={StyleSheet.flatten([styles.actionSheetItem, containerStyle])}> <Text style={StyleSheet.flatten([styles.actionSheetItemText, textStyle])}>{children}</Text> </View> </TouchableHighlight>; } const styles = StyleSheet.create({ actionSheetItem: { width: MainWidth, height: 60, justifyContent: 'center', alignItems: 'center' }, actionSheetItemText: { fontSize: 20, fontWeight: '400' }, touchableHighlightItem: { borderTopRightRadius: 12, borderTopLeftRadius: 12, borderBottomLeftRadius: 12, borderBottomRightRadius: 12 } });