From ec9deb87f2be6677478eb4b185f31945174a49ba Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:31:58 -0500 Subject: [PATCH 1/3] fix: denom info modal rendering --- components/factory/modals/denomInfo.tsx | 56 +++++-------------------- 1 file changed, 10 insertions(+), 46 deletions(-) diff --git a/components/factory/modals/denomInfo.tsx b/components/factory/modals/denomInfo.tsx index 16bccc91..064531e3 100644 --- a/components/factory/modals/denomInfo.tsx +++ b/components/factory/modals/denomInfo.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { TruncatedAddressWithCopy } from '@/components/react/addressCopy'; import { FaExternalLinkAlt } from 'react-icons/fa'; import { MetadataSDKType } from '@liftedinit/manifestjs/dist/codegen/cosmos/bank/v1beta1/bank'; -import { useRouter } from 'next/router'; export const DenomInfoModal: React.FC<{ denom: MetadataSDKType | null; @@ -28,50 +27,13 @@ export const DenomInfoModal: React.FC<{

Denom Details

-
- - - {denom?.description && ( - - )} - {denom?.denom_units[1]?.exponent && ( - - )} -
-
- {denom?.denom_units?.map( - ( - unit: { - denom: string; - aliases?: string[]; - exponent?: number; - }, - index: number - ) => ( -
- - -
- ) - )} -
-
-

- Additional Information -

-
+ + -
@@ -85,15 +47,17 @@ function InfoItem({ label, value, isAddress = false, + className = '', }: { label: string; value: string; isAddress?: boolean; + className?: string; }) { return ( -
+

{label}

-
+
{isAddress ? (
@@ -104,7 +68,7 @@ function InfoItem({ rel="noopener noreferrer" className="ml-2 text-primary hover:text-primary/50" > -
From 27fc1f317b52a96584c74b63889232d1f9b61925 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:41:48 -0500 Subject: [PATCH 2/3] fix: long description render --- components/factory/modals/denomInfo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/factory/modals/denomInfo.tsx b/components/factory/modals/denomInfo.tsx index 064531e3..7ec740fa 100644 --- a/components/factory/modals/denomInfo.tsx +++ b/components/factory/modals/denomInfo.tsx @@ -28,7 +28,7 @@ export const DenomInfoModal: React.FC<{

Denom Details

- +
) : ( -

+

{value}

)} From 1d95cfe9e8092ce9db33b35dfd1334abce73ef09 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:58:14 -0500 Subject: [PATCH 3/3] fix: token list test and denom info name truncate --- .../bank/components/__tests__/tokenList.test.tsx | 7 +++---- components/factory/modals/denomInfo.tsx | 12 ++++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/components/bank/components/__tests__/tokenList.test.tsx b/components/bank/components/__tests__/tokenList.test.tsx index 79096175..9e33b14b 100644 --- a/components/bank/components/__tests__/tokenList.test.tsx +++ b/components/bank/components/__tests__/tokenList.test.tsx @@ -83,10 +83,9 @@ describe('TokenList', () => { await waitFor(() => { expect(screen.getByLabelText('Close modal')).toBeInTheDocument(); - expect(screen.getByText('NAME')).toBeInTheDocument(); - expect(screen.getByText('SYMBOL')).toBeInTheDocument(); - expect(screen.getByText('DESCRIPTION')).toBeInTheDocument(); - expect(screen.getByText('EXPONENT')).toBeInTheDocument(); + expect(screen.getByText('Name')).toBeInTheDocument(); + expect(screen.getByText('Ticker')).toBeInTheDocument(); + expect(screen.getByText('Description')).toBeInTheDocument(); }); }); diff --git a/components/factory/modals/denomInfo.tsx b/components/factory/modals/denomInfo.tsx index 7ec740fa..3632cd4e 100644 --- a/components/factory/modals/denomInfo.tsx +++ b/components/factory/modals/denomInfo.tsx @@ -9,6 +9,10 @@ export const DenomInfoModal: React.FC<{ isOpen?: boolean; onClose?: () => void; }> = ({ denom, modalId, isOpen, onClose }) => { + let nameIsAddress = false; + if (denom?.name.startsWith('factory/manifest1')) { + nameIsAddress = true; + } return (

Denom Details

- + {isAddress ? (
- +