mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(catalog post): add hidden style
This commit is contained in:
@@ -16,6 +16,10 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.mediaPaddingWrapper {
|
.mediaPaddingWrapper {
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import { useFloating, offset, shift, size, autoUpdate, Placement } from '@floati
|
|||||||
import { getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils';
|
import { getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils';
|
||||||
import { getFormattedTimeAgo } from '../../lib/utils/time-utils';
|
import { getFormattedTimeAgo } from '../../lib/utils/time-utils';
|
||||||
import { isAllView } from '../../lib/utils/view-utils';
|
import { isAllView } from '../../lib/utils/view-utils';
|
||||||
import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame';
|
|
||||||
import useCountLinksInReplies from '../../hooks/use-count-links-in-replies';
|
|
||||||
import useEditCommentPrivileges from '../../hooks/use-author-privileges';
|
import useEditCommentPrivileges from '../../hooks/use-author-privileges';
|
||||||
|
import useCountLinksInReplies from '../../hooks/use-count-links-in-replies';
|
||||||
|
import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame';
|
||||||
|
import useHide from '../../hooks/use-hide';
|
||||||
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';
|
||||||
@@ -85,6 +86,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
post || {};
|
post || {};
|
||||||
const commentMediaInfo = getCommentMediaInfo(post);
|
const commentMediaInfo = getCommentMediaInfo(post);
|
||||||
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
||||||
|
const { hidden } = useHide({ cid });
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const isInAllView = isAllView(location.pathname);
|
const isInAllView = isAllView(location.pathname);
|
||||||
@@ -154,7 +156,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
subplebbitAddress,
|
subplebbitAddress,
|
||||||
});
|
});
|
||||||
|
|
||||||
const postContent = (
|
const postContent = !hidden && (
|
||||||
<div className={styles.teaser}>
|
<div className={styles.teaser}>
|
||||||
<b>{title && `${title}${content ? ': ' : ''}`}</b>
|
<b>{title && `${title}${content ? ': ' : ''}`}</b>
|
||||||
{content}
|
{content}
|
||||||
@@ -163,9 +165,9 @@ const CatalogPost = ({ post }: { post: Comment }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.post}>
|
<div className={`${styles.post} ${hidden && styles.hidden}`}>
|
||||||
<div onMouseOver={() => setHoveredCid(isDescription ? 'd' : isRules ? 'r' : cid)} onMouseLeave={() => setHoveredCid(null)}>
|
<div onMouseOver={() => setHoveredCid(isDescription ? 'd' : isRules ? 'r' : cid)} onMouseLeave={() => setHoveredCid(null)}>
|
||||||
{hasThumbnail ? (
|
{hasThumbnail && !hidden ? (
|
||||||
<Link to={postLink}>
|
<Link to={postLink}>
|
||||||
<div
|
<div
|
||||||
className={styles.mediaPaddingWrapper}
|
className={styles.mediaPaddingWrapper}
|
||||||
|
|||||||
Reference in New Issue
Block a user