Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added link to transaction #163

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/components/atoms/timeline/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
gap: 4px;
}

.description span {
.description a {
color: #7191fc;
}

11 changes: 6 additions & 5 deletions ui/components/atoms/timeline/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ import Image from "next/image";
import { StaticEllipse } from "@/components/molecules/staticEllipse";
import { DOMAIN_STATUS } from "@/comman/types";
import { chain } from "@/comman/constants";
import Link from "next/link";

const getPendingComponent = (message) => (
<span style={{ display: "flex", alignItems: "center", gap: "12px" }}>
<Image src={pendingIcon} alt="" width={18} height={18} /> {message}
</span>
);

const getDescription = (value) => {
const getDescription = (value, hash?: string) => {
const text = value?.match(/[^\d]+/);
const number = value?.match(/\d+/);
return (
<div className={styles.description}>
{text} <span>{number}</span>
{text} <Link href={`https://minascan.io/${chain}/tx/${hash}`} target="_blank">{number}</Link>
</div>
);
};
Expand Down Expand Up @@ -111,7 +112,7 @@ const Timeline: FC<TimelineProps> = ({
hash: item?.hash,
statusTime,
status: "Block Created",
description: getDescription(status),
description: getDescription(status, item?.hash),
},
isLastItem && {
pendingComponent: getPendingComponent("Validating block.."),
Expand All @@ -124,7 +125,7 @@ const Timeline: FC<TimelineProps> = ({
{
statusTime,
status: "Block Validated",
description: getDescription(status),
description: getDescription(status, item?.hash),
hash: item?.hash,
},
isLastItem && {
Expand All @@ -138,7 +139,7 @@ const Timeline: FC<TimelineProps> = ({
{
statusTime,
status: "Block Proved",
description: getDescription(status),
description: getDescription(status, item?.hash),
hash: item?.hash,
},
isLastItem && DOMAIN_STATUS.ACTIVE !== domainStatus
Expand Down
Loading