Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Adapt the rendering of extra icons in the room header
Browse files Browse the repository at this point in the history
Signed-off-by: Charly Nguyen <[email protected]>
  • Loading branch information
Charly Nguyen committed Nov 8, 2023
1 parent 01e7e01 commit 2679879
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/views/rooms/LegacyRoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
}}
title={label}
>
{props.icon}
{props.icon()}

Check failure on line 687 in src/components/views/rooms/LegacyRoomHeader.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

Cannot invoke an object which is possibly 'null' or 'undefined'.

Check failure on line 687 in src/components/views/rooms/LegacyRoomHeader.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

This expression is not callable.
</IconButton>
</Tooltip>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default function RoomHeader({
props.onClick();
}}
>
{props.icon}
{props.icon()}

Check failure on line 191 in src/components/views/rooms/RoomHeader.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

Cannot invoke an object which is possibly 'null' or 'undefined'.

Check failure on line 191 in src/components/views/rooms/RoomHeader.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

This expression is not callable.
</IconButton>
</Tooltip>
);
Expand Down
4 changes: 2 additions & 2 deletions test/components/views/rooms/LegacyRoomHeader-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ describe("LegacyRoomHeader", () => {
it("renders additionalButtons", async () => {
const additionalButtons: ViewRoomOpts["buttons"] = [
{
icon: <>test-icon</>,
icon: () => <>test-icon</>,
id: "test-id",
label: () => "test-label",
onClick: () => {},
Expand All @@ -757,7 +757,7 @@ describe("LegacyRoomHeader", () => {
const callback = jest.fn();
const additionalButtons: ViewRoomOpts["buttons"] = [
{
icon: <>test-icon</>,
icon: () => <>test-icon</>,
id: "test-id",
label: () => "test-label",
onClick: callback,
Expand Down
4 changes: 2 additions & 2 deletions test/components/views/rooms/RoomHeader-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ describe("RoomHeader", () => {
it("renders additionalButtons", async () => {
const additionalButtons: ViewRoomOpts["buttons"] = [
{
icon: <>test-icon</>,
icon: () => <>test-icon</>,
id: "test-id",
label: () => "test-label",
onClick: () => {},
Expand All @@ -539,7 +539,7 @@ describe("RoomHeader", () => {
const callback = jest.fn();
const additionalButtons: ViewRoomOpts["buttons"] = [
{
icon: <>test-icon</>,
icon: () => <>test-icon</>,
id: "test-id",
label: () => "test-label",
onClick: callback,
Expand Down

0 comments on commit 2679879

Please sign in to comment.