Rocket.Chat.ReactNative/app/views/RoomView/context.ts

22 lines
565 B
TypeScript

import { createContext, useContext } from 'react';
export type TMessageAction = 'reply' | 'quote' | 'edit' | 'react' | null;
export interface IRoomContext {
rid?: string;
t?: string;
tmid?: string;
sharing?: boolean;
action?: TMessageAction;
selectedMessages: string[];
editCancel?: () => void;
editRequest?: (message: any) => void;
onRemoveQuoteMessage?: (messageId: string) => void;
onSendMessage?: Function;
}
export const RoomContext = createContext<IRoomContext>({} as IRoomContext);
export const useRoomContext = () => useContext(RoomContext);