fix lint errors

This commit is contained in:
Brandon Egger 2023-08-22 14:18:48 -05:00
parent 712e263bfa
commit e61f9e10ce
2 changed files with 4 additions and 15 deletions

View File

@ -25,28 +25,17 @@ export const ResourcePhoto = ({ resource }: { resource: AuditoryResource }) => {
const blob = new Blob([resource.photo.data], { type: "image/png" }); const blob = new Blob([resource.photo.data], { type: "image/png" });
setBlobSrc(URL.createObjectURL(blob)); setBlobSrc(URL.createObjectURL(blob));
}, []); }, [resource.photo]);
const commonProps = { const commonProps = {
width: 512, width: 512,
height: 512, height: 512,
}; };
if (resource.photo?.data) {
return (
<img
className="w-full rounded-xl border border-neutral-400 bg-white drop-shadow-lg"
src={blobSrc}
alt={`${resource.name} logo`}
{...commonProps}
/>
);
}
return ( return (
<Image <Image
className="w-full rounded-xl border border-neutral-400 bg-white drop-shadow-lg" className="w-full rounded-xl border border-neutral-400 bg-white drop-shadow-lg"
src={`/resource_logos/${resource.icon}`} src={blobSrc ?? `/resource_logos/${resource.icon}`}
alt={`${resource.name} logo`} alt={`${resource.name} logo`}
{...commonProps} {...commonProps}
/> />

View File

@ -20,8 +20,8 @@ const getBaseUrl = () => {
superjson.registerCustom<Buffer, number[]>( superjson.registerCustom<Buffer, number[]>(
{ {
isApplicable: (v): v is Buffer => v instanceof Buffer, isApplicable: (v): v is Buffer => v instanceof Buffer,
serialize: v => [...v], serialize: (v) => [...v],
deserialize: v => Buffer.from(v) deserialize: (v) => Buffer.from(v),
}, },
"buffer" "buffer"
); );