@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
35 lines (34 loc) • 829 B
JavaScript
;
import { useCallback } from "react";
import { StyledText } from "../StyledComponents/index.js";
import { Linking, StyleSheet } from "react-native";
import { jsx as _jsx } from "react/jsx-runtime";
const Link = ({
title = 'Link',
href,
style,
...rest
}) => {
const onUserPress = useCallback(async () => {
const supported = await Linking.canOpenURL(href);
if (supported) {
await Linking.openURL(href);
}
}, [href]);
return /*#__PURE__*/_jsx(StyledText, {
color: "#0000FF",
style: [STYLES.TEXT, style],
onPress: onUserPress,
...rest,
children: title
});
};
export default Link;
const STYLES = StyleSheet.create({
TEXT: {
// borderBottomColor: '#0000FF',
// borderBottomWidth: 0.8,
// alignSelf: 'flex-start',
}
});
//# sourceMappingURL=Link.js.map