* docs(react-native): create the basic expo project * docs(react-native): cross-platform Apple social sign-in * docs(react-native): cross-platform Google social sign-in * docs(react-native): fix typos * docs(react-native): remove wrong entry in the `Connection` component * Correct typos * Prettier * Draft * Draft * docs(react-native): use kebab-case file naming convention in Expo guide - use kebab-case file naming convention in Expo guide - add trailing semicolon to align with the standard Expo template conventions * docs(react-native): use kebab-case file naming convention in Expo social auth example * docs(react-native): update the packages of the Expo social auth example * Fix * Draft * Changes * Correct log message --------- Co-authored-by: Chris Chinchilla <chris.ward@supabase.io> Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
25 lines
713 B
TypeScript
25 lines
713 B
TypeScript
import { Href, Link } from 'expo-router';
|
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
import { type ComponentProps } from 'react';
|
|
import { Platform } from 'react-native';
|
|
|
|
type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: Href & string };
|
|
|
|
export function ExternalLink({ href, ...rest }: Props) {
|
|
return (
|
|
<Link
|
|
target="_blank"
|
|
{...rest}
|
|
href={href}
|
|
onPress={async (event) => {
|
|
if (Platform.OS !== 'web') {
|
|
// Prevent the default behavior of linking to the default browser on native.
|
|
event.preventDefault();
|
|
// Open the link in an in-app browser.
|
|
await openBrowserAsync(href);
|
|
}
|
|
}}
|
|
/>
|
|
);
|
|
}
|