chore: prettify, fix eslint

This commit is contained in:
plebeius.eth
2023-12-09 22:25:20 +01:00
parent af2c6b6e4d
commit e2cbaccfa3
3 changed files with 13 additions and 19 deletions

View File

@@ -263,14 +263,14 @@ const Header = () => {
<SubscribeButton address={params.subplebbitAddress} />
</span>
)}
{!isMobile && (
<div className={`${styles.tabs} ${hasFewTabs ? styles.fewTabs : ''}`}>
<ul className={styles.tabMenu}>
<HeaderTabs />
{(isSubplebbit || isSubplebbitSubmit || isPost || isProfile || isAuthor) && <AboutButton />}
</ul>
</div>
)}
{!isMobile && (
<div className={`${styles.tabs} ${hasFewTabs ? styles.fewTabs : ''}`}>
<ul className={styles.tabMenu}>
<HeaderTabs />
{(isSubplebbit || isSubplebbitSubmit || isPost || isProfile || isAuthor) && <AboutButton />}
</ul>
</div>
)}
</div>
{isMobile && (
<div className={`${styles.tabs} ${hasFewTabs ? styles.fewTabs : ''}`}>

View File

@@ -51,7 +51,7 @@ const Author = () => {
increaseViewportBy={{ bottom: 1200, top: 600 }}
totalCount={authorComments?.length || 0}
data={authorComments}
itemContent={(index, post) => (post && <Post index={index} post={post} />)}
itemContent={(index, post) => post && <Post index={index} post={post} />}
useWindowScroll={true}
components={{ Footer }}
endReached={loadMore}

View File

@@ -19,15 +19,9 @@ const Profile = () => {
const isUpvoted = isUpvotedView(location.pathname);
const isDownvoted = isDownvotedView(location.pathname);
const upvotedCommentCids = useMemo(() =>
accountVotes?.filter(vote => vote.vote === 1).map(vote => vote.commentCid) || [],
[accountVotes]
);
const upvotedCommentCids = useMemo(() => accountVotes?.filter((vote) => vote.vote === 1).map((vote) => vote.commentCid) || [], [accountVotes]);
const downvotedCommentCids = useMemo(() =>
accountVotes?.filter(vote => vote.vote === -1).map(vote => vote.commentCid) || [],
[accountVotes]
);
const downvotedCommentCids = useMemo(() => accountVotes?.filter((vote) => vote.vote === -1).map((vote) => vote.commentCid) || [], [accountVotes]);
const { comments: upvotedComments } = useComments({ commentCids: upvotedCommentCids });
const { comments: downvotedComments } = useComments({ commentCids: downvotedCommentCids });
@@ -45,7 +39,7 @@ const Profile = () => {
});
window.addEventListener('scroll', setLastVirtuosoState);
return () => window.removeEventListener('scroll', setLastVirtuosoState);
}, []);
}, [account?.shortAddress, params.sortType]);
const lastVirtuosoState = lastVirtuosoStates?.[account?.shortAddress + params.sortType];
@@ -61,7 +55,7 @@ const Profile = () => {
increaseViewportBy={{ bottom: 1200, top: 600 }}
totalCount={accountComments?.length || 0}
data={virtuosoData}
itemContent={(index, post) => (post && <Post index={index} post={post} />)}
itemContent={(index, post) => post && <Post index={index} post={post} />}
useWindowScroll={true}
ref={virtuosoRef}
restoreStateFrom={lastVirtuosoState}