Skip to content

Commit

Permalink
chore: rename milestone timestamp state
Browse files Browse the repository at this point in the history
  • Loading branch information
VmMad committed Jan 19, 2024
1 parent c5f3bf9 commit 27621f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/app/components/stardust/block/BlockTangleState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import "./BlockTangleState.scss";
import { DateHelper } from "~/helpers/dateHelper";

const BlockTangleState: React.FC<BlockTangleStateProps> = ({ network, status, milestoneIndex, hasConflicts, conflictReason, onClick }) => {
const [ago, setAgo] = useState<string | undefined>();
const [milestoneTimestamp, setMilestoneTimestamp] = useState<string | undefined>();
const [blockId, setBlockId] = useState<string | undefined>();
const [milestoneDetails] = useMilestoneDetails(network, milestoneIndex ?? null);

useEffect(() => {
if (milestoneDetails?.milestone?.timestamp) {
const readableTimestamp = DateHelper.format(DateHelper.milliseconds(milestoneDetails.milestone.timestamp));
setAgo(readableTimestamp);
setMilestoneTimestamp(readableTimestamp);
}
setBlockId(milestoneDetails?.blockId);
}, [milestoneDetails]);
Expand All @@ -35,7 +35,7 @@ const BlockTangleState: React.FC<BlockTangleStateProps> = ({ network, status, mi
{milestoneIndex && "Confirmed"}
{!milestoneIndex && "Pending"}
</div>
{milestoneIndex && <span className="row middle">Created {ago}</span>}
{milestoneIndex && <span className="row middle">Created {milestoneTimestamp}</span>}
</div>
</div>
)}
Expand Down Expand Up @@ -78,7 +78,7 @@ const BlockTangleState: React.FC<BlockTangleStateProps> = ({ network, status, mi
>
Milestone {milestoneIndex}
</span>
<span> {ago}</span>
<span> {milestoneTimestamp}</span>
</div>
) : (
""
Expand Down

0 comments on commit 27621f2

Please sign in to comment.