UNPKG

react95-native

Version:

Refreshed Windows 95 style UI components for your React Native app

52 lines (48 loc) 1.63 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); } /* eslint-disable react/jsx-props-no-spreading */ import * as React from 'react'; import { StyleSheet, TouchableWithoutFeedback, View } from 'react-native'; import { withTheme } from '../../core/theming'; import { Text } from '../..'; const AppbarContent = ({ // titleRef, onPress, style, subtitle, subtitleStyle, theme, title, titleStyle, ...rest }) => { return /*#__PURE__*/React.createElement(View, _extends({ style: [styles.container, style] }, rest), /*#__PURE__*/React.createElement(TouchableWithoutFeedback, { onPress: onPress, disabled: !onPress }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, { theme: theme // ref={titleRef} , style: [styles.title, titleStyle], accessibilityTraits: "header" }, title), subtitle ? /*#__PURE__*/React.createElement(Text, { theme: theme, secondary: true, style: [styles.subtitle, subtitleStyle] }, subtitle) : null))); }; // TODO: attach displayName to every component? AppbarContent.displayName = 'Appbar.Content'; const styles = StyleSheet.create({ container: { flex: 1, paddingHorizontal: 12 }, title: { fontSize: 16 }, subtitle: { fontSize: 12 } }); export default withTheme(AppbarContent); //# sourceMappingURL=AppBarContent.js.map