diff --git a/.gitignore b/.gitignore index 2423126..ac79306 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ buck-out/ # Ruby / CocoaPods /ios/Pods/ /vendor/bundle/ + +# Expo +.expo diff --git a/App.tsx b/App.tsx index e32d8cd..3c5d5b8 100644 --- a/App.tsx +++ b/App.tsx @@ -1,97 +1,58 @@ /** - * Sample React Native App - * https://github.com/facebook/react-native - * - * Generated with the TypeScript template - * https://github.com/react-native-community/react-native-template-typescript - * - * @format + * Example React Native App using XMTP. */ +import React, {memo} from 'react'; -import React from 'react'; -import { - Button, - Platform, - SafeAreaView, - ScrollView, - StatusBar, - StyleSheet, - Text, - useColorScheme, - View, -} from 'react-native'; - +// Polyfill necessary xmtp-js libraries for React Native. import './polyfills.js'; -import {Wallet} from 'ethers'; -import {utils as SecpUtils} from '@noble/secp256k1'; -import {Client} from '@xmtp/xmtp-js'; -import {Colors} from 'react-native/Libraries/NewAppScreen'; +import Home from './components/Home'; +import * as Linking from 'expo-linking'; +import {Text} from 'react-native'; +import {NavigationContainer} from '@react-navigation/native'; +import WalletConnectProvider, { + QrcodeModal, + RenderQrcodeModalProps, +} from '@walletconnect/react-native-dapp'; +import AsyncStorage from '@react-native-async-storage/async-storage'; -const App = () => { - const isDarkMode = useColorScheme() === 'dark'; +const APP_SCHEME = 'examplexmtp'; - const backgroundStyle = { - backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, +const prefix = Linking.createURL('/', {scheme: APP_SCHEME}); + +const App = () => { + const linking = { + prefixes: [prefix], }; - const account = new Wallet(SecpUtils.randomPrivateKey()); + const QRCodeComponent = (props: RenderQrcodeModalProps) => { + if (!props.visible) { + return null; + } + return ; + }; + const QRCodeModal = memo(QRCodeComponent); return ( - - - - - Example Chat App - {account.address} -