mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
3d7fe40035
* refactor: issue views and my issues * chore: update view dropdown options * refactor: render emoji function * refactor: api calss * fix: build errors * fix: fetch states only when dropdown is opened * chore: my issues dnd * fix: build errors * refactor: folder structure
39 lines
713 B
TypeScript
39 lines
713 B
TypeScript
export const getRandomEmoji = () => {
|
|
const emojis = [
|
|
"8986",
|
|
"9200",
|
|
"128204",
|
|
"127773",
|
|
"127891",
|
|
"127947",
|
|
"128076",
|
|
"128077",
|
|
"128187",
|
|
"128188",
|
|
"128512",
|
|
"128522",
|
|
"128578",
|
|
];
|
|
|
|
return emojis[Math.floor(Math.random() * emojis.length)];
|
|
};
|
|
|
|
export const renderEmoji = (
|
|
emoji:
|
|
| string
|
|
| {
|
|
name: string;
|
|
color: string;
|
|
}
|
|
) => {
|
|
if (!emoji) return;
|
|
|
|
if (typeof emoji === "object")
|
|
return (
|
|
<span style={{ color: emoji.color }} className="material-symbols-rounded text-lg">
|
|
{emoji.name}
|
|
</span>
|
|
);
|
|
else return isNaN(parseInt(emoji)) ? emoji : String.fromCodePoint(parseInt(emoji));
|
|
};
|