mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat: add '(You)' in quote links
This commit is contained in:
@@ -153,7 +153,7 @@ const Markdown = ({ content, spoiler }: MarkdownProps) => {
|
|||||||
remarkPlugins={remarkPlugins}
|
remarkPlugins={remarkPlugins}
|
||||||
rehypePlugins={[[rehypeSanitize, customSchema]]}
|
rehypePlugins={[[rehypeSanitize, customSchema]]}
|
||||||
components={{
|
components={{
|
||||||
p: ({ children }) => <p className=''>{spoiler ? <span className={styles.spoiler}>{children}</span> : children}</p>,
|
p: ({ children }) => <p>{spoiler ? <span className={styles.spoiler}>{children}</span> : children}</p>,
|
||||||
img: ({ src }) => <span>{src}</span>,
|
img: ({ src }) => <span>{src}</span>,
|
||||||
video: ({ src }) => <span>{src}</span>,
|
video: ({ src }) => <span>{src}</span>,
|
||||||
iframe: ({ src }) => <span>{src}</span>,
|
iframe: ({ src }) => <span>{src}</span>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Comment } from '@plebbit/plebbit-react-hooks';
|
import { Comment, useAccount } from '@plebbit/plebbit-react-hooks';
|
||||||
import { useFloating, offset, shift, size, autoUpdate, Placement } from '@floating-ui/react';
|
import { useFloating, offset, shift, size, autoUpdate, Placement } from '@floating-ui/react';
|
||||||
import useIsMobile from '../../../hooks/use-is-mobile';
|
import useIsMobile from '../../../hooks/use-is-mobile';
|
||||||
import styles from '../post.module.css';
|
import styles from '../post.module.css';
|
||||||
@@ -119,6 +119,8 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const account = useAccount();
|
||||||
|
|
||||||
const replyQuotelink = (
|
const replyQuotelink = (
|
||||||
<>
|
<>
|
||||||
<Link
|
<Link
|
||||||
@@ -129,6 +131,7 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i
|
|||||||
onMouseLeave={() => handleMouseLeave(quotelinkReply?.cid)}
|
onMouseLeave={() => handleMouseLeave(quotelinkReply?.cid)}
|
||||||
>
|
>
|
||||||
{`c/${quotelinkReply?.shortCid}`}
|
{`c/${quotelinkReply?.shortCid}`}
|
||||||
|
{quotelinkReply?.author?.address === account?.author?.address && ' (You)'}
|
||||||
</Link>
|
</Link>
|
||||||
<br />
|
<br />
|
||||||
{hoveredCid === quotelinkReply?.cid &&
|
{hoveredCid === quotelinkReply?.cid &&
|
||||||
@@ -204,6 +207,8 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const account = useAccount();
|
||||||
|
|
||||||
const replyQuotelink = (
|
const replyQuotelink = (
|
||||||
<>
|
<>
|
||||||
<span
|
<span
|
||||||
@@ -212,9 +217,11 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is
|
|||||||
onMouseOver={() => handleMouseOver(quotelinkReply?.cid)}
|
onMouseOver={() => handleMouseOver(quotelinkReply?.cid)}
|
||||||
onMouseLeave={() => handleMouseLeave(quotelinkReply?.cid)}
|
onMouseLeave={() => handleMouseLeave(quotelinkReply?.cid)}
|
||||||
>
|
>
|
||||||
c/{quotelinkReply?.shortCid}{' '}
|
c/{quotelinkReply?.shortCid}
|
||||||
|
{quotelinkReply?.author?.address === account?.author?.address && ' (You)'}
|
||||||
</span>
|
</span>
|
||||||
<Link className={styles.quoteLink} to={`/p/${quotelinkReply?.subplebbitAddress}/c/${quotelinkReply?.cid}`}>
|
<Link className={styles.quoteLink} to={`/p/${quotelinkReply?.subplebbitAddress}/c/${quotelinkReply?.cid}`}>
|
||||||
|
{' '}
|
||||||
#
|
#
|
||||||
</Link>
|
</Link>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Reference in New Issue
Block a user