Disable spotlight for poll options

fixes #603
This commit is contained in:
2023-07-12 12:30:21 +01:00
parent 10d7c26470
commit e92ac1c850
5 changed files with 34 additions and 12 deletions

View File

@ -26,7 +26,14 @@ import NostrLink from "Element/NostrLink";
import RevealMedia from "Element/RevealMedia";
import MagnetLink from "Element/MagnetLink";
export default function HyperText({ link, creator, depth }: { link: string; creator: string; depth?: number }) {
interface HypeTextProps {
link: string;
creator: string;
depth?: number;
disableMediaSpotlight?: boolean;
}
export default function HyperText({ link, creator, depth, disableMediaSpotlight }: HypeTextProps) {
const a = link;
try {
const url = new URL(a);
@ -42,7 +49,7 @@ export default function HyperText({ link, creator, depth }: { link: string; crea
const isWavlakeLink = WavlakeRegex.test(a);
const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1;
if (extension && !isAppleMusicLink) {
return <RevealMedia link={a} creator={creator} />;
return <RevealMedia link={a} creator={creator} disableSpotlight={disableMediaSpotlight} />;
} else if (tweetId) {
return (
<div className="tweet" key={tweetId}>