@cobuildlab/8base-chat
Version:
Chat component that uses 8base
45 lines (44 loc) • 1.25 kB
TypeScript
import './styles/global.css';
import React from 'react';
import { IChatContext } from './context';
import { IUser, SectionsConfig } from './types';
export interface IChatProps {
currentUser: IUser;
uri: string;
authToken: string;
workspaceId: string;
maxTabsCount: number;
top: string;
isSidebarVisible: boolean;
sections: SectionsConfig;
onChangeSidebar?: IChatContext['setSidebarVisibility'];
usersFilter?: {};
channelMembersFilter?: {};
}
export interface IChatState extends Pick<IChatContext, 'openedChannel' | 'tabs'> {
}
declare class Chat extends React.Component<IChatProps, IChatState> {
static defaultProps: {
top: string;
maxTabsCount: number;
isSidebarVisible: boolean;
sections: {
channels: boolean;
dm: boolean;
contacts: boolean;
};
};
private client;
constructor(props: IChatProps);
componentDidMount(): void;
render(): JSX.Element;
private getInlineStyles;
private getTabInlineStyles;
private getContextValue;
private setChannel;
private setTabs;
private subscribeToMessages;
private updateChannelMessages;
private checkAndMarkUnread;
}
export default Chat;