UNPKG

react-native-gallery-preview

Version:

<div> <img align="right" height="720" src="example.gif"> </div>

33 lines (32 loc) 1.07 kB
"use strict"; import React from "react"; import { TextInput } from "react-native"; import Animated, { useAnimatedProps, useDerivedValue } from "react-native-reanimated"; import { jsx as _jsx } from "react/jsx-runtime"; const AnimatedTextInput = Animated.createAnimatedComponent(TextInput); export const ReText = props => { const { text, value: _providedValue, style } = { style: {}, ...props }; const providedValue = useDerivedValue(() => typeof _providedValue === "number" || typeof _providedValue === "boolean" ? _providedValue : typeof _providedValue.value === "number" ? _providedValue.value.toFixed(2) : _providedValue.value); const animatedProps = useAnimatedProps(() => { return { text: `${text}: ${providedValue.value}` }; }, [providedValue]); return /*#__PURE__*/_jsx(AnimatedTextInput, { underlineColorAndroid: "transparent", editable: false, value: `${text}: ${providedValue.value}`, style: style // @ts-ignore , animatedProps: animatedProps }); }; //# sourceMappingURL=ReText.js.map