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
|
||||
// , { useState, useEffect }
|
||||
from "react";
|
||||
import React from "react";
|
||||
import { useAccountComment } from "@plebbit/plebbit-react-hooks";
|
||||
// import useStateString from "../hooks/useStateString";
|
||||
|
||||
const PendingLabel = ({ 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;
|
||||
|
||||
@@ -21,16 +10,16 @@ const PendingLabel = ({ commentIndex }) => {
|
||||
comment.cid ? (
|
||||
<span>{comment.cid.slice(2, 14)}</span>
|
||||
) : (
|
||||
(comment.state === "failed"
|
||||
// || (stateString === undefined && !isLoading)
|
||||
) ? (
|
||||
<span style={{color: 'red', fontWeight: '700'}}>
|
||||
Failed
|
||||
</span>
|
||||
) : (
|
||||
comment.state === "pending" ? (
|
||||
<span style={{color: 'red', fontWeight: '700'}}>
|
||||
Pending
|
||||
</span>
|
||||
) : (
|
||||
comment.state === "failed" ? (
|
||||
<span style={{color: 'red', fontWeight: '700'}}>
|
||||
Failed
|
||||
</span>
|
||||
) : null
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -21,13 +21,7 @@ const StateLabel = ({ commentIndex, className }) => {
|
||||
null
|
||||
) : (
|
||||
stateString === undefined && !isLoading && comment.cid === undefined ? (
|
||||
<span className="ttl">
|
||||
<br />
|
||||
(
|
||||
<span className={className}>
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
null
|
||||
) : (
|
||||
<span className="ttl">
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user