From 434c1ac3d99f33f39f4d87031287a5cc210463ab Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 8 Mar 2024 09:50:25 +0530 Subject: [PATCH 1/3] Change intent URL --- App.tsx | 2 +- android/app/src/main/AndroidManifest.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/App.tsx b/App.tsx index 118e126..a9a1022 100644 --- a/App.tsx +++ b/App.tsx @@ -90,7 +90,7 @@ const App = (): React.JSX.Element => { }); const linking = { - prefixes: ['https://www.laconic-wallet.com'], + prefixes: ['https://wallet.laconic.com'], config: { screens: { SignRequest: { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fa040e2..2158ddf 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -26,9 +26,9 @@ + android:scheme="https"/> -- 2.45.2 From 9c8f8b94dd3c5d9a03c87d564b34723df2982ea9 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 8 Mar 2024 10:37:22 +0530 Subject: [PATCH 2/3] Move navigation to index.js --- App.tsx | 28 +++++++++++----------------- index.js | 15 ++++++++++++++- utils/RootNavigation.ts | 14 -------------- 3 files changed, 25 insertions(+), 32 deletions(-) delete mode 100644 utils/RootNavigation.ts diff --git a/App.tsx b/App.tsx index a9a1022..8f77788 100644 --- a/App.tsx +++ b/App.tsx @@ -2,8 +2,11 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { Snackbar } from 'react-native-paper'; import { SignClientTypes } from '@walletconnect/types'; -import { NavigationContainer } from '@react-navigation/native'; -import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { useNavigation } from '@react-navigation/native'; +import { + NativeStackNavigationProp, + createNativeStackNavigator, +} from '@react-navigation/native-stack'; import SignMessage from './components/SignMessage'; import HomeScreen from './components/HomeScreen'; @@ -18,7 +21,6 @@ import useInitialization, { import { EIP155_SIGNING_METHODS } from './utils/wallet-connect/EIP155Lib'; import { useAccounts } from './context/AccountsContext'; import { getSignParamsMessage } from './utils/wallet-connect/Helpers'; -import { navigationRef, navigateTo } from './utils/RootNavigation'; import { useRequests } from './context/RequestContext'; const Stack = createNativeStackNavigator(); @@ -26,6 +28,9 @@ const Stack = createNativeStackNavigator(); const App = (): React.JSX.Element => { useInitialization(); + const navigation = + useNavigation>(); + const { accounts } = useAccounts(); const { requestSession, setRequestSession } = useRequests(); @@ -65,7 +70,7 @@ const App = (): React.JSX.Element => { case EIP155_SIGNING_METHODS.PERSONAL_SIGN: setRequestSession(requestSessionData); if (address && message) { - navigateTo('SignRequest', { + navigation.navigate('SignRequest', { network: 'eth', address, message, @@ -89,19 +94,8 @@ const App = (): React.JSX.Element => { //TODO: Investigate dependencies }); - const linking = { - prefixes: ['https://wallet.laconic.com'], - config: { - screens: { - SignRequest: { - path: 'sign/:network/:address/:message', - }, - }, - }, - }; - return ( - + <> { }}> Session approved - + ); }; diff --git a/index.js b/index.js index d9007a3..e5b710f 100644 --- a/index.js +++ b/index.js @@ -7,13 +7,26 @@ import App from './App'; import { AccountsProvider } from './context/AccountsContext'; import { RequestProvider } from './context/RequestContext'; import { name as appName } from './app.json'; +import { NavigationContainer } from '@react-navigation/native'; export default function Main() { + const linking = { + prefixes: ['https://wallet.laconic.com'], + config: { + screens: { + SignRequest: { + path: 'sign/:network/:address/:message', + }, + }, + }, + }; return ( - + + + diff --git a/utils/RootNavigation.ts b/utils/RootNavigation.ts deleted file mode 100644 index 10b50c5..0000000 --- a/utils/RootNavigation.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - CommonActions, - createNavigationContainerRef, -} from '@react-navigation/native'; - -import { StackParamsList } from '../types'; - -export const navigationRef = createNavigationContainerRef(); - -export function navigateTo(routeName: string, params?: object) { - if (navigationRef.isReady()) { - navigationRef.dispatch(CommonActions.navigate(routeName, params)); - } -} -- 2.45.2 From 2588ceb99c8c04996771fc5bde577753a877283c Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 8 Mar 2024 11:41:06 +0530 Subject: [PATCH 3/3] Fix import order --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e5b710f..95dc0f7 100644 --- a/index.js +++ b/index.js @@ -3,11 +3,12 @@ import 'text-encoding-polyfill'; import { AppRegistry } from 'react-native'; import { PaperProvider } from 'react-native-paper'; +import { NavigationContainer } from '@react-navigation/native'; + import App from './App'; import { AccountsProvider } from './context/AccountsContext'; import { RequestProvider } from './context/RequestContext'; import { name as appName } from './app.json'; -import { NavigationContainer } from '@react-navigation/native'; export default function Main() { const linking = { -- 2.45.2