refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-29 08:49:34 +08:00
parent 43a13f8d08
commit 96017c8fc6
21 changed files with 150 additions and 90 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ import EmojiHeart from "../../assets/icons/emoji.heart.svg";
import EmojiRocket from "../../assets/icons/emoji.rocket.svg";
import EmojiLook from "../../assets/icons/emoji.look.svg";
interface Emojis {
export interface Emojis {
"👍": ReactElement;
"👎": ReactElement;
"😄": ReactElement;
@@ -31,11 +31,11 @@ const emojis: Emojis = {
};
interface Props {
native?: keyof Emojis;
native: keyof Emojis;
}
const ReactionItem: FC<Props> = ({ native }) => {
if (!native) return null;
// if (!native) return null;
return emojis[native] ?? null;
};