Show votes in replied-to polls (pass in getRelationsForEvent) (#7345)
parent
43499b9244
commit
55eda7314b
|
@ -22,6 +22,7 @@ import escapeHtml from "escape-html";
|
||||||
import sanitizeHtml from "sanitize-html";
|
import sanitizeHtml from "sanitize-html";
|
||||||
import { Room } from 'matrix-js-sdk/src/models/room';
|
import { Room } from 'matrix-js-sdk/src/models/room';
|
||||||
import { RelationType } from 'matrix-js-sdk/src/@types/event';
|
import { RelationType } from 'matrix-js-sdk/src/@types/event';
|
||||||
|
import { Relations } from 'matrix-js-sdk/src/models/relations';
|
||||||
|
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import dis from '../../../dispatcher/dispatcher';
|
import dis from '../../../dispatcher/dispatcher';
|
||||||
|
@ -56,6 +57,9 @@ interface IProps {
|
||||||
forExport?: boolean;
|
forExport?: boolean;
|
||||||
isQuoteExpanded?: boolean;
|
isQuoteExpanded?: boolean;
|
||||||
setQuoteExpanded: (isExpanded: boolean) => void;
|
setQuoteExpanded: (isExpanded: boolean) => void;
|
||||||
|
getRelationsForEvent?: (
|
||||||
|
(eventId: string, relationType: string, eventType: string) => Relations
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
|
@ -420,6 +424,7 @@ export default class ReplyChain extends React.Component<IProps, IState> {
|
||||||
onHeightChanged={this.props.onHeightChanged}
|
onHeightChanged={this.props.onHeightChanged}
|
||||||
permalinkCreator={this.props.permalinkCreator}
|
permalinkCreator={this.props.permalinkCreator}
|
||||||
toggleExpandedQuote={() => this.props.setQuoteExpanded(!this.props.isQuoteExpanded)}
|
toggleExpandedQuote={() => this.props.setQuoteExpanded(!this.props.isQuoteExpanded)}
|
||||||
|
getRelationsForEvent={this.props.getRelationsForEvent}
|
||||||
/>
|
/>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1260,6 +1260,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
alwaysShowTimestamps={this.props.alwaysShowTimestamps || this.state.hover}
|
alwaysShowTimestamps={this.props.alwaysShowTimestamps || this.state.hover}
|
||||||
isQuoteExpanded={isQuoteExpanded}
|
isQuoteExpanded={isQuoteExpanded}
|
||||||
setQuoteExpanded={this.setQuoteExpanded}
|
setQuoteExpanded={this.setQuoteExpanded}
|
||||||
|
getRelationsForEvent={this.props.getRelationsForEvent}
|
||||||
/>) : null;
|
/>) : null;
|
||||||
|
|
||||||
switch (this.props.tileShape) {
|
switch (this.props.tileShape) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import classNames from 'classnames';
|
||||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||||
import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event';
|
import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event';
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
|
import { Relations } from 'matrix-js-sdk/src/models/relations';
|
||||||
|
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import dis from '../../../dispatcher/dispatcher';
|
import dis from '../../../dispatcher/dispatcher';
|
||||||
|
@ -39,6 +40,9 @@ interface IProps {
|
||||||
highlightLink?: string;
|
highlightLink?: string;
|
||||||
onHeightChanged?(): void;
|
onHeightChanged?(): void;
|
||||||
toggleExpandedQuote?: () => void;
|
toggleExpandedQuote?: () => void;
|
||||||
|
getRelationsForEvent?: (
|
||||||
|
(eventId: string, relationType: string, eventType: string) => Relations
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@replaceableComponent("views.rooms.ReplyTile")
|
@replaceableComponent("views.rooms.ReplyTile")
|
||||||
|
@ -169,7 +173,8 @@ export default class ReplyTile extends React.PureComponent<IProps> {
|
||||||
overrideBodyTypes={msgtypeOverrides}
|
overrideBodyTypes={msgtypeOverrides}
|
||||||
overrideEventTypes={evOverrides}
|
overrideEventTypes={evOverrides}
|
||||||
replacingEventId={mxEvent.replacingEventId()}
|
replacingEventId={mxEvent.replacingEventId()}
|
||||||
maxImageHeight={96} />
|
maxImageHeight={96}
|
||||||
|
getRelationsForEvent={this.props.getRelationsForEvent} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue