Skip to content

Commit

Permalink
Merge pull request #399 from modularcloud/fredkiss3/fe-103-add-verifi…
Browse files Browse the repository at this point in the history
…ed-checkmarks-on-dymension-homepage

Fredkiss3/fe 103 add verified checkmarks on dymension homepage
  • Loading branch information
lzrscg authored Mar 5, 2024
2 parents 9fdf792 + 7cdb59d commit 81fa2d5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions apps/web/ui/network-widgets/widgets/ibc-transfert-event-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ChevronDoubleDown,
Clock,
CornerUpRight,
FancyCheck,
LinkOut,
} from "~/ui/icons";
import { ClientTime } from "~/ui/client-time";
Expand All @@ -19,6 +20,7 @@ import { jsonFetch } from "~/lib/shared-utils";
import * as HoverCard from "@radix-ui/react-hover-card";
import { Tooltip } from "~/ui/tooltip";
import { useNetworkStatus } from "~/ui/search/use-network-status";
import { useSearchOptionsContext } from "~/ui/search-options-context";

export type IBCTransferEventCardProps = {
event: IBCTransferEvent;
Expand Down Expand Up @@ -102,6 +104,20 @@ export function IBCTransferEventCard({
const targetChainHealthStatus =
targetNetworkStatus?.[event.to.chainSlug]?.healthy ?? null;

const allNetworkChains = useSearchOptionsContext();

const values = allNetworkChains.flat();
const foundNetworks = values.filter(
(network) =>
network.slug === event.from.chainSlug ||
network.slug === event.to.chainSlug,
);

const fromChain = foundNetworks.find(
(net) => net.slug === event.from.chainSlug,
);
const toChain = foundNetworks.find((net) => net.slug === event.to.chainSlug);

return (
<Card className="p-0 grid w-full shadow-none">
<div className="p-5 rounded-t-lg flex items-start justify-between">
Expand Down Expand Up @@ -260,6 +276,19 @@ export function IBCTransferEventCard({
{event.from.chainName}
</p>

{fromChain?.verified && (
<span
style={{
"--color-primary": fromChain.brandColor,
}}
>
<FancyCheck
className="text-primary h-5 w-5 flex-none"
aria-hidden="true"
/>
</span>
)}

<div
className={cn(
"opacity-100 relative flex items-center justify-center",
Expand Down Expand Up @@ -350,6 +379,19 @@ export function IBCTransferEventCard({
{event.to.chainName}
</p>

{toChain?.verified && (
<span
style={{
"--color-primary": toChain.brandColor,
}}
>
<FancyCheck
className="text-primary h-5 w-5 flex-none"
aria-hidden="true"
/>
</span>
)}

<div
className={cn(
"opacity-100 relative flex items-center justify-center",
Expand Down

0 comments on commit 81fa2d5

Please sign in to comment.