UNPKG

@nexara/nativeflow

Version:

Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.

43 lines (42 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _index = require("../StyledComponents/index.js"); var _reactNative = require("react-native"); var _react = require("react"); var _jsxRuntime = require("react/jsx-runtime"); const Link = ({ title = '', href, textVariant = 'h5', style }) => { const onUserPress = (0, _react.useCallback)(async () => { const supported = await _reactNative.Linking.canOpenURL(href); if (supported) { await _reactNative.Linking.openURL(href); } }, [href]); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, { onPress: onUserPress, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StyledText, { variant: textVariant, color: "#0000FF", style: [STYLES.TEXT, style], children: title }) }) }); }; var _default = exports.default = Link; const STYLES = _reactNative.StyleSheet.create({ TEXT: { borderBottomColor: '#0000FF', borderBottomWidth: 0.8, alignSelf: 'flex-start' } }); //# sourceMappingURL=Link.js.map