UNPKG

react95-native

Version:

Refreshed Windows 95 style UI components for your React Native app

49 lines (46 loc) 1.54 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import { StyleSheet, Animated, TouchableWithoutFeedback } from 'react-native'; import { withTheme } from '../../core/theming'; import shadow from '../../styles/shadow'; import { Text } from '../..'; const Label = ({ accessible, children, elevation = 0, onLongPress, onPress, radius = 4, style = {}, theme, ...rest }) => { return ( /*#__PURE__*/ // TODO: fix this TS error // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore React.createElement(Animated.View, _extends({}, rest, { style: [styles.container, { backgroundColor: theme.tooltip, borderRadius: radius }, shadow(elevation), style] }), /*#__PURE__*/React.createElement(TouchableWithoutFeedback, { delayPressIn: 0, disabled: !(onPress || onLongPress), onLongPress: onLongPress, onPress: onPress, accessible: accessible }, /*#__PURE__*/React.createElement(Text, null, children))) ); }; const styles = StyleSheet.create({ container: { position: 'relative', borderWidth: 2, paddingHorizontal: 12, paddingVertical: 6 } }); export default withTheme(Label); //# sourceMappingURL=Label.js.map