Skip to content

Commit b7a32f9

Browse files
authored
regression: Livechat using removed ui-kit function to render action blocks (RocketChat#39904)
1 parent 6e9e407 commit b7a32f9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/livechat/src/components/uiKit/message/ActionsBlock/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import type * as uikit from '@rocket.chat/ui-kit';
2-
import { BlockContext } from '@rocket.chat/ui-kit';
32
import { useState, useMemo, useCallback } from 'preact/compat';
43
import { useTranslation } from 'react-i18next';
54

5+
import type { MessageParser } from '..';
66
import { createClassName } from '../../../../helpers/createClassName';
77
import { Button } from '../../../Button';
88
import Block from '../Block';
99
import styles from './styles.scss';
1010

1111
type ActionsBlockProps = uikit.ActionsBlock & {
12-
parser: any;
13-
t: any;
12+
parser: MessageParser;
1413
};
1514

1615
const ActionsBlock = ({ appId, blockId, elements, parser }: ActionsBlockProps) => {
@@ -28,7 +27,7 @@ const ActionsBlock = ({ appId, blockId, elements, parser }: ActionsBlockProps) =
2827
<Block appId={appId} blockId={blockId}>
2928
<div className={createClassName(styles, 'uikit-actions-block')}>
3029
{renderableElements.map((element, key) => {
31-
const renderedElement = parser.renderActions(element, BlockContext.ACTION);
30+
const renderedElement = parser.renderActionsBlockElement(element, key);
3231

3332
if (!renderedElement) {
3433
return null;

packages/livechat/src/components/uiKit/message/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import PlainText from './PlainText';
1515
import SectionBlock from './SectionBlock';
1616
import StaticSelectElement from './StaticSelectElement';
1717

18-
class MessageParser extends UiKitParserMessage<ComponentChild> {
18+
export class MessageParser extends UiKitParserMessage<ComponentChild> {
1919
divider = (element: any, context: any, index: any) => {
2020
if (context !== BlockContext.BLOCK) {
2121
return null;

0 commit comments

Comments
 (0)