forked from cerc-io/laconic-wallet
* Add page for scanning qr code * Refactor code * Ask for permission to use camera * Change Qr to QR * Seperate imports * QR instead of Qr --------- Co-authored-by: Adw8 <adwait@deepstacksoft.com>
75 lines
1.8 KiB
TypeScript
75 lines
1.8 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 QRScanner from './components/QRScanner';
|
|
|
|
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.Screen
|
|
name="QRScanner"
|
|
component={QRScanner}
|
|
options={{
|
|
title: 'Connect Wallet',
|
|
}}
|
|
/>
|
|
</Stack.Navigator>
|
|
</NavigationContainer>
|
|
);
|
|
};
|
|
|
|
export default App;
|