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" });
setBlobSrc(URL.createObjectURL(blob));
}, []);
}, [resource.photo]);
const commonProps = {
width: 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 (
<Image
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`}
{...commonProps}
/>

View File

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