-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add expo 51 support for expo messaging app. (#2574)
* fix: issues with expo-media-library in expo 51 * chore: change expo-media-library version * chore: change expo-media-library version * chore: change expo-media-library version * fix: unable to upload clicked image on expo 51 using expo-image-picker * fix: update deps * fix: expo-media-library issue
- Loading branch information
Showing
5 changed files
with
1,196 additions
and
1,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export const STREAM_API_KEY = 'q95x9hkbyd6p'; | ||
export const userToken = | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicm9uIn0.eRVjxLvd4aqCEHY_JRa97g6k7WpHEhxL7Z4K4yTot1c'; | ||
|
||
export const user = { | ||
id: 'ron', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,33 @@ | ||
import { PropsWithChildren, createContext, useContext, useState } from "react"; | ||
import { StreamChatGenerics } from "../types"; | ||
import { Channel as ChannelType } from "stream-chat"; | ||
import { ThreadContextValue } from "stream-chat-expo"; | ||
import { PropsWithChildren, createContext, useContext, useState } from 'react'; | ||
import { StreamChatGenerics } from '../types'; | ||
import { Channel as ChannelType } from 'stream-chat'; | ||
import { ThreadContextValue } from 'stream-chat-expo'; | ||
|
||
export type AppContextType = { | ||
channel: ChannelType<StreamChatGenerics> | undefined; | ||
setChannel: React.Dispatch< | ||
React.SetStateAction<ChannelType<StreamChatGenerics> | undefined> | ||
>; | ||
setThread: React.Dispatch< | ||
React.SetStateAction< | ||
ThreadContextValue<StreamChatGenerics>["thread"] | undefined | ||
> | ||
>; | ||
thread: ThreadContextValue<StreamChatGenerics>["thread"] | undefined; | ||
channel: ChannelType<StreamChatGenerics> | undefined; | ||
setChannel: React.Dispatch<React.SetStateAction<ChannelType<StreamChatGenerics> | undefined>>; | ||
setThread: React.Dispatch< | ||
React.SetStateAction<ThreadContextValue<StreamChatGenerics>['thread'] | undefined> | ||
>; | ||
thread: ThreadContextValue<StreamChatGenerics>['thread'] | undefined; | ||
}; | ||
|
||
export const AppContext = createContext<AppContextType>({ | ||
channel: undefined, | ||
setChannel: undefined, | ||
setThread: undefined, | ||
thread: undefined, | ||
channel: undefined, | ||
setChannel: undefined, | ||
setThread: undefined, | ||
thread: undefined, | ||
}); | ||
|
||
export const AppProvider = ({ children }: PropsWithChildren) => { | ||
const [channel, setChannel] = useState< | ||
ChannelType<StreamChatGenerics> | undefined | ||
>(undefined); | ||
const [thread, setThread] = useState< | ||
ThreadContextValue<StreamChatGenerics>["thread"] | undefined | ||
>(undefined); | ||
const [channel, setChannel] = useState<ChannelType<StreamChatGenerics> | undefined>(undefined); | ||
const [thread, setThread] = useState< | ||
ThreadContextValue<StreamChatGenerics>['thread'] | undefined | ||
>(undefined); | ||
|
||
return ( | ||
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}> | ||
{children} | ||
</AppContext.Provider> | ||
); | ||
return ( | ||
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}> | ||
{children} | ||
</AppContext.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.