Skip to content

Commit

Permalink
Added in app browsers for Signup and Delete;
Browse files Browse the repository at this point in the history
  • Loading branch information
stef-coenen committed Dec 21, 2023
1 parent 5229cfe commit f4c3139
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/mobile/src/pages/login-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,14 @@ const LoginComponent = () => {
[
{
text: 'Homebase.id',
onPress: () => Linking.openURL('https://homebase.id'),
onPress: async () => {
if (await InAppBrowser.isAvailable())
await InAppBrowser.open('https://homebase.id', {
enableUrlBarHiding: false,
enableDefaultShare: false,
});
else Linking.openURL('https://homebase.id');
},
},
{
text: 'Cancel',
Expand Down
11 changes: 9 additions & 2 deletions packages/mobile/src/pages/settings-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import useDbSync from '../hooks/db/useDbSync';
import codePush from 'react-native-code-push';
import useAuth from '../hooks/auth/useAuth';
import { useKeyValueStorage } from '../hooks/auth/useEncryptedStorage';
import InAppBrowser from 'react-native-inappbrowser-reborn';

type SettingsProps = NativeStackScreenProps<SettingsStackParamList, 'Profile'>;

Expand Down Expand Up @@ -155,8 +156,14 @@ const SettingsPage = (_props: SettingsProps) => {
[
{
text: 'Open owner console',
onPress: () =>
Linking.openURL(`https://${getIdentity()}/owner/settings/delete`),
onPress: async () => {
if (await InAppBrowser.isAvailable())
await InAppBrowser.open(`https://${getIdentity()}/owner/settings/delete`, {
enableUrlBarHiding: false,
enableDefaultShare: false,
});
else Linking.openURL(`https://${getIdentity()}/owner/settings/delete`);
},
},
{
text: 'Cancel',
Expand Down

0 comments on commit f4c3139

Please sign in to comment.