mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
perf: improve responsiveness
This commit is contained in:
@@ -384,7 +384,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
@media (min-width: 640px) {
|
||||
.postMobile {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { getFormattedDate } from '../../lib/utils/time-utils';
|
||||
import { isPostPageView } from '../../lib/utils/view-utils';
|
||||
import useCountLinksInReplies from '../../hooks/use-count-links-in-replies';
|
||||
import useReplies from '../../hooks/use-replies';
|
||||
import useWindowWidth from '../../hooks/use-window-width';
|
||||
import styles from './post.module.css';
|
||||
import Markdown from '../markdown';
|
||||
import CommentMedia from '../comment-media';
|
||||
@@ -417,11 +418,15 @@ const ReplyMobile = ({ reply, roles }: PostProps) => {
|
||||
|
||||
const Post = ({ post, showAllReplies = false }: PostProps) => {
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress: post?.subplebbitAddress });
|
||||
const isMobile = useWindowWidth() < 640;
|
||||
return (
|
||||
<div className={styles.thread}>
|
||||
<div className={styles.postContainer}>
|
||||
<PostDesktop post={post} roles={subplebbit?.roles} showAllReplies={showAllReplies} />
|
||||
<PostMobile post={post} roles={subplebbit?.roles} showAllReplies={showAllReplies} />
|
||||
{isMobile ? (
|
||||
<PostMobile post={post} roles={subplebbit?.roles} showAllReplies={showAllReplies} />
|
||||
) : (
|
||||
<PostDesktop post={post} roles={subplebbit?.roles} showAllReplies={showAllReplies} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user