[WEB-1613] chore: material logo loader (#4823)

* chore: material logo loader added

* chore: material logo loader added
This commit is contained in:
Anmol Singh Bhatia 2024-06-14 17:37:05 +05:30 committed by GitHub
parent 244986554c
commit 831a336690
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 66 additions and 46 deletions

View file

@ -4,6 +4,7 @@ import { FC } from "react";
// emoji-picker-react
import { Emoji } from "emoji-picker-react";
// import { icons } from "lucide-react";
import useFontFaceObserver from "use-font-face-observer";
import { TLogoProps } from "@plane/types";
// helpers
import { LUCIDE_ICONS_LIST } from "@plane/ui";
@ -26,9 +27,29 @@ export const Logo: FC<Props> = (props) => {
const color = icon?.color;
const lucideIcon = LUCIDE_ICONS_LIST.find((item) => item.name === value);
const isMaterialSymbolsFontLoaded = useFontFaceObserver([
{
family: `Material Symbols Rounded`,
style: `normal`,
weight: `normal`,
stretch: `condensed`,
},
]);
// if no value, return empty fragment
if (!value) return <></>;
if (!isMaterialSymbolsFontLoaded) {
return (
<span
style={{
height: size,
width: size,
}}
className="rounded animate-pulse bg-custom-background-80"
/>
);
}
// emoji
if (in_use === "emoji") {
return <Emoji unified={emojiCodeToUnicode(value)} size={size} />;