-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Reactions): switch options type to array to guarantee order
- Loading branch information
1 parent
2547f57
commit 1cb3813
Showing
5 changed files
with
71 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: () => <StreamEmoji fallback='π ' type='angry' />, name: 'Angry' }, | ||
haha: { Component: () => <StreamEmoji fallback='π' type='haha' />, name: 'Joy' }, | ||
like: { Component: () => <StreamEmoji fallback='π' type='like' />, name: 'Thumbs up' }, | ||
love: { Component: () => <StreamEmoji fallback='β€οΈ' type='love' />, name: 'Heart' }, | ||
sad: { Component: () => <StreamEmoji fallback='π' type='sad' />, name: 'Sad' }, | ||
wow: { Component: () => <StreamEmoji fallback='π²' type='wow' />, name: 'Astonished' }, | ||
}; | ||
export const defaultReactionOptions: ReactionOptions = [ | ||
{ type: 'angry', Component: () => <StreamEmoji fallback='π ' type='angry' />, name: 'Angry' }, | ||
{ type: 'haha', Component: () => <StreamEmoji fallback='π' type='haha' />, name: 'Joy' }, | ||
{ type: 'like', Component: () => <StreamEmoji fallback='π' type='like' />, name: 'Thumbs up' }, | ||
{ type: 'love', Component: () => <StreamEmoji fallback='β€οΈ' type='love' />, name: 'Heart' }, | ||
{ type: 'sad', Component: () => <StreamEmoji fallback='π' type='sad' />, name: 'Sad' }, | ||
{ type: 'wow', Component: () => <StreamEmoji fallback='π²' type='wow' />, name: 'Astonished' }, | ||
]; |