Skip to content

Commit

Permalink
Added thirdweb ConnectWallet button to LaunchScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Dec 11, 2023
1 parent 061baa8 commit e68b3d9
Show file tree
Hide file tree
Showing 5 changed files with 19,609 additions and 288 deletions.
134 changes: 75 additions & 59 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,84 @@ import LaunchScreen from './src/LaunchScreen'
import { Navigator } from './src/Navigation'
import TestScreen from './src/TestScreen'
import { XmtpContextProvider } from './src/XmtpContext'
import { ThirdwebProvider, walletConnect } from "@thirdweb-dev/react-native";

const queryClient = new QueryClient()
export default function App() {
return (
<QueryClientProvider client={queryClient}>
<XmtpContextProvider>
<NavigationContainer>
<Navigator.Navigator>
<Navigator.Screen
name="launch"
component={LaunchScreen}
options={{
title: 'XMTP RN Example',
headerStyle: {
backgroundColor: 'rgb(49 0 110)',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<Navigator.Screen
name="test"
component={TestScreen}
options={{ title: 'Unit Tests' }}
/>
<Navigator.Screen
name="home"
component={HomeScreen}
options={({ navigation }) => ({
title: 'My Conversations',
headerStyle: {
backgroundColor: 'rgb(49 0 110)',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
headerRight: () => (
<Button
onPress={() => navigation.navigate('conversationCreate')}
title="New"
color={Platform.OS === 'ios' ? '#fff' : 'rgb(49 0 110)'}
/>
),
})}
/>
<Navigator.Screen
name="conversation"
component={ConversationScreen}
options={{ title: 'Conversation' }}
initialParams={{ topic: '' }}
/>
<Navigator.Screen
name="conversationCreate"
component={ConversationCreateScreen}
options={{ title: 'New Conversation' }}
/>
</Navigator.Navigator>
</NavigationContainer>
</XmtpContextProvider>
</QueryClientProvider>
<ThirdwebProvider
activeChain={"ethereum"}
clientId={"<THIRD_WEB_CLIENT_ID_HERE>"}
dAppMeta={{
name: "XMTP Example",
description: "This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.",
logoUrl: "https://pbs.twimg.com/profile_images/1668323456935510016/2c_Ue8dF_400x400.jpg",
url: "https://github.com/xmtp/xmtp-react-native",
}}
supportedWallets={[
walletConnect({
recommended: true,
})
]}>
<QueryClientProvider client={queryClient}>
<XmtpContextProvider>
<NavigationContainer>
<Navigator.Navigator>
<Navigator.Screen
name="launch"
component={LaunchScreen}
options={{
title: 'XMTP RN Example',
headerStyle: {
backgroundColor: 'rgb(49 0 110)',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
/>
<Navigator.Screen
name="test"
component={TestScreen}
options={{ title: 'Unit Tests' }}
/>
<Navigator.Screen
name="home"
component={HomeScreen}
options={({ navigation }) => ({
title: 'My Conversations',
headerStyle: {
backgroundColor: 'rgb(49 0 110)',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
headerRight: () => (
<Button
onPress={() => navigation.navigate('conversationCreate')}
title="New"
color={Platform.OS === 'ios' ? '#fff' : 'rgb(49 0 110)'}
/>
),
})}
/>
<Navigator.Screen
name="conversation"
component={ConversationScreen}
options={{ title: 'Conversation' }}
initialParams={{ topic: '' }}
/>
<Navigator.Screen
name="conversationCreate"
component={ConversationCreateScreen}
options={{ title: 'New Conversation' }}
/>
</Navigator.Navigator>
</NavigationContainer>
</XmtpContextProvider>
</QueryClientProvider>
</ThirdwebProvider>
)
}
2 changes: 2 additions & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "@thirdweb-dev/react-native-compat";

import { registerRootComponent } from 'expo'

import App from './App'
Expand Down
Loading

0 comments on commit e68b3d9

Please sign in to comment.