minor govno

This commit is contained in:
2023-10-13 05:40:03 +03:00
parent fd74b5b79a
commit 67258c8114
17 changed files with 329 additions and 23 deletions

View File

@@ -0,0 +1,27 @@
import React, {ReactNode} from 'react';
import {TouchableOpacity, Linking} from 'react-native';
type HyperlinkProps = {
url: string;
children: ReactNode;
};
const Hyperlink: React.FC<HyperlinkProps> = ({url, children}) => {
const handlePress = () => {
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url);
} else {
console.log("Don't know how to open URI: " + url);
}
});
};
return (
<TouchableOpacity onPress={handlePress}>
{children}
</TouchableOpacity>
);
};
export default Hyperlink;