react-native-xenon
Version:
A powerful in-app debugging tool for React Native.
56 lines (55 loc) • 1.44 kB
JavaScript
"use strict";
import { StyleSheet, Text } from 'react-native';
import colors from "../../../theme/colors.js";
import Icon from "../common/Icon.js";
import Touchable from "../common/Touchable.js";
import { jsx as _jsx } from "react/jsx-runtime";
export default function DebuggerHeaderItem({
content,
isLabel,
isActive,
activeColor = colors.red,
onPress
}) {
return /*#__PURE__*/_jsx(Touchable, {
onPress: onPress,
style: [styles.container, isLabel ? isActive ? styles.activeLabelContainer : styles.labelContainer : isActive ? {
backgroundColor: activeColor
} : undefined],
children: typeof content === 'string' ? /*#__PURE__*/_jsx(Text, {
style: styles.title,
children: content
}) : /*#__PURE__*/_jsx(Icon, {
source: content,
size: 18
})
});
}
const styles = StyleSheet.create({
container: {
paddingVertical: 4,
paddingHorizontal: 8,
borderRadius: 4,
backgroundColor: colors.gray,
borderWidth: 1,
borderColor: 'transparent',
justifyContent: 'center',
alignItems: 'center'
},
labelContainer: {
backgroundColor: 'transparent'
},
activeLabelContainer: {
backgroundColor: 'transparent',
borderWidth: 1,
borderColor: colors.black
},
title: {
fontSize: 14,
lineHeight: 18,
fontWeight: '600',
color: colors.black,
fontVariant: ['tabular-nums']
}
});
//# sourceMappingURL=DebuggerHeaderItem.js.map