mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix state labels to reflect precise state
This commit is contained in:
@@ -1,19 +1,8 @@
|
|||||||
import React
|
import React from "react";
|
||||||
// , { useState, useEffect }
|
|
||||||
from "react";
|
|
||||||
import { useAccountComment } from "@plebbit/plebbit-react-hooks";
|
import { useAccountComment } from "@plebbit/plebbit-react-hooks";
|
||||||
// import useStateString from "../hooks/useStateString";
|
|
||||||
|
|
||||||
const PendingLabel = ({ commentIndex }) => {
|
const PendingLabel = ({ commentIndex }) => {
|
||||||
const comment = useAccountComment({commentIndex: commentIndex});
|
const comment = useAccountComment({commentIndex: commentIndex});
|
||||||
// const stateString = useStateString(comment);
|
|
||||||
|
|
||||||
// const [isLoading, setIsLoading] = useState(true);
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const timer = setTimeout(() => setIsLoading(false), 2000);
|
|
||||||
// return () => clearTimeout(timer);
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
if (commentIndex === undefined) return null;
|
if (commentIndex === undefined) return null;
|
||||||
|
|
||||||
@@ -21,16 +10,16 @@ const PendingLabel = ({ commentIndex }) => {
|
|||||||
comment.cid ? (
|
comment.cid ? (
|
||||||
<span>{comment.cid.slice(2, 14)}</span>
|
<span>{comment.cid.slice(2, 14)}</span>
|
||||||
) : (
|
) : (
|
||||||
(comment.state === "failed"
|
comment.state === "pending" ? (
|
||||||
// || (stateString === undefined && !isLoading)
|
|
||||||
) ? (
|
|
||||||
<span style={{color: 'red', fontWeight: '700'}}>
|
|
||||||
Failed
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<span style={{color: 'red', fontWeight: '700'}}>
|
<span style={{color: 'red', fontWeight: '700'}}>
|
||||||
Pending
|
Pending
|
||||||
</span>
|
</span>
|
||||||
|
) : (
|
||||||
|
comment.state === "failed" ? (
|
||||||
|
<span style={{color: 'red', fontWeight: '700'}}>
|
||||||
|
Failed
|
||||||
|
</span>
|
||||||
|
) : null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,13 +21,7 @@ const StateLabel = ({ commentIndex, className }) => {
|
|||||||
null
|
null
|
||||||
) : (
|
) : (
|
||||||
stateString === undefined && !isLoading && comment.cid === undefined ? (
|
stateString === undefined && !isLoading && comment.cid === undefined ? (
|
||||||
<span className="ttl">
|
null
|
||||||
<br />
|
|
||||||
(
|
|
||||||
<span className={className}>
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
</span>
|
|
||||||
) : (
|
) : (
|
||||||
<span className="ttl">
|
<span className="ttl">
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Reference in New Issue
Block a user