mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
implement useSubplebbitsPagesStore instead of prop from useReplies
This commit is contained in:
@@ -10,6 +10,7 @@ import PostMobile from '../../components/post-mobile';
|
||||
import SubplebbitDescription from '../../components/subplebbit-description';
|
||||
import SubplebbitRules from '../../components/subplebbit-rules';
|
||||
import styles from './post.module.css';
|
||||
|
||||
export interface PostProps {
|
||||
index?: number;
|
||||
isHidden?: boolean;
|
||||
@@ -20,10 +21,9 @@ export interface PostProps {
|
||||
roles?: Role[];
|
||||
showAllReplies?: boolean;
|
||||
showReplies?: boolean;
|
||||
replies?: Comment[];
|
||||
}
|
||||
|
||||
export const Post = ({ post, showAllReplies = false, showReplies = true, replies }: PostProps) => {
|
||||
export const Post = ({ post, showAllReplies = false, showReplies = true }: PostProps) => {
|
||||
const subplebbit = useSubplebbitsStore((state) => state.subplebbits[post?.subplebbitAddress]);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
@@ -39,9 +39,9 @@ export const Post = ({ post, showAllReplies = false, showReplies = true, replies
|
||||
<div className={styles.thread}>
|
||||
<div className={styles.postContainer}>
|
||||
{isMobile ? (
|
||||
<PostMobile post={comment} roles={subplebbit?.roles} showAllReplies={showAllReplies} showReplies={showReplies} replies={replies} />
|
||||
<PostMobile post={comment} roles={subplebbit?.roles} showAllReplies={showAllReplies} showReplies={showReplies} />
|
||||
) : (
|
||||
<PostDesktop post={comment} roles={subplebbit?.roles} showAllReplies={showAllReplies} showReplies={showReplies} replies={replies} />
|
||||
<PostDesktop post={comment} roles={subplebbit?.roles} showAllReplies={showAllReplies} showReplies={showReplies} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user