diff --git a/client/src/app/components/stardust/block/BlockTangleState.scss b/client/src/app/components/stardust/block/BlockTangleState.scss index ce8ae18e1..45984e72b 100644 --- a/client/src/app/components/stardust/block/BlockTangleState.scss +++ b/client/src/app/components/stardust/block/BlockTangleState.scss @@ -22,7 +22,7 @@ font-weight: 500; letter-spacing: 0.5px; - @include phone-down { + @include tablet-down { margin-left: 8px; flex-direction: column; white-space: normal; diff --git a/client/src/app/components/stardust/block/BlockTangleState.tsx b/client/src/app/components/stardust/block/BlockTangleState.tsx index 7b77ad341..35f1d8949 100644 --- a/client/src/app/components/stardust/block/BlockTangleState.tsx +++ b/client/src/app/components/stardust/block/BlockTangleState.tsx @@ -1,19 +1,20 @@ import classNames from "classnames"; -import moment from "moment"; import React, { useEffect, useState } from "react"; import { BlockTangleStateProps } from "./BlockTangleStateProps"; import { useMilestoneDetails } from "~helpers/hooks/useMilestoneDetails"; import Tooltip from "../../Tooltip"; import "./BlockTangleState.scss"; +import { DateHelper } from "~/helpers/dateHelper"; const BlockTangleState: React.FC = ({ network, status, milestoneIndex, hasConflicts, conflictReason, onClick }) => { - const [ago, setAgo] = useState(); + const [milestoneTimestamp, setMilestoneTimestamp] = useState(); const [blockId, setBlockId] = useState(); const [milestoneDetails] = useMilestoneDetails(network, milestoneIndex ?? null); useEffect(() => { if (milestoneDetails?.milestone?.timestamp) { - setAgo(moment(milestoneDetails.milestone?.timestamp * 1000).fromNow()); + const readableTimestamp = DateHelper.format(DateHelper.milliseconds(milestoneDetails.milestone.timestamp)); + setMilestoneTimestamp(readableTimestamp); } setBlockId(milestoneDetails?.blockId); }, [milestoneDetails]); @@ -34,7 +35,7 @@ const BlockTangleState: React.FC = ({ network, status, mi {milestoneIndex && "Confirmed"} {!milestoneIndex && "Pending"} - {milestoneIndex && Created {ago}} + {milestoneIndex && Created {milestoneTimestamp}} )} @@ -77,7 +78,7 @@ const BlockTangleState: React.FC = ({ network, status, mi > Milestone {milestoneIndex} - {ago} + - {milestoneTimestamp} ) : ( ""