import React from "react"; import { Pressable, ViewStyle, PressableProps } from "react-native"; import { COMPONENT_TYPES, createActionProp } from "../core/component-types"; type Props = { disabled?: boolean; children: React.ReactNode; style?: ViewStyle; onPress?: () => void; } & PressableProps; export default function Touchable({ children, disabled, onPress, style, ...props }: Props) { return ( { return [ { opacity: pressed || disabled ? 0.75 : 1, }, style, ]; }} {...props} > {children} ); } export const SEED_DATA = { name: "Touchable", tag: "Touchable", description: "Simple button with no styles", category: COMPONENT_TYPES.button, layout: {}, props: { onPress: createActionProp(), }, };