1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-12-01 09:58:03 +03:00

Pass permallinkCreator to ImageView

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-02-24 19:11:08 +01:00
parent fa9ae89b5b
commit bd5efc7ceb
4 changed files with 8 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ export default class ImageView extends React.Component {
// properties above, which let us use lightboxes to display images which aren't associated // properties above, which let us use lightboxes to display images which aren't associated
// with events. // with events.
mxEvent: PropTypes.object, mxEvent: PropTypes.object,
permalinkCreator: PropTypes.object,
}; };
constructor(props) { constructor(props) {

View File

@@ -38,6 +38,8 @@ export default class MImageBody extends React.Component {
/* the maximum image height to use */ /* the maximum image height to use */
maxImageHeight: PropTypes.number, maxImageHeight: PropTypes.number,
permalinkCreator: PropTypes.object,
}; };
static contextType = MatrixClientContext; static contextType = MatrixClientContext;
@@ -103,6 +105,7 @@ export default class MImageBody extends React.Component {
src: httpUrl, src: httpUrl,
name: content.body && content.body.length > 0 ? content.body : _t('Attachment'), name: content.body && content.body.length > 0 ? content.body : _t('Attachment'),
mxEvent: this.props.mxEvent, mxEvent: this.props.mxEvent,
permalinkCreator: this.props.permalinkCreator,
}; };
if (content.info) { if (content.info) {

View File

@@ -44,6 +44,8 @@ export default class MessageEvent extends React.Component {
/* the maximum image height to use, if the event is an image */ /* the maximum image height to use, if the event is an image */
maxImageHeight: PropTypes.number, maxImageHeight: PropTypes.number,
permalinkCreator: PropTypes.object,
}; };
constructor(props) { constructor(props) {
@@ -120,6 +122,7 @@ export default class MessageEvent extends React.Component {
editState={this.props.editState} editState={this.props.editState}
onHeightChanged={this.props.onHeightChanged} onHeightChanged={this.props.onHeightChanged}
onMessageAllowed={this.onTileUpdate} onMessageAllowed={this.onTileUpdate}
permalinkCreator={this.props.permalinkCreator}
/>; />;
} }
} }

View File

@@ -968,6 +968,7 @@ export default class EventTile extends React.Component {
highlights={this.props.highlights} highlights={this.props.highlights}
highlightLink={this.props.highlightLink} highlightLink={this.props.highlightLink}
showUrlPreview={this.props.showUrlPreview} showUrlPreview={this.props.showUrlPreview}
permalinkCreator={this.props.permalinkCreator}
onHeightChanged={this.props.onHeightChanged} /> onHeightChanged={this.props.onHeightChanged} />
{ keyRequestInfo } { keyRequestInfo }
{ reactionsRow } { reactionsRow }