mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-06 20:56:33 +02:00
Allow passing in props to original component
This commit is contained in:
parent
ce428b5e2d
commit
f740dc3829
@ -264,7 +264,6 @@ export function renderTile(
|
||||
mxEvent: props.mxEvent,
|
||||
forExport: props.forExport,
|
||||
highlights: props.highlights,
|
||||
showUrlPreview: props.showUrlPreview,
|
||||
},
|
||||
undefined,
|
||||
);
|
||||
@ -300,14 +299,13 @@ export function renderTile(
|
||||
mxEvent: props.mxEvent,
|
||||
forExport: props.forExport,
|
||||
highlights: props.highlights,
|
||||
showUrlPreview: props.showUrlPreview,
|
||||
},
|
||||
() =>
|
||||
(origProps) =>
|
||||
factory(props.ref, {
|
||||
mxEvent,
|
||||
highlights,
|
||||
highlightLink,
|
||||
showUrlPreview,
|
||||
showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview,
|
||||
editState,
|
||||
replacingEventId,
|
||||
getRelationsForEvent,
|
||||
@ -322,9 +320,8 @@ export function renderTile(
|
||||
mxEvent: props.mxEvent,
|
||||
forExport: props.forExport,
|
||||
highlights: props.highlights,
|
||||
showUrlPreview: props.showUrlPreview,
|
||||
},
|
||||
() =>
|
||||
(origProps) =>
|
||||
factory(ref, {
|
||||
// NEARLY ALL THE OPTIONS!
|
||||
mxEvent,
|
||||
@ -333,7 +330,7 @@ export function renderTile(
|
||||
editState,
|
||||
highlights,
|
||||
highlightLink,
|
||||
showUrlPreview,
|
||||
showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview,
|
||||
permalinkCreator,
|
||||
callEventGrouper,
|
||||
getRelationsForEvent,
|
||||
@ -366,7 +363,6 @@ export function renderReplyTile(
|
||||
mxEvent: props.mxEvent,
|
||||
forExport: props.forExport,
|
||||
highlights: props.highlights,
|
||||
showUrlPreview: props.showUrlPreview,
|
||||
},
|
||||
undefined,
|
||||
);
|
||||
@ -392,14 +388,13 @@ export function renderReplyTile(
|
||||
mxEvent: props.mxEvent,
|
||||
forExport: props.forExport,
|
||||
highlights: props.highlights,
|
||||
showUrlPreview: props.showUrlPreview,
|
||||
},
|
||||
() =>
|
||||
(origProps) =>
|
||||
factory(ref, {
|
||||
mxEvent,
|
||||
highlights,
|
||||
highlightLink,
|
||||
showUrlPreview,
|
||||
showUrlPreview: origProps?.showUrlPreview ?? showUrlPreview,
|
||||
overrideBodyTypes,
|
||||
overrideEventTypes,
|
||||
replacingEventId,
|
||||
|
||||
@ -9,6 +9,7 @@ import type {
|
||||
CustomComponentsApi as ICustomComponentsApi,
|
||||
CustomMessageRenderFunction,
|
||||
CustomMessageComponentProps,
|
||||
OriginalComponentProps,
|
||||
} from "@element-hq/element-web-module-api";
|
||||
import type React from "react";
|
||||
|
||||
@ -30,7 +31,7 @@ export class CustomComponentsApi implements ICustomComponentsApi {
|
||||
*/
|
||||
public renderMessage(
|
||||
props: CustomMessageComponentProps,
|
||||
originalComponent?: () => React.JSX.Element,
|
||||
originalComponent?: (props?: OriginalComponentProps) => React.JSX.Element,
|
||||
): React.JSX.Element | null {
|
||||
for (const renderer of this.registeredMessageRenderers.filter((e) =>
|
||||
props.mxEvent.getType().match(e.eventType),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user