Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Show votes in replied-to polls (pass in getRelationsForEvent) (#7345)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam authored Dec 13, 2021
1 parent 43499b9 commit 55eda73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/views/elements/ReplyChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import escapeHtml from "escape-html";
import sanitizeHtml from "sanitize-html";
import { Room } from 'matrix-js-sdk/src/models/room';
import { RelationType } from 'matrix-js-sdk/src/@types/event';
import { Relations } from 'matrix-js-sdk/src/models/relations';

import { _t } from '../../../languageHandler';
import dis from '../../../dispatcher/dispatcher';
Expand Down Expand Up @@ -56,6 +57,9 @@ interface IProps {
forExport?: boolean;
isQuoteExpanded?: boolean;
setQuoteExpanded: (isExpanded: boolean) => void;
getRelationsForEvent?: (
(eventId: string, relationType: string, eventType: string) => Relations
);
}

interface IState {
Expand Down Expand Up @@ -420,6 +424,7 @@ export default class ReplyChain extends React.Component<IProps, IState> {
onHeightChanged={this.props.onHeightChanged}
permalinkCreator={this.props.permalinkCreator}
toggleExpandedQuote={() => this.props.setQuoteExpanded(!this.props.isQuoteExpanded)}
getRelationsForEvent={this.props.getRelationsForEvent}
/>
</blockquote>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ export default class EventTile extends React.Component<IProps, IState> {
alwaysShowTimestamps={this.props.alwaysShowTimestamps || this.state.hover}
isQuoteExpanded={isQuoteExpanded}
setQuoteExpanded={this.setQuoteExpanded}
getRelationsForEvent={this.props.getRelationsForEvent}
/>) : null;

switch (this.props.tileShape) {
Expand Down
7 changes: 6 additions & 1 deletion src/components/views/rooms/ReplyTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import classNames from 'classnames';
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event';
import { logger } from "matrix-js-sdk/src/logger";
import { Relations } from 'matrix-js-sdk/src/models/relations';

import { _t } from '../../../languageHandler';
import dis from '../../../dispatcher/dispatcher';
Expand All @@ -39,6 +40,9 @@ interface IProps {
highlightLink?: string;
onHeightChanged?(): void;
toggleExpandedQuote?: () => void;
getRelationsForEvent?: (
(eventId: string, relationType: string, eventType: string) => Relations
);
}

@replaceableComponent("views.rooms.ReplyTile")
Expand Down Expand Up @@ -169,7 +173,8 @@ export default class ReplyTile extends React.PureComponent<IProps> {
overrideBodyTypes={msgtypeOverrides}
overrideEventTypes={evOverrides}
replacingEventId={mxEvent.replacingEventId()}
maxImageHeight={96} />
maxImageHeight={96}
getRelationsForEvent={this.props.getRelationsForEvent} />
</a>
</div>
);
Expand Down

0 comments on commit 55eda73

Please sign in to comment.