Skip to content

Commit

Permalink
fix: typing issues in sample app (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshvai committed Jan 31, 2023
1 parent c5bee16 commit e2d34be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/SampleApp/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const DrawerNavigatorWrapper: React.FC<{
<Chat<StreamChatGenerics>
client={chatClient}
enableOfflineSupport
// @ts-expect-error
ImageComponent={FastImage}
>
<AppOverlayProvider>
Expand Down
8 changes: 5 additions & 3 deletions examples/SampleApp/src/context/AppOverlayProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import { BottomSheetOverlayProvider } from './BottomSheetOverlayContext';
import { ChannelInfoOverlayProvider } from './ChannelInfoOverlayContext';
import { UserInfoOverlayProvider } from './UserInfoOverlayContext';

export const AppOverlayProvider: React.FC<{
value?: Partial<AppOverlayContextValue>;
}> = (props) => {
export const AppOverlayProvider = (
props: React.PropsWithChildren<{
value?: Partial<AppOverlayContextValue>;
}>,
) => {
const { children, value } = props;

const [overlay, setOverlay] = useState(value?.overlay || 'none');
Expand Down
7 changes: 4 additions & 3 deletions examples/SampleApp/src/context/UserSearchContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export type UserSearchContextValue = PaginatedUsers;

export const UserSearchContext = React.createContext({} as UserSearchContextValue);

export const UserSearchProvider: React.FC<{
value?: UserSearchContextValue;
}> = ({ children, value }) => {
export const UserSearchProvider = (
props: React.PropsWithChildren<{ value?: UserSearchContextValue }>,
) => {
const { children, value } = props;
const paginatedUsers = usePaginatedUsers();

const userSearchContext = { ...paginatedUsers, ...value };
Expand Down

0 comments on commit e2d34be

Please sign in to comment.