Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRS-320 Add own reactions #604

Merged
merged 2 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Message/MessageCommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const MessageCommerce = (props) => {
<ReactionsList
reactions={message.latest_reactions}
reaction_counts={message.reaction_counts || undefined}
own_reactions={message.own_reactions}
onClick={onReactionListClick}
/>
)}
Expand All @@ -145,6 +146,7 @@ const MessageCommerce = (props) => {
detailedView
reaction_counts={message.reaction_counts || undefined}
latest_reactions={message.latest_reactions}
own_reactions={message.own_reactions}
ref={reactionSelectorRef}
/>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/MessageLivestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ const MessageLivestreamComponent = (props) => {
detailedView
latest_reactions={message?.latest_reactions}
reaction_counts={message?.reaction_counts || undefined}
own_reactions={message.own_reactions}
ref={reactionSelectorRef}
/>
)}
Expand Down Expand Up @@ -276,6 +277,7 @@ const MessageLivestreamComponent = (props) => {
<ReactionsList
reaction_counts={message.reaction_counts || undefined}
reactions={message.latest_reactions}
own_reactions={message.own_reactions}
handleReaction={propHandleReaction || handleReaction}
/>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/MessageSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const MessageSimple = (props) => {
<ReactionsList
reactions={message.latest_reactions}
reaction_counts={message.reaction_counts || undefined}
own_reactions={message.own_reactions}
onClick={onReactionListClick}
reverse={true}
/>
Expand All @@ -177,6 +178,7 @@ const MessageSimple = (props) => {
detailedView
reaction_counts={message.reaction_counts || undefined}
latest_reactions={message.latest_reactions}
own_reactions={message.own_reactions}
ref={reactionSelectorRef}
/>
)}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Message/MessageTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const MessageTeam = (props) => {
handleReaction={propHandleReaction || handleReaction}
latest_reactions={message.latest_reactions}
reaction_counts={message.reaction_counts || undefined}
own_reactions={message.own_reactions}
detailedView={true}
ref={reactionSelectorRef}
/>
Expand Down Expand Up @@ -315,6 +316,7 @@ const MessageTeam = (props) => {
reaction_counts={message.reaction_counts || undefined}
handleReaction={propHandleReaction || handleReaction}
reactions={message.latest_reactions}
own_reactions={message.own_reactions}
/>
)}
{message?.status === 'failed' && (
Expand Down Expand Up @@ -358,6 +360,7 @@ const MessageTeam = (props) => {
reaction_counts={message.reaction_counts || undefined}
handleReaction={propHandleReaction || handleReaction}
reactions={message.latest_reactions}
own_reactions={message.own_reactions}
/>
)}
{!threadList && message && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/Message/MessageText.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const MessageTextComponent = (props) => {
<ReactionsList
reactions={message.latest_reactions}
reaction_counts={message.reaction_counts || undefined}
own_reactions={message.own_reactions}
onClick={onReactionListClick}
reverse={true}
/>
Expand All @@ -114,6 +115,7 @@ const MessageTextComponent = (props) => {
detailedView
reaction_counts={message.reaction_counts || undefined}
latest_reactions={message.latest_reactions}
own_reactions={message.own_reactions}
ref={reactionSelectorRef}
/>
)}
Expand Down
2 changes: 2 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ export interface ReactionSelectorProps {
reaction_counts?: {
[reaction_type: string]: number;
};
own_reactions?: StreamChatReactMessageResponse['own_reactions'];
/** Enable the avatar display */
detailedView?: boolean;
/** Provide a list of reaction options [{name: 'angry', emoji: 'angry'}] */
Expand Down Expand Up @@ -992,6 +993,7 @@ export interface ReactionsListProps {
reaction_counts?: {
[reaction_type: string]: number;
};
own_reactions?: StreamChatReactMessageResponse['own_reactions'];
/** Provide a list of reaction options [{name: 'angry', emoji: 'angry'}] */
reactionOptions?: MinimalEmojiInterface[];
onClick?(): void;
Expand Down