forked from cerc-io/laconic-wallet
* Add state for selected network * Make review changes * Add cosmos signature * Explicit check for cosmos * Add dummy method for generating wallet * Remove logic from component * Add dummy sign method * Change network state values * Use separate file for types * Add default case to switch * Use consistent method names --------- Co-authored-by: Adw8 <adwait@deepstacksoft.com>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { View } from 'react-native';
|
|
import { Button, TextInput } from 'react-native-paper';
|
|
import React, { useState } from 'react';
|
|
|
|
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
|
|
import { StackParamsList } from '../types';
|
|
import { signMessage } from '../utils';
|
|
|
|
type SignProps = NativeStackScreenProps<StackParamsList, 'SignMessage'>;
|
|
|
|
const SignMessage = ({ route }: SignProps) => {
|
|
const network = route.params?.selectedNetwork;
|
|
|
|
const [message, setMessage] = useState<string>('');
|
|
|
|
return (
|
|
<View style={{ marginTop: 30, paddingHorizontal: 48 }}>
|
|
<TextInput
|
|
mode="outlined"
|
|
placeholder="Enter your message"
|
|
onChangeText={text => setMessage(text)}
|
|
value={message}
|
|
/>
|
|
<View style={{ marginTop: 20, width: 150, alignSelf: 'center' }}>
|
|
<Button
|
|
mode="contained"
|
|
onPress={() => {
|
|
network && signMessage(network, 0, message);
|
|
}}>
|
|
Sign
|
|
</Button>
|
|
</View>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default SignMessage;
|