UNPKG

@nexara/nativeflow

Version:

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

39 lines (38 loc) 1.01 kB
"use strict"; import { StyledText } from "../StyledComponents/index.js"; import { Linking, StyleSheet, TouchableOpacity } from "react-native"; import { useCallback } from "react"; import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; const Link = ({ title = '', href, textVariant = 'h5', style }) => { const onUserPress = useCallback(async () => { const supported = await Linking.canOpenURL(href); if (supported) { await Linking.openURL(href); } }, [href]); return /*#__PURE__*/_jsx(_Fragment, { children: /*#__PURE__*/_jsx(TouchableOpacity, { onPress: onUserPress, children: /*#__PURE__*/_jsx(StyledText, { variant: textVariant, color: "#0000FF", style: [STYLES.TEXT, style], children: title }) }) }); }; export default Link; const STYLES = StyleSheet.create({ TEXT: { borderBottomColor: '#0000FF', borderBottomWidth: 0.8, alignSelf: 'flex-start' } }); //# sourceMappingURL=Link.js.map