UNPKG

react-native-xenon

Version:

A powerful in-app debugging tool for React Native.

44 lines (43 loc) 1.15 kB
"use strict"; import { useContext } from 'react'; import { ScrollView, StyleSheet } from 'react-native'; import { MainContext } from "../../../contexts/index.js"; import { formatLogMessage, getConsoleTypeColor } from "../../../core/utils.js"; import colors from "../../../theme/colors.js"; import ShareableText from "../common/ShareableText.js"; import { jsx as _jsx } from "react/jsx-runtime"; export default function LogMessageDetails({ style, ref }) { const { debuggerState: { detailsData } } = useContext(MainContext); const item = detailsData?.data; return /*#__PURE__*/_jsx(ScrollView, { ref: ref, style: [styles.container, { backgroundColor: getConsoleTypeColor(item?.type ?? '') }, style], contentContainerStyle: styles.contentContainer, children: /*#__PURE__*/_jsx(ShareableText, { style: styles.text, children: formatLogMessage(item?.values ?? []) }) }); } const styles = StyleSheet.create({ container: { flex: 1 }, contentContainer: { padding: 8 }, text: { color: colors.black, fontSize: 14 } }); //# sourceMappingURL=LogMessageDetails.js.map