setTooltipReactionType(undefined)}
title={tooltipContent}
>
-
+
{tooltipVisible && themeVersion === '1' && (
diff --git a/src/components/Reactions/hooks/useProcessReactions.tsx b/src/components/Reactions/hooks/useProcessReactions.tsx
index 3f2066281f..5df8af9265 100644
--- a/src/components/Reactions/hooks/useProcessReactions.tsx
+++ b/src/components/Reactions/hooks/useProcessReactions.tsx
@@ -37,7 +37,7 @@ export const useProcessReactions = <
);
const getEmojiByReactionType = useCallback(
- (reactionType: string) => Object.entries(reactionOptions).find(([rt]) => rt === reactionType),
+ (reactionType: string) => reactionOptions.find(({ type }) => type === reactionType),
[reactionOptions],
);
@@ -54,7 +54,7 @@ export const useProcessReactions = <
const supportedReactionMap = useMemo(
() =>
- Object.keys(reactionOptions).reduce>((map, reactionType) => {
+ reactionOptions.reduce>((map, { type: reactionType }) => {
map[reactionType] = true;
return map;
}, {}),
@@ -62,7 +62,7 @@ export const useProcessReactions = <
);
const supportedReactionsArePresent = useMemo(
- () => latestReactionTypes.some((type) => supportedReactionMap[type]),
+ () => latestReactionTypes.some((reactionType) => supportedReactionMap[reactionType]),
[latestReactionTypes, supportedReactionMap],
);
diff --git a/src/components/Reactions/reactionOptions.tsx b/src/components/Reactions/reactionOptions.tsx
index 5e4d888d0a..f1866e40bc 100644
--- a/src/components/Reactions/reactionOptions.tsx
+++ b/src/components/Reactions/reactionOptions.tsx
@@ -1,18 +1,20 @@
+/* eslint-disable sort-keys */
/* eslint-disable react/display-name */
import React from 'react';
import { StreamEmoji } from './StreamEmoji';
-export type ReactionOptions = Record<
- string,
- { Component: React.ComponentType; aliases?: string[]; name?: string }
->;
+export type ReactionOptions = Array<{
+ Component: React.ComponentType;
+ type: string;
+ name?: string;
+}>;
-export const defaultReactionOptions: ReactionOptions = {
- angry: { Component: () => , name: 'Angry' },
- haha: { Component: () => , name: 'Joy' },
- like: { Component: () => , name: 'Thumbs up' },
- love: { Component: () => , name: 'Heart' },
- sad: { Component: () => , name: 'Sad' },
- wow: { Component: () => , name: 'Astonished' },
-};
+export const defaultReactionOptions: ReactionOptions = [
+ { type: 'angry', Component: () => , name: 'Angry' },
+ { type: 'haha', Component: () => , name: 'Joy' },
+ { type: 'like', Component: () => , name: 'Thumbs up' },
+ { type: 'love', Component: () => , name: 'Heart' },
+ { type: 'sad', Component: () => , name: 'Sad' },
+ { type: 'wow', Component: () => , name: 'Astonished' },
+];