Commit e268a1fe authored by Steven's avatar Steven

chore: tweak memo content renderer

parent ac377381
...@@ -55,10 +55,11 @@ const MemoContent = (props: MemoContentProps) => { ...@@ -55,10 +55,11 @@ const MemoContent = (props: MemoContentProps) => {
return <input {...inputProps} />; return <input {...inputProps} />;
}) as React.ComponentType<React.ComponentProps<"input">>, }) as React.ComponentType<React.ComponentProps<"input">>,
span: ((spanProps: React.ComponentProps<"span"> & { node?: Element }) => { span: ((spanProps: React.ComponentProps<"span"> & { node?: Element }) => {
if (spanProps.node && isTagNode(spanProps.node)) { const { node, ...rest } = spanProps;
if (node && isTagNode(node)) {
return <Tag {...spanProps} />; return <Tag {...spanProps} />;
} }
return <span {...spanProps} />; return <span {...rest} />;
}) as React.ComponentType<React.ComponentProps<"span">>, }) as React.ComponentType<React.ComponentProps<"span">>,
pre: CodeBlock, pre: CodeBlock,
a: ({ href, children, ...aProps }) => ( a: ({ href, children, ...aProps }) => (
......
...@@ -11,7 +11,6 @@ interface AttachmentCardProps { ...@@ -11,7 +11,6 @@ interface AttachmentCardProps {
const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps) => { const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps) => {
const attachmentType = getAttachmentType(attachment); const attachmentType = getAttachmentType(attachment);
const sourceUrl = getAttachmentUrl(attachment); const sourceUrl = getAttachmentUrl(attachment);
const colorspace = getColorspace(attachment.type);
if (attachmentType === "image/*") { if (attachmentType === "image/*") {
return ( return (
...@@ -21,7 +20,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps) ...@@ -21,7 +20,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
className={cn("w-full h-full object-cover rounded-lg cursor-pointer", className)} className={cn("w-full h-full object-cover rounded-lg cursor-pointer", className)}
onClick={onClick} onClick={onClick}
loading="lazy" loading="lazy"
{...(colorspace && { colorSpace: colorspace as unknown as string })}
/> />
); );
} }
...@@ -33,7 +31,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps) ...@@ -33,7 +31,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
className={cn("w-full h-full object-cover rounded-lg", className)} className={cn("w-full h-full object-cover rounded-lg", className)}
controls controls
preload="metadata" preload="metadata"
{...(colorspace && { colorSpace: colorspace as unknown as string })}
/> />
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment