History based navigation with new right panel store (#7398)

Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
This commit is contained in:
Timo 2022-01-05 17:25:41 +01:00 committed by GitHub
parent 6f89267a31
commit 4ab3470184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 248 additions and 252 deletions

View file

@ -25,6 +25,7 @@ import { Action } from "../../../dispatcher/actions";
import BaseAvatar from "./BaseAvatar";
import { replaceableComponent } from "../../../utils/replaceableComponent";
import { mediaFromMxc } from "../../../customisations/Media";
import { CardContext } from '../right_panel/BaseCard';
interface IProps extends Omit<React.ComponentProps<typeof BaseAvatar>, "name" | "idName" | "url"> {
member: RoomMember;
@ -36,6 +37,7 @@ interface IProps extends Omit<React.ComponentProps<typeof BaseAvatar>, "name" |
onClick?: React.MouseEventHandler;
// Whether the onClick of the avatar should be overridden to dispatch `Action.ViewUser`
viewUserOnClick?: boolean;
pushUserOnClick?: boolean;
title?: string;
style?: any;
}
@ -99,6 +101,7 @@ export default class MemberAvatar extends React.Component<IProps, IState> {
dis.dispatch({
action: Action.ViewUser,
member: this.props.member,
push: this.context.isCard,
});
};
}
@ -109,7 +112,10 @@ export default class MemberAvatar extends React.Component<IProps, IState> {
title={this.state.title}
idName={userId}
url={this.state.imageUrl}
onClick={onClick} />
onClick={onClick}
/>
);
}
}
MemberAvatar.contextType = CardContext;