2021-10-28 17:48:53 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-02-28 18:00:47 +00:00
|
|
|
import { IUserMention, IUserChannel } from '../interfaces';
|
2021-10-28 17:48:53 +00:00
|
|
|
|
|
|
|
interface IMarkdownContext {
|
2022-02-28 18:00:47 +00:00
|
|
|
mentions?: IUserMention[];
|
|
|
|
channels?: IUserChannel[];
|
|
|
|
useRealName?: boolean;
|
|
|
|
username?: string;
|
|
|
|
baseUrl?: string;
|
|
|
|
navToRoomInfo?: Function;
|
2021-10-28 17:48:53 +00:00
|
|
|
getCustomEmoji?: Function;
|
|
|
|
onLinkPress?: Function;
|
|
|
|
}
|
|
|
|
|
|
|
|
const defaultState = {
|
|
|
|
mentions: [],
|
|
|
|
channels: [],
|
|
|
|
useRealName: false,
|
|
|
|
username: '',
|
|
|
|
baseUrl: '',
|
|
|
|
navToRoomInfo: () => {}
|
|
|
|
};
|
|
|
|
|
|
|
|
const MarkdownContext = React.createContext<IMarkdownContext>(defaultState);
|
|
|
|
export default MarkdownContext;
|