import React, { useState } from 'react'; import type { PropsWithChildren } from 'react'; import { Alert, Button, SafeAreaView, ScrollView, StatusBar, Text, TextInput, useColorScheme, View, } from 'react-native'; import { Colors } from 'react-native/Libraries/NewAppScreen'; import styles from './styles/stylesheet'; import { generateWallet, signMessage } from './utils'; type SectionProps = PropsWithChildren<{ title: string; }>; const Section = ({children, title}: SectionProps): React.JSX.Element => { const isDarkMode = useColorScheme() === 'dark'; return ( {title} {children} ); }; const App = (): React.JSX.Element => { const [message, setMessage] = useState(''); const [isWalletCreated, setIsWalletCreated] = useState(false); const createWallet = async () => { Alert.alert('Creating Wallet...'); await generateWallet(); setIsWalletCreated(true); }; const isDarkMode = useColorScheme() === 'dark'; const backgroundStyle = { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, }; return ( Laconic Wallet {isWalletCreated ? (
Wallet Created!
) : (
Click the button to generate the wallet