mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-11 21:29:26 +02:00
dont show open graph cards in user description
This commit is contained in:
parent
af37c07656
commit
c6b1cc3d33
@ -45,5 +45,13 @@ export function renderVideoUrl(match: URL) {
|
||||
}
|
||||
|
||||
export function renderGenericUrl(match: URL) {
|
||||
return (
|
||||
<Link href={match.toString()} isExternal color="blue.500">
|
||||
{match.toString()}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
export function renderOpenGraphUrl(match: URL) {
|
||||
return <OpenGraphCard url={match} maxW="lg" />;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { replaceDomain } from "../../helpers/url";
|
||||
import appSettings from "../../services/app-settings";
|
||||
import { TweetEmbed } from "../tweet-embed";
|
||||
import { renderGenericUrl } from "./common";
|
||||
import { renderOpenGraphUrl } from "./common";
|
||||
|
||||
// copied from https://github.com/SimonBrazell/privacy-redirect/blob/master/src/assets/javascripts/helpers/twitter.js
|
||||
export const TWITTER_DOMAINS = ["twitter.com", "www.twitter.com", "mobile.twitter.com", "pbs.twimg.com"];
|
||||
@ -10,6 +10,6 @@ export function renderTwitterUrl(match: URL) {
|
||||
if (!TWITTER_DOMAINS.includes(match.hostname)) return null;
|
||||
|
||||
const { twitterRedirect } = appSettings.value;
|
||||
if (twitterRedirect) return renderGenericUrl(replaceDomain(match, twitterRedirect));
|
||||
if (twitterRedirect) return renderOpenGraphUrl(replaceDomain(match, twitterRedirect));
|
||||
else return <TweetEmbed href={match.toString()} conversation={false} />;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import {
|
||||
embedNostrHashtags,
|
||||
renderWavlakeUrl,
|
||||
renderYoutubeUrl,
|
||||
renderGenericUrl,
|
||||
renderImageUrl,
|
||||
renderTwitterUrl,
|
||||
renderAppleMusicUrl,
|
||||
@ -19,6 +18,7 @@ import {
|
||||
renderTidalUrl,
|
||||
renderVideoUrl,
|
||||
embedEmoji,
|
||||
renderOpenGraphUrl,
|
||||
} from "../embed-types";
|
||||
import { ImageGalleryProvider } from "../image-gallery";
|
||||
import { useTrusted } from "./trust";
|
||||
@ -38,7 +38,7 @@ function buildContents(event: NostrEvent | DraftNostrEvent, trusted = false) {
|
||||
renderTidalUrl,
|
||||
renderImageUrl,
|
||||
renderVideoUrl,
|
||||
renderGenericUrl,
|
||||
renderOpenGraphUrl,
|
||||
]);
|
||||
|
||||
// bitcoin
|
||||
|
@ -9,5 +9,5 @@ export default function useOpenGraphData(url: URL) {
|
||||
return extractMetaTags(html);
|
||||
} catch (e) {}
|
||||
return null;
|
||||
}, [url]);
|
||||
}, [url.toString()]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user