From f452104c4f76c200051354d491e2447dc983addf Mon Sep 17 00:00:00 2001 From: Aminah <58310685+aminah-io@users.noreply.github.com> Date: Fri, 28 Jul 2023 23:29:46 +0300 Subject: [PATCH] feat(app): adds on-chain stamp label (#1519) * feat(app): adds on-chain status tags * feat(app): updates for responsiveness * feat(app): removes superfluous props type * feat(app): removes log and fragment --- app/components/OnChainTag.tsx | 17 +++++++++++++++++ app/components/PlatformCard.tsx | 19 +++++++++++++------ app/components/StampSelector.tsx | 12 +++++------- 3 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 app/components/OnChainTag.tsx diff --git a/app/components/OnChainTag.tsx b/app/components/OnChainTag.tsx new file mode 100644 index 0000000000..eb1e01d01e --- /dev/null +++ b/app/components/OnChainTag.tsx @@ -0,0 +1,17 @@ +import { Tag, TagLabel } from "@chakra-ui/react"; + +export function OnChainTag({ marginLeft }: { marginLeft?: string }) { + return ( + + On-Chain + + ); +} diff --git a/app/components/PlatformCard.tsx b/app/components/PlatformCard.tsx index 10ed2886d4..9880269cb1 100644 --- a/app/components/PlatformCard.tsx +++ b/app/components/PlatformCard.tsx @@ -21,6 +21,7 @@ import { pillLocalStorage } from "../context/userContext"; import { JsonOutputModal } from "./JsonOutputModal"; import { RemoveStampModal } from "./RemoveStampModal"; import { getStampProviderFilters } from "../config/filters"; +import { OnChainTag } from "./OnChainTag"; type SelectedProviders = Record; @@ -135,7 +136,18 @@ export const PlatformCard = ({ )}
-

{platform.name}

+
1 ? "items-center md:items-baseline" : "items-center" + }`} + > +

1 ? "text-left" : "text-center"}`} + > + {platform.name} +

+ {process.env.NEXT_PUBLIC_FF_CHAIN_SYNC === "on" && hasOnChainProviders() ? : <>} +

{platform.description}

@@ -145,11 +157,6 @@ export const PlatformCard = ({
- {process.env.NEXT_PUBLIC_FF_CHAIN_SYNC === "on" && hasOnChainProviders() ? ( - - ) : ( - <> - )} Verified diff --git a/app/components/StampSelector.tsx b/app/components/StampSelector.tsx index 3ce5836318..992a841a39 100644 --- a/app/components/StampSelector.tsx +++ b/app/components/StampSelector.tsx @@ -6,6 +6,7 @@ import { PlatformGroupSpec } from "../config/providers"; import { getStampProviderFilters } from "../config/filters"; import { OnChainContext } from "../context/onChainContext"; import { LinkIcon } from "@heroicons/react/20/solid"; +import { OnChainTag } from "./OnChainTag"; import Toggle from "./Toggle"; import { getProviderSpec } from "../utils/helpers"; import { CeramicContext } from "../context/ceramicContext"; @@ -71,14 +72,11 @@ export function StampSelector({ key={`${provider.title}${i}`} data-testid={`indicator-${provider.name}`} > -
- {process.env.NEXT_PUBLIC_FF_CHAIN_SYNC === "on" && - (isProviderOnChain(provider.name) ? ( - - ) : ( - - ))} +
{provider.title} + {process.env.NEXT_PUBLIC_FF_CHAIN_SYNC === "on" && isProviderOnChain(provider.name) && ( + + )}
);