Change invite rendering logic.

Handle link warnings on embeds.
Remove "EDIT!!" 🙏🙏🙏
This commit is contained in:
Paul
2021-09-03 13:04:37 +01:00
parent 571b30243c
commit 2ccc0b7b5e
7 changed files with 219 additions and 179 deletions

View File

@@ -22,7 +22,7 @@ const MAX_PREVIEW_SIZE = 150;
export default function Embed({ embed }: Props) {
const client = useClient();
const { openScreen } = useIntermediate();
const { openScreen, openLink } = useIntermediate();
const maxWidth = Math.min(
useContext(MessageAreaWidthContext) - CONTAINER_PADDING,
MAX_EMBED_WIDTH,
@@ -111,6 +111,10 @@ export default function Embed({ embed }: Props) {
{embed.title && (
<span>
<a
onClick={(e) =>
openLink(e.currentTarget.href) &&
e.preventDefault()
}
href={embed.url}
target={"_blank"}
className={styles.title}