UNPKG

react-native-xenon

Version:

A powerful in-app debugging tool for React Native.

64 lines (63 loc) 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = DebuggerHeaderItem; var _reactNative = require("react-native"); var _colors = _interopRequireDefault(require("../../../theme/colors")); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function DebuggerHeaderItem({ content, isLabel, isActive, activeColor = _colors.default.red, onPress }) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { onPress: onPress, activeOpacity: 0.8, style: [styles.container, isLabel ? isActive ? styles.activeLabelContainer : styles.labelContainer : isActive ? { backgroundColor: activeColor } : undefined], children: typeof content === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.title, children: content }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, { source: content, style: styles.icon }) }); } const styles = _reactNative.StyleSheet.create({ container: { paddingVertical: 4, paddingHorizontal: 8, borderRadius: 4, backgroundColor: _colors.default.gray, borderWidth: 1, borderColor: 'transparent', justifyContent: 'center', alignItems: 'center' }, labelContainer: { backgroundColor: 'transparent' }, activeLabelContainer: { backgroundColor: 'transparent', borderWidth: 1, borderColor: _colors.default.black }, title: { fontSize: 14, lineHeight: 18, fontWeight: '600', color: _colors.default.black }, icon: { width: 18, height: 18, tintColor: _colors.default.black } }); //# sourceMappingURL=DebuggerHeaderItem.js.map