History based navigation with new right panel store (#7398)
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
This commit is contained in:
parent
6f89267a31
commit
4ab3470184
25 changed files with 248 additions and 252 deletions
|
@ -51,10 +51,11 @@ export default class MKeyVerificationRequest extends React.Component<IProps> {
|
|||
private openRequest = () => {
|
||||
const { verificationRequest } = this.props.mxEvent;
|
||||
const member = MatrixClientPeg.get().getUser(verificationRequest.otherUserId);
|
||||
RightPanelStore.instance.setCard({
|
||||
phase: RightPanelPhases.EncryptionPanel,
|
||||
state: { verificationRequest, member },
|
||||
});
|
||||
RightPanelStore.instance.setCards([
|
||||
{ phase: RightPanelPhases.RoomSummary },
|
||||
{ phase: RightPanelPhases.RoomMemberInfo, state: { member } },
|
||||
{ phase: RightPanelPhases.EncryptionPanel, state: { verificationRequest, member } },
|
||||
]);
|
||||
};
|
||||
|
||||
private onRequestChanged = () => {
|
||||
|
|
|
@ -39,8 +39,9 @@ import DownloadActionButton from "./DownloadActionButton";
|
|||
import SettingsStore from '../../../settings/SettingsStore';
|
||||
import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks';
|
||||
import ReplyChain from '../elements/ReplyChain';
|
||||
import { dispatchShowThreadEvent } from '../../../dispatcher/dispatch-actions/threads';
|
||||
import { showThread } from '../../../dispatcher/dispatch-actions/threads';
|
||||
import ReactionPicker from "../emojipicker/ReactionPicker";
|
||||
import { CardContext } from '../right_panel/BaseCard';
|
||||
|
||||
interface IOptionsButtonProps {
|
||||
mxEvent: MatrixEvent;
|
||||
|
@ -219,8 +220,8 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
|
|||
});
|
||||
};
|
||||
|
||||
private onThreadClick = (): void => {
|
||||
dispatchShowThreadEvent(this.props.mxEvent);
|
||||
private onThreadClick = (isCard: boolean): void => {
|
||||
showThread({ rootEvent: this.props.mxEvent, push: isCard });
|
||||
dis.dispatch({
|
||||
action: Action.FocusSendMessageComposer,
|
||||
context: TimelineRenderingType.Thread,
|
||||
|
@ -303,6 +304,17 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
|
|||
key="cancel"
|
||||
/>;
|
||||
|
||||
const threadTooltipButton = <CardContext.Consumer>
|
||||
{ context =>
|
||||
<RovingAccessibleTooltipButton
|
||||
className="mx_MessageActionBar_maskButton mx_MessageActionBar_threadButton"
|
||||
title={_t("Reply in thread")}
|
||||
onClick={this.onThreadClick.bind(null, context.isCard)}
|
||||
key="thread"
|
||||
/>
|
||||
}
|
||||
</CardContext.Consumer>;
|
||||
|
||||
// We show a different toolbar for failed events, so detect that first.
|
||||
const mxEvent = this.props.mxEvent;
|
||||
const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status;
|
||||
|
@ -335,12 +347,7 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
|
|||
key="reply"
|
||||
/>
|
||||
{ (this.showReplyInThreadAction) && (
|
||||
<RovingAccessibleTooltipButton
|
||||
className="mx_MessageActionBar_maskButton mx_MessageActionBar_threadButton"
|
||||
title={_t("Reply in thread")}
|
||||
onClick={this.onThreadClick}
|
||||
key="thread"
|
||||
/>
|
||||
threadTooltipButton
|
||||
) }
|
||||
</>);
|
||||
}
|
||||
|
@ -368,12 +375,7 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
|
|||
this.props.mxEvent.getThread() &&
|
||||
!isContentActionable(this.props.mxEvent)
|
||||
) {
|
||||
toolbarOpts.unshift(<RovingAccessibleTooltipButton
|
||||
className="mx_MessageActionBar_maskButton mx_MessageActionBar_threadButton"
|
||||
title={_t("Reply in thread")}
|
||||
onClick={this.onThreadClick}
|
||||
key="thread"
|
||||
/>);
|
||||
toolbarOpts.unshift(threadTooltipButton);
|
||||
}
|
||||
|
||||
if (allowCancel) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue