aboutsummaryrefslogtreecommitdiff
path: root/src/App.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-09 17:15:29 -0400
committerIvan Chen <ivan@tagg.id>2021-04-09 17:15:29 -0400
commit347e9e450268e4897b8dd241721b84945d9e2ec9 (patch)
tree58334be3724398c886365e99901e4442f5657172 /src/App.tsx
parent097b515066f1a0c38cb7fb69cf78b16b945594e5 (diff)
parent3ec56863bfdd47b2ee8d0f0fe5a45be779508660 (diff)
Merge branch 'master' into tma756-bugfix-onpress-tagg-on-sp
# Conflicts: # src/components/taggs/TaggsBar.tsx
Diffstat (limited to 'src/App.tsx')
-rw-r--r--src/App.tsx34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/App.tsx b/src/App.tsx
index ea3617dc..b8d64461 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,18 +1,48 @@
import {NavigationContainer} from '@react-navigation/native';
-import React from 'react';
+import React, {useState} from 'react';
import {Provider} from 'react-redux';
+import {StreamChat} from 'stream-chat';
+import {OverlayProvider} from 'stream-chat-react-native';
+import {STREAM_CHAT_API} from './constants';
import {navigationRef} from './RootNavigation';
import Routes from './routes';
import store from './store/configureStore';
+import {
+ ChannelGroupedType,
+ ChatContextType,
+ LocalAttachmentType,
+ LocalChannelType,
+ LocalCommandType,
+ LocalEventType,
+ LocalMessageType,
+ LocalResponseType,
+ LocalUserType,
+} from './types';
+
+export const ChatContext = React.createContext({} as ChatContextType);
const App = () => {
+ const [channel, setChannel] = useState<ChannelGroupedType>();
+ const chatClient = StreamChat.getInstance<
+ LocalAttachmentType,
+ LocalChannelType,
+ LocalCommandType,
+ LocalEventType,
+ LocalMessageType,
+ LocalResponseType,
+ LocalUserType
+ >(STREAM_CHAT_API);
return (
/**
* This is the provider from the redux store, it acts as the root provider for our application
*/
<Provider store={store}>
<NavigationContainer ref={navigationRef}>
- <Routes />
+ <ChatContext.Provider value={{channel, setChannel, chatClient}}>
+ <OverlayProvider>
+ <Routes />
+ </OverlayProvider>
+ </ChatContext.Provider>
</NavigationContainer>
</Provider>
);