@100mslive/react-native-room-kit
Version:
100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.
49 lines • 1.47 kB
JavaScript
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from 'react';
import { Platform, Pressable, StyleSheet, Text, View } from 'react-native';
import { COLORS } from '../../utils/theme';
export function MenuItem({
children,
disabled = false,
disabledTextColor = COLORS.TEXT.DISABLED,
onPress,
pressColor = COLORS.TEXT.MEDIUM_EMPHASIS,
style,
textStyle,
...props
}) {
return /*#__PURE__*/React.createElement(Pressable, _extends({
disabled: disabled,
style: ({
pressed
}) => ({
backgroundColor: Platform.OS !== 'android' && pressed ? pressColor : undefined
}),
android_ripple: {
color: pressColor
},
onPress: onPress
}, props), /*#__PURE__*/React.createElement(View, {
style: [styles.container, style]
}, /*#__PURE__*/React.createElement(Text, {
numberOfLines: 1,
style: [styles.title, disabled && {
color: disabledTextColor
}, textStyle]
}, children)));
}
const styles = StyleSheet.create({
container: {
height: 48,
justifyContent: 'center',
maxWidth: 248,
minWidth: 124
},
title: {
fontSize: 14,
fontWeight: '400',
paddingHorizontal: 16,
textAlign: 'left'
}
});
//# sourceMappingURL=MenuItem.js.map