mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix useComment
This commit is contained in:
@@ -426,7 +426,7 @@ const Board = () => {
|
|||||||
) : null}
|
) : null}
|
||||||
{commentMediaInfo?.type === "video" ? (
|
{commentMediaInfo?.type === "video" ? (
|
||||||
<span key={`fta-${thread.cid}`} className="file-thumb">
|
<span key={`fta-${thread.cid}`} className="file-thumb">
|
||||||
{/* <VideoThumbnail
|
<VideoThumbnail
|
||||||
videoUrl={commentMediaInfo.url}
|
videoUrl={commentMediaInfo.url}
|
||||||
thumbnailHandler={(thumbnail) => {
|
thumbnailHandler={(thumbnail) => {
|
||||||
const img = document.querySelector(`img[key="img-${thread.cid}"]`);
|
const img = document.querySelector(`img[key="img-${thread.cid}"]`);
|
||||||
@@ -434,12 +434,12 @@ const Board = () => {
|
|||||||
img.src = thumbnail;
|
img.src = thumbnail;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/> */}
|
/>
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
{commentMediaInfo?.type === "audio" ? (
|
{commentMediaInfo?.type === "audio" ? (
|
||||||
<span key={`fta-${thread.cid}`} className="file-thumb">
|
<span key={`fta-${thread.cid}`} className="file-thumb">
|
||||||
{/* <audio key={`fti-${thread.cid}`} src={commentMediaInfo.url} alt={commentMediaInfo.type} onError={(e) => e.target.src = fallbackImgUrl} /> */}
|
<audio key={`fti-${thread.cid}`} src={commentMediaInfo.url} alt={commentMediaInfo.type} onError={(e) => e.target.src = fallbackImgUrl} />
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@@ -721,7 +721,7 @@ const Board = () => {
|
|||||||
) : commentMediaInfo.type === "video" ? (
|
) : commentMediaInfo.type === "video" ? (
|
||||||
<div key={`mob-f-${thread.cid}`} className="file-mobile">
|
<div key={`mob-f-${thread.cid}`} className="file-mobile">
|
||||||
<span key={`mob-ft${thread.cid}`} className="file-thumb-mobile">
|
<span key={`mob-ft${thread.cid}`} className="file-thumb-mobile">
|
||||||
{/* <VideoThumbnail
|
<VideoThumbnail
|
||||||
videoUrl={commentMediaInfo.url}
|
videoUrl={commentMediaInfo.url}
|
||||||
thumbnailHandler={(thumbnail) => {
|
thumbnailHandler={(thumbnail) => {
|
||||||
const img = document.querySelector(`img[key="img-${thread.cid}"]`);
|
const img = document.querySelector(`img[key="img-${thread.cid}"]`);
|
||||||
@@ -729,14 +729,14 @@ const Board = () => {
|
|||||||
img.src = thumbnail;
|
img.src = thumbnail;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/> */}
|
/>
|
||||||
<div key={`mob-fi-${thread.cid}`} className="file-info-mobile">{commentMediaInfo.type}</div>
|
<div key={`mob-fi-${thread.cid}`} className="file-info-mobile">{commentMediaInfo.type}</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
) : commentMediaInfo.type === "audio" ? (
|
) : commentMediaInfo.type === "audio" ? (
|
||||||
<div key={`mob-f-${thread.cid}`} className="file-mobile">
|
<div key={`mob-f-${thread.cid}`} className="file-mobile">
|
||||||
<span key={`mob-ft${thread.cid}`} className="file-thumb-mobile">
|
<span key={`mob-ft${thread.cid}`} className="file-thumb-mobile">
|
||||||
{/* <audio key={`mob-img-${thread.cid}`} src={commentMediaInfo.url} alt={commentMediaInfo.type} onError={(e) => e.target.src = fallbackImgUrl} /> */}
|
<audio key={`mob-img-${thread.cid}`} src={commentMediaInfo.url} alt={commentMediaInfo.type} onError={(e) => e.target.src = fallbackImgUrl} />
|
||||||
<div key={`mob-fi-${thread.cid}`} className="file-info-mobile">{commentMediaInfo.type}</div>
|
<div key={`mob-fi-${thread.cid}`} className="file-info-mobile">{commentMediaInfo.type}</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ const Catalog = () => {
|
|||||||
const { subplebbitAddress } = useParams();
|
const { subplebbitAddress } = useParams();
|
||||||
const handleClickForm = useClickForm();
|
const handleClickForm = useClickForm();
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(feed);
|
|
||||||
}, [feed]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSelectedAddress(subplebbitAddress);
|
setSelectedAddress(subplebbitAddress);
|
||||||
|
|||||||
@@ -44,13 +44,17 @@ const Thread = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [prevScrollPos, setPrevScrollPos] = useState(0);
|
const [prevScrollPos, setPrevScrollPos] = useState(0);
|
||||||
const [visible, setVisible] = useState(true);
|
const [visible, setVisible] = useState(true);
|
||||||
const comment = useComment({selectedThread});
|
const comment = useComment({commentCid: selectedThread});
|
||||||
const { subplebbitAddress, threadCid } = useParams();
|
const { subplebbitAddress, threadCid } = useParams();
|
||||||
const handleClickForm = useClickForm();
|
const handleClickForm = useClickForm();
|
||||||
|
|
||||||
const commentMediaInfo = getCommentMediaInfo(comment);
|
const commentMediaInfo = getCommentMediaInfo(comment);
|
||||||
const fallbackImgUrl = "/assets/filedeleted-res.gif";
|
const fallbackImgUrl = "/assets/filedeleted-res.gif";
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// console.log(comment);
|
||||||
|
// }, [comment]);
|
||||||
|
|
||||||
|
|
||||||
// temporary title from JSON, gets subplebbitAddress and threadCid from URL
|
// temporary title from JSON, gets subplebbitAddress and threadCid from URL
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -390,7 +394,7 @@ const Thread = () => {
|
|||||||
<hr />
|
<hr />
|
||||||
</TopBar>
|
</TopBar>
|
||||||
<BoardForm selectedStyle={selectedStyle}>
|
<BoardForm selectedStyle={selectedStyle}>
|
||||||
{comment ? (
|
{comment !== undefined ? (
|
||||||
<>
|
<>
|
||||||
<div className="thread">
|
<div className="thread">
|
||||||
<div className="op-container">
|
<div className="op-container">
|
||||||
|
|||||||
Reference in New Issue
Block a user