mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix eslint
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Outlet, Route, Routes, useLocation, useNavigate, useParams } from 'react-router-dom';
|
import { Outlet, Route, Routes, useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||||
import { useAccountComment, useAccountComments } from '@plebbit/plebbit-react-hooks';
|
import { useAccountComment, useAccountComments } from '@plebbit/plebbit-react-hooks';
|
||||||
import { initSnow, removeSnow, shouldShowSnow } from './lib/snow';
|
import { initSnow, removeSnow } from './lib/snow';
|
||||||
import { isAllView, isSubscriptionsView } from './lib/utils/view-utils';
|
import { isAllView, isSubscriptionsView } from './lib/utils/view-utils';
|
||||||
import useIsMobile from './hooks/use-is-mobile';
|
import useIsMobile from './hooks/use-is-mobile';
|
||||||
import useTheme from './hooks/use-theme';
|
import useTheme from './hooks/use-theme';
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }:
|
|||||||
|
|
||||||
const PostMedia = ({ post, hasThumbnail }: PostProps) => {
|
const PostMedia = ({ post, hasThumbnail }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { link, spoiler, cid } = post || {};
|
const { spoiler, cid } = post || {};
|
||||||
|
|
||||||
// Reset state by remounting component when post changes
|
// Reset state by remounting component when post changes
|
||||||
return <PostMediaContent key={cid} post={post} hasThumbnail={hasThumbnail} spoiler={spoiler} t={t} />;
|
return <PostMediaContent key={cid} post={post} hasThumbnail={hasThumbnail} spoiler={spoiler} t={t} />;
|
||||||
@@ -470,7 +470,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<div data-cid={cid} data-author-address={author?.shortAddress} data-post-cid={postCid} className={shouldShowSnow() && hasThumbnail ? styles.xmasHatWrapper : ''}>
|
<div data-cid={cid} data-author-address={author?.shortAddress} data-post-cid={postCid} className={shouldShowSnow() && hasThumbnail ? styles.xmasHatWrapper : ''}>
|
||||||
{shouldShowSnow() && hasThumbnail && <img src={`${process.env.PUBLIC_URL}/assets/xmashat.gif`} className={styles.xmasHat} />}
|
{shouldShowSnow() && hasThumbnail && <img src={`${process.env.PUBLIC_URL}/assets/xmashat.gif`} className={styles.xmasHat} alt='' />}
|
||||||
{link && !isHidden && !(deleted || removed) && isValidURL(link) && <PostMedia post={post} hasThumbnail={hasThumbnail} />}
|
{link && !isHidden && !(deleted || removed) && isValidURL(link) && <PostMedia post={post} hasThumbnail={hasThumbnail} />}
|
||||||
<PostInfo isHidden={hidden} openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
<PostInfo isHidden={hidden} openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
||||||
{!isHidden && !content && !(deleted || removed) && <div className={styles.spacer} />}
|
{!isHidden && !content && !(deleted || removed) && <div className={styles.spacer} />}
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies =
|
|||||||
data-author-address={author?.shortAddress}
|
data-author-address={author?.shortAddress}
|
||||||
data-post-cid={postCid}
|
data-post-cid={postCid}
|
||||||
>
|
>
|
||||||
{shouldShowSnow() && <img src={`${process.env.PUBLIC_URL}/assets/xmashat.gif`} className={styles.xmasHat} />}
|
{shouldShowSnow() && <img src={`${process.env.PUBLIC_URL}/assets/xmashat.gif`} className={styles.xmasHat} alt='' />}
|
||||||
<PostInfoAndMedia openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
<PostInfoAndMedia openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
||||||
<PostMessageMobile post={post} />
|
<PostMessageMobile post={post} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const useTheme = (): [string, (theme: string) => void] => {
|
|||||||
setCurrentTheme('tomorrow');
|
setCurrentTheme('tomorrow');
|
||||||
updateThemeClass('tomorrow');
|
updateThemeClass('tomorrow');
|
||||||
}
|
}
|
||||||
}, [isEnabled, setIsEnabled, params, pendingPostSubplebbitAddress, location.pathname]);
|
}, [isEnabled, setIsEnabled, params, pendingPostSubplebbitAddress, location.pathname, isInAllView, isInSubscriptionsView]);
|
||||||
|
|
||||||
const getCurrentTheme = useCallback(() => {
|
const getCurrentTheme = useCallback(() => {
|
||||||
const { isEnabled } = useSpecialThemeStore.getState();
|
const { isEnabled } = useSpecialThemeStore.getState();
|
||||||
|
|||||||
Reference in New Issue
Block a user