fix(nui): Fix incorrect string typing and remove tsignore

This commit is contained in:
Luke
2022-04-11 14:41:07 +02:00
parent 760f18653d
commit 8d375569ab

View File

@@ -63,13 +63,12 @@ const Notifications: React.FC = () => {
useNuiEvent<CustomProps>("customNotify", (data) => { useNuiEvent<CustomProps>("customNotify", (data) => {
if (data.id && toast.isActive(data.id)) return; if (data.id && toast.isActive(data.id)) return;
if (!data.icon) { if (!data.icon) {
//@ts-expect-error because amazing types
data.icon = data.icon =
data.type === "error" data.type === "error"
? "fa-circle-xmark" ? "circle-xmark"
: data.type === "success" : data.type === "success"
? "fa-circle-check" ? "circle-check"
: "fa-circle-info"; : "circle-info";
} }
toast({ toast({
@@ -84,15 +83,14 @@ const Notifications: React.FC = () => {
boxShadow="md" boxShadow="md"
> >
<HStack spacing={0}> <HStack spacing={0}>
{ {data.icon && (
<FontAwesomeIcon <FontAwesomeIcon
//@ts-expect-error because amazing types
icon={data.icon} icon={data.icon}
fontSize="1.3em" fontSize="1.3em"
style={{ paddingRight: 8 }} style={{ paddingRight: 8 }}
color={data.iconColor} color={data.iconColor}
/> />
} )}
<Box w="100%"> <Box w="100%">
{data.title && <Text as="b">{data.title}</Text>} {data.title && <Text as="b">{data.title}</Text>}
{data.description && <Text>{data.description}</Text>} {data.description && <Text>{data.description}</Text>}