1/** 2 * Copyright (c) 650 Industries. 3 * Copyright (c) Meta Platforms, Inc. and affiliates. 4 * 5 * This source code is licensed under the MIT license found in the 6 * LICENSE file in the root directory of this source tree. 7 */ 8import React, { useState } from 'react'; 9import { Platform, Pressable, View } from 'react-native'; 10import * as LogBoxStyle from './LogBoxStyle'; 11export function LogBoxButton(props) { 12 const [pressed, setPressed] = useState(false); 13 let backgroundColor = props.backgroundColor; 14 if (!backgroundColor) { 15 backgroundColor = { 16 default: LogBoxStyle.getBackgroundColor(0.95), 17 pressed: LogBoxStyle.getBackgroundColor(0.6), 18 }; 19 } 20 const content = (React.createElement(View, { style: [ 21 { 22 backgroundColor: pressed ? backgroundColor.pressed : backgroundColor.default, 23 ...Platform.select({ 24 web: { 25 cursor: 'pointer', 26 }, 27 }), 28 }, 29 props.style, 30 ] }, props.children)); 31 return props.onPress == null ? (content) : (React.createElement(Pressable, { hitSlop: props.hitSlop, onPress: props.onPress, onPressIn: () => setPressed(true), onPressOut: () => setPressed(false) }, content)); 32} 33//# sourceMappingURL=LogBoxButton.js.map