mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
perf(components): memoize post menus with minimal props
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useLocation, useParams } from 'react-router-dom';
|
import { Link, useLocation, useParams } from 'react-router-dom';
|
||||||
@@ -24,6 +24,7 @@ import { ContentPreview } from '../../views/home/popular-threads-box';
|
|||||||
import PostMenuDesktop from '../post-desktop/post-menu-desktop';
|
import PostMenuDesktop from '../post-desktop/post-menu-desktop';
|
||||||
import styles from './catalog-row.module.css';
|
import styles from './catalog-row.module.css';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
|
||||||
|
|
||||||
interface CatalogPostMediaProps {
|
interface CatalogPostMediaProps {
|
||||||
cid: string;
|
cid: string;
|
||||||
@@ -142,6 +143,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
const isInSubscriptionsView = isSubscriptionsView(location.pathname, params);
|
const isInSubscriptionsView = isSubscriptionsView(location.pathname, params);
|
||||||
const defaultSubplebbits = useDefaultSubplebbits();
|
const defaultSubplebbits = useDefaultSubplebbits();
|
||||||
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : '';
|
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : '';
|
||||||
|
const postMenuProps = useMemo(() => selectPostMenuProps(post), [post]);
|
||||||
|
|
||||||
const postLink = isInAllView && isDescription ? '/all/description' : `/${boardPath}/${isDescription ? 'description' : isRules ? 'rules' : `thread/${cid}`}`;
|
const postLink = isInAllView && isDescription ? '/all/description' : `/${boardPath}/${isDescription ? 'description' : isRules ? 'rules' : `thread/${cid}`}`;
|
||||||
|
|
||||||
@@ -287,7 +289,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span className={`${styles.postMenu} ${hoveredCid && styles.postMenuVisible}`}>
|
<span className={`${styles.postMenu} ${hoveredCid && styles.postMenuVisible}`}>
|
||||||
<PostMenuDesktop post={post} />
|
<PostMenuDesktop postMenu={postMenuProps} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.postContent}>{(showOPComment || isTextOnlyThread) && (hasThumbnail ? postContent : <Link to={postLink}>{postContent}</Link>)}</div>
|
<div className={styles.postContent}>{(showOPComment || isTextOnlyThread) && (hasThumbnail ? postContent : <Link to={postLink}>{postContent}</Link>)}</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import { Trans, useTranslation } from 'react-i18next';
|
import { Trans, useTranslation } from 'react-i18next';
|
||||||
import { Link, useLocation, useParams } from 'react-router-dom';
|
import { Link, useLocation, useParams } from 'react-router-dom';
|
||||||
import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks';
|
import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks';
|
||||||
@@ -33,6 +33,7 @@ import { create } from 'zustand';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { shouldShowSnow } from '../../lib/snow';
|
import { shouldShowSnow } from '../../lib/snow';
|
||||||
import useReplyModalStore from '../../stores/use-reply-modal-store';
|
import useReplyModalStore from '../../stores/use-reply-modal-store';
|
||||||
|
import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
|
||||||
|
|
||||||
interface ShowOmittedRepliesState {
|
interface ShowOmittedRepliesState {
|
||||||
showOmittedReplies: Record<string, boolean>;
|
showOmittedReplies: Record<string, boolean>;
|
||||||
@@ -66,6 +67,7 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
|
|||||||
const { hideAvatars } = useAvatarVisibilityStore();
|
const { hideAvatars } = useAvatarVisibilityStore();
|
||||||
const defaultSubplebbits = useDefaultSubplebbits();
|
const defaultSubplebbits = useDefaultSubplebbits();
|
||||||
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : undefined;
|
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : undefined;
|
||||||
|
const postMenuProps = useMemo(() => selectPostMenuProps(post), [post]);
|
||||||
|
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -226,7 +228,7 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
{!(removed || deleted) && <PostMenuDesktop post={post} />}
|
{!(removed || deleted) && <PostMenuDesktop postMenu={postMenuProps} />}
|
||||||
{cid &&
|
{cid &&
|
||||||
parentCid &&
|
parentCid &&
|
||||||
replies &&
|
replies &&
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { useState } from 'react';
|
import { memo, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { useLocation, useParams } from 'react-router-dom';
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { autoUpdate, flip, FloatingFocusManager, offset, shift, useClick, useDismiss, useFloating, useId, useInteractions, useRole } from '@floating-ui/react';
|
import { autoUpdate, flip, FloatingFocusManager, offset, shift, useClick, useDismiss, useFloating, useId, useInteractions, useRole } from '@floating-ui/react';
|
||||||
import { Comment, useBlock } from '@plebbit/plebbit-react-hooks';
|
import { useBlock } from '@plebbit/plebbit-react-hooks';
|
||||||
import styles from './post-menu-desktop.module.css';
|
import styles from './post-menu-desktop.module.css';
|
||||||
import { getCommentMediaInfo } from '../../../lib/utils/media-utils';
|
import { getCommentMediaInfo } from '../../../lib/utils/media-utils';
|
||||||
import { copyShareLinkToClipboard, isValidURL, type ShareLinkType } from '../../../lib/utils/url-utils';
|
import { copyShareLinkToClipboard, isValidURL, type ShareLinkType } from '../../../lib/utils/url-utils';
|
||||||
@@ -12,14 +12,7 @@ import { useDefaultSubplebbits } from '../../../hooks/use-default-subplebbits';
|
|||||||
import { isAllView, isCatalogView, isPostPageView, isSubscriptionsView } from '../../../lib/utils/view-utils';
|
import { isAllView, isCatalogView, isPostPageView, isSubscriptionsView } from '../../../lib/utils/view-utils';
|
||||||
import useHide from '../../../hooks/use-hide';
|
import useHide from '../../../hooks/use-hide';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import { PostMenuProps } from '../../../lib/utils/post-menu-props';
|
||||||
interface PostMenuDesktopProps {
|
|
||||||
cid: string;
|
|
||||||
isDescription?: boolean;
|
|
||||||
isRules?: boolean;
|
|
||||||
subplebbitAddress: string;
|
|
||||||
onClose: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CopyLinkButton = ({ cid, subplebbitAddress, linkType, onClose }: { cid?: string; subplebbitAddress: string; linkType: ShareLinkType; onClose: () => void }) => {
|
const CopyLinkButton = ({ cid, subplebbitAddress, linkType, onClose }: { cid?: string; subplebbitAddress: string; linkType: ShareLinkType; onClose: () => void }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -92,14 +85,19 @@ const BlockBoardButton = ({ address }: { address: string }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const PostMenuDesktop = ({ post }: { post: Comment }) => {
|
type PostMenuDesktopProps = {
|
||||||
|
postMenu: PostMenuProps;
|
||||||
|
};
|
||||||
|
|
||||||
|
const PostMenuDesktop = ({ postMenu }: PostMenuDesktopProps) => {
|
||||||
|
console.log('postMenu rerender', postMenu);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { author, cid, isDescription, isRules, link, thumbnailUrl, linkWidth, linkHeight, postCid, subplebbitAddress } = post || {};
|
const { authorAddress, cid, isDescription, isRules, link, thumbnailUrl, linkWidth, linkHeight, postCid, subplebbitAddress } = postMenu || {};
|
||||||
const commentMediaInfo = getCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight);
|
const commentMediaInfo = getCommentMediaInfo(link || '', thumbnailUrl || '', linkWidth ?? 0, linkHeight ?? 0);
|
||||||
const { thumbnail, type, url } = commentMediaInfo || {};
|
const { thumbnail, type, url } = commentMediaInfo || {};
|
||||||
const [menuBtnRotated, setMenuBtnRotated] = useState(false);
|
const [menuBtnRotated, setMenuBtnRotated] = useState(false);
|
||||||
|
|
||||||
const { hidden, unhide, hide } = useHide({ cid });
|
const { hidden, unhide, hide } = useHide({ cid: cid || '' });
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
@@ -161,8 +159,8 @@ const PostMenuDesktop = ({ post }: { post: Comment }) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{link && isValidURL(link) && (type === 'image' || type === 'gif' || thumbnail) && url && <ImageSearchButton url={url} onClose={handleClose} />}
|
{link && isValidURL(link) && (type === 'image' || type === 'gif' || thumbnail) && url && <ImageSearchButton url={url} onClose={handleClose} />}
|
||||||
{!isDescription && !isRules && <BlockUserButton address={author?.address} />}
|
{!isDescription && !isRules && authorAddress && <BlockUserButton address={authorAddress} />}
|
||||||
{(isInAllView || isInSubscriptionsView) && <BlockBoardButton address={subplebbitAddress} />}
|
{(isInAllView || isInSubscriptionsView) && subplebbitAddress && <BlockBoardButton address={subplebbitAddress} />}
|
||||||
</div>
|
</div>
|
||||||
</FloatingFocusManager>,
|
</FloatingFocusManager>,
|
||||||
document.body,
|
document.body,
|
||||||
@@ -171,4 +169,4 @@ const PostMenuDesktop = ({ post }: { post: Comment }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PostMenuDesktop;
|
export default memo(PostMenuDesktop);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from 'react';
|
import { memo, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Comment, useBlock } from '@plebbit/plebbit-react-hooks';
|
import { Comment, useBlock } from '@plebbit/plebbit-react-hooks';
|
||||||
@@ -13,16 +13,14 @@ import useHide from '../../../hooks/use-hide';
|
|||||||
import EditMenu from '../../edit-menu/edit-menu';
|
import EditMenu from '../../edit-menu/edit-menu';
|
||||||
import { isBoardView, isPostPageView } from '../../../lib/utils/view-utils';
|
import { isBoardView, isPostPageView } from '../../../lib/utils/view-utils';
|
||||||
import { useLocation, useParams } from 'react-router-dom';
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
|
import { PostMenuProps } from '../../../lib/utils/post-menu-props';
|
||||||
|
|
||||||
interface PostMenuMobileProps {
|
type HideButtonProps = {
|
||||||
cid: string;
|
cid?: string;
|
||||||
isDescription?: boolean;
|
|
||||||
isReply?: boolean;
|
isReply?: boolean;
|
||||||
isRules?: boolean;
|
|
||||||
postCid?: string;
|
postCid?: string;
|
||||||
subplebbitAddress?: string;
|
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
}
|
};
|
||||||
|
|
||||||
const CopyLinkButton = ({ cid, subplebbitAddress, linkType, onClose }: { cid?: string; subplebbitAddress: string; linkType: ShareLinkType; onClose: () => void }) => {
|
const CopyLinkButton = ({ cid, subplebbitAddress, linkType, onClose }: { cid?: string; subplebbitAddress: string; linkType: ShareLinkType; onClose: () => void }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -57,7 +55,7 @@ const ImageSearchButtons = ({ url, onClose }: { url: string; onClose: () => void
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const HidePostButton = ({ cid, isReply, onClose, postCid }: PostMenuMobileProps) => {
|
const HidePostButton = ({ cid, isReply, onClose, postCid }: HideButtonProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { hide, hidden, unhide } = useHide({ cid });
|
const { hide, hidden, unhide } = useHide({ cid });
|
||||||
const isInPostView = isPostPageView(useLocation().pathname, useParams());
|
const isInPostView = isPostPageView(useLocation().pathname, useParams());
|
||||||
@@ -98,9 +96,15 @@ const BlockBoardButton = ({ address }: { address: string }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const PostMenuMobile = ({ post }: { post: Comment }) => {
|
type PostMenuMobileProps = {
|
||||||
const { author, cid, deleted, isDescription, isRules, link, linkHeight, linkWidth, parentCid, postCid, removed, subplebbitAddress, thumbnailUrl } = post || {};
|
postMenu: PostMenuProps;
|
||||||
const { isAccountMod, isAccountCommentAuthor } = useEditCommentPrivileges({ commentAuthorAddress: author?.address, subplebbitAddress });
|
editMenuPost: Comment;
|
||||||
|
};
|
||||||
|
|
||||||
|
const PostMenuMobile = ({ postMenu, editMenuPost }: PostMenuMobileProps) => {
|
||||||
|
const { authorAddress, cid, deleted, isDescription, isRules, link, linkHeight, linkWidth, parentCid, postCid, removed, subplebbitAddress, thumbnailUrl } =
|
||||||
|
postMenu || {};
|
||||||
|
const { isAccountMod, isAccountCommentAuthor } = useEditCommentPrivileges({ commentAuthorAddress: authorAddress, subplebbitAddress });
|
||||||
const commentMediaInfo = getCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight);
|
const commentMediaInfo = getCommentMediaInfo(link, thumbnailUrl, linkWidth, linkHeight);
|
||||||
const { thumbnail, type, url } = commentMediaInfo || {};
|
const { thumbnail, type, url } = commentMediaInfo || {};
|
||||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
@@ -142,8 +146,8 @@ const PostMenuMobile = ({ post }: { post: Comment }) => {
|
|||||||
{cid && subplebbitAddress && <CopyLinkButton cid={cid} subplebbitAddress={subplebbitAddress} linkType='thread' onClose={handleClose} />}
|
{cid && subplebbitAddress && <CopyLinkButton cid={cid} subplebbitAddress={subplebbitAddress} linkType='thread' onClose={handleClose} />}
|
||||||
{!cid && isDescription && subplebbitAddress && <CopyLinkButton subplebbitAddress={subplebbitAddress} linkType='description' onClose={handleClose} />}
|
{!cid && isDescription && subplebbitAddress && <CopyLinkButton subplebbitAddress={subplebbitAddress} linkType='description' onClose={handleClose} />}
|
||||||
{!cid && isRules && subplebbitAddress && <CopyLinkButton subplebbitAddress={subplebbitAddress} linkType='rules' onClose={handleClose} />}
|
{!cid && isRules && subplebbitAddress && <CopyLinkButton subplebbitAddress={subplebbitAddress} linkType='rules' onClose={handleClose} />}
|
||||||
{cid && subplebbitAddress && <HidePostButton cid={cid} isReply={parentCid} postCid={postCid} onClose={handleClose} />}
|
{cid && subplebbitAddress && <HidePostButton cid={cid} isReply={!!parentCid} postCid={postCid} onClose={handleClose} />}
|
||||||
{cid && subplebbitAddress && !isDescription && !isRules && <BlockUserButton address={author?.address} />}
|
{cid && subplebbitAddress && !isDescription && !isRules && authorAddress && <BlockUserButton address={authorAddress} />}
|
||||||
{cid && subplebbitAddress && !isInBoardView && !isDescription && !isRules && <BlockBoardButton address={subplebbitAddress} />}
|
{cid && subplebbitAddress && !isInBoardView && !isDescription && !isRules && <BlockBoardButton address={subplebbitAddress} />}
|
||||||
{link && isValidURL(link) && (type === 'image' || type === 'gif' || thumbnail) && url && <ImageSearchButtons url={url} onClose={handleClose} />}
|
{link && isValidURL(link) && (type === 'image' || type === 'gif' || thumbnail) && url && <ImageSearchButtons url={url} onClose={handleClose} />}
|
||||||
</div>
|
</div>
|
||||||
@@ -154,11 +158,11 @@ const PostMenuMobile = ({ post }: { post: Comment }) => {
|
|||||||
)}
|
)}
|
||||||
{(isAccountMod || isAccountCommentAuthor) && cid && (
|
{(isAccountMod || isAccountCommentAuthor) && cid && (
|
||||||
<span className={styles.checkbox}>
|
<span className={styles.checkbox}>
|
||||||
<EditMenu post={post} />
|
<EditMenu post={editMenuPost} />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PostMenuMobile;
|
export default memo(PostMenuMobile);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useLocation, useParams } from 'react-router-dom';
|
import { Link, useLocation, useParams } from 'react-router-dom';
|
||||||
import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks';
|
import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks';
|
||||||
@@ -28,6 +28,7 @@ import Tooltip from '../tooltip';
|
|||||||
import { PostProps } from '../../views/post/post';
|
import { PostProps } from '../../views/post/post';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import useReplyModalStore from '../../stores/use-reply-modal-store';
|
import useReplyModalStore from '../../stores/use-reply-modal-store';
|
||||||
|
import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
|
||||||
|
|
||||||
const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -71,6 +72,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
|||||||
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
||||||
|
|
||||||
const stateString = useStateString(post);
|
const stateString = useStateString(post);
|
||||||
|
const postMenuProps = useMemo(() => selectPostMenuProps(post), [post]);
|
||||||
|
|
||||||
const handleUserAddressClick = useAuthorAddressClick();
|
const handleUserAddressClick = useAuthorAddressClick();
|
||||||
const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`).length;
|
const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`).length;
|
||||||
@@ -98,7 +100,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.postInfo}>
|
<div className={styles.postInfo}>
|
||||||
<PostMenuMobile post={post} />
|
<PostMenuMobile postMenu={postMenuProps} editMenuPost={post} />
|
||||||
<span className={(hidden || ((removed || deleted) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
|
<span className={(hidden || ((removed || deleted) && !reason)) && parentCid ? styles.postDesktopHidden : ''}>
|
||||||
<span className={styles.nameBlock}>
|
<span className={styles.nameBlock}>
|
||||||
<span className={`${styles.name} ${authorRole && !(deleted || removed) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
|
<span className={`${styles.name} ${authorRole && !(deleted || removed) && (authorRole === 'mod' ? styles.capcodeMod : styles.capcodeAdmin)}`}>
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { Comment } from '@plebbit/plebbit-react-hooks';
|
||||||
|
|
||||||
|
export type PostMenuProps = {
|
||||||
|
cid?: string;
|
||||||
|
postCid?: string;
|
||||||
|
parentCid?: string;
|
||||||
|
subplebbitAddress?: string;
|
||||||
|
isDescription?: boolean;
|
||||||
|
isRules?: boolean;
|
||||||
|
authorAddress?: string;
|
||||||
|
link?: string;
|
||||||
|
linkWidth?: number;
|
||||||
|
linkHeight?: number;
|
||||||
|
thumbnailUrl?: string;
|
||||||
|
deleted?: boolean;
|
||||||
|
removed?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const selectPostMenuProps = (post?: Comment): PostMenuProps => ({
|
||||||
|
cid: post?.cid,
|
||||||
|
postCid: post?.postCid,
|
||||||
|
parentCid: post?.parentCid,
|
||||||
|
subplebbitAddress: post?.subplebbitAddress,
|
||||||
|
isDescription: post?.isDescription,
|
||||||
|
isRules: post?.isRules,
|
||||||
|
authorAddress: post?.author?.address,
|
||||||
|
link: post?.link,
|
||||||
|
linkWidth: post?.linkWidth,
|
||||||
|
linkHeight: post?.linkHeight,
|
||||||
|
thumbnailUrl: post?.thumbnailUrl,
|
||||||
|
deleted: post?.deleted,
|
||||||
|
removed: post?.removed,
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user