laconic-wallet/App.tsx
Adwait Gharpure 7db0edce75
Allow incoming signature requests from intents (#32)
* Add url scheme and linking

* Pass account to sign request page

* Provide functionality for accepting or rejecting requests

* Load account state before handling url

* Refactor code

* Make intent work when app is cleared from recents

* Fix bug to populate data from intents

* Fix bug to update data on subsequent requests

* Pass correct network to sign messages from cosmos account

* Fix bug to populate data for incoming intent

* Allow spaces in url

* Bad signature page

* Review changes

* Change page heading

* Use correct regex

* Clean up code

* Use https in url

* Set state properly

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-02-28 19:37:26 +05:30

67 lines
1.6 KiB
TypeScript

import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import SignMessage from './components/SignMessage';
import HomeScreen from './components/HomeScreen';
import SignRequest from './components/SignRequest';
import InvalidPath from './components/InvalidPath';
import { StackParamsList } from './types';
const Stack = createNativeStackNavigator<StackParamsList>();
const App = (): React.JSX.Element => {
const linking = {
prefixes: ['https://www.laconic-wallet.com'],
config: {
screens: {
SignRequest: {
path: 'sign/:network/:address/:message',
},
},
},
};
return (
<NavigationContainer linking={linking}>
<Stack.Navigator>
<Stack.Screen
name="Laconic"
component={HomeScreen}
options={{
title: 'Laconic Wallet',
headerBackVisible: false,
}}
/>
<Stack.Screen
name="SignMessage"
component={SignMessage}
options={{
title: 'Sign Message',
}}
initialParams={{ selectedNetwork: 'Ethereum' }}
/>
<Stack.Screen
name="SignRequest"
component={SignRequest}
options={{
title: 'Sign Message?',
}}
/>
<Stack.Screen
name="InvalidPath"
component={InvalidPath}
options={{
title: 'Bad Request',
headerBackVisible: false,
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;