matrix-react-sdk
Version:
SDK for matrix.org using React
36 lines (35 loc) • 1.16 kB
TypeScript
import React from "react";
import { XOR } from "../../../@types/common";
import { NotificationState } from "../../../stores/notifications/NotificationState";
interface IProps {
notification: NotificationState;
/**
* If true, the badge will show a count if at all possible. This is typically
* used to override the user's preference for things like room sublists.
*/
forceCount?: boolean;
/**
* The room ID, if any, the badge represents.
*/
roomId?: string;
}
interface IClickableProps extends IProps, React.InputHTMLAttributes<Element> {
/**
* If specified will return an AccessibleButton instead of a div.
*/
onClick?(ev: React.MouseEvent): any;
}
interface IState {
showCounts: boolean;
}
export default class NotificationBadge extends React.PureComponent<XOR<IProps, IClickableProps>, IState> {
private countWatcherRef;
constructor(props: IProps);
private get roomId();
componentWillUnmount(): void;
componentDidUpdate(prevProps: Readonly<IProps>): void;
private countPreferenceChanged;
private onNotificationUpdate;
render(): React.ReactElement;
}
export {};