diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 57cafcbab1..62bbfac157 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -71,25 +71,24 @@ export interface EventTileTypeProps showHiddenEvents: boolean; } -type FactoryProps = Omit; -type Factory = (ref: React.RefObject | undefined, props: X) => JSX.Element; +type Factory = (props: X) => JSX.Element; -export const MessageEventFactory: Factory = (ref, props) => ; -const LegacyCallEventFactory: Factory = (ref, props) => ( - +export const MessageEventFactory: Factory = (props) => ; +const LegacyCallEventFactory: Factory = (props) => ( + ); -const CallEventFactory: Factory = (ref, props) => ; -export const TextualEventFactory: Factory = (ref, props) => { +const CallEventFactory: Factory = (props) => ; +export const TextualEventFactory: Factory = (props) => { const vm = new TextualEventViewModel(props); return ; }; -const VerificationReqFactory: Factory = (_ref, props) => ; -const HiddenEventFactory: Factory = (ref, props) => ; +const VerificationReqFactory: Factory = (props) => ; +const HiddenEventFactory: Factory = (props) => ; // These factories are exported for reference comparison against pickFactory() -export const JitsiEventFactory: Factory = (ref, props) => ; -export const JSONEventFactory: Factory = (ref, props) => ; -export const RoomCreateEventFactory: Factory = (_ref, props) => ; +export const JitsiEventFactory: Factory = (props) => ; +export const JSONEventFactory: Factory = (props) => ; +export const RoomCreateEventFactory: Factory = (props) => ; const EVENT_TILE_TYPES = new Map([ [EventType.RoomMessage, MessageEventFactory], // note that verification requests are handled in pickFactory() @@ -102,12 +101,12 @@ const EVENT_TILE_TYPES = new Map([ ]); const STATE_EVENT_TILE_TYPES = new Map([ - [EventType.RoomEncryption, (ref, props) => ], + [EventType.RoomEncryption, (props) => ], [EventType.RoomCanonicalAlias, TextualEventFactory], [EventType.RoomCreate, RoomCreateEventFactory], [EventType.RoomMember, TextualEventFactory], [EventType.RoomName, TextualEventFactory], - [EventType.RoomAvatar, (ref, props) => ], + [EventType.RoomAvatar, (props) => ], [EventType.RoomThirdPartyInvite, TextualEventFactory], [EventType.RoomHistoryVisibility, TextualEventFactory], [EventType.RoomTopic, TextualEventFactory], @@ -302,8 +301,9 @@ export function renderTile( mxEvent: props.mxEvent, }, (origProps) => - factory(props.ref, { + factory({ // We only want a subset of props, so we don't end up causing issues for downstream components. + ref, mxEvent, highlights, highlightLink, @@ -323,7 +323,8 @@ export function renderTile( mxEvent: props.mxEvent, }, (origProps) => - factory(ref, { + factory({ + ref, // NEARLY ALL THE OPTIONS! mxEvent, forExport, @@ -389,7 +390,8 @@ export function renderReplyTile( mxEvent: props.mxEvent, }, (origProps) => - factory(ref, { + factory({ + ref, mxEvent, highlights, highlightLink,