From f3a6c57b4ed0061109b6b0526c813b77ffc37e05 Mon Sep 17 00:00:00 2001 From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:01:51 +0300 Subject: [PATCH 1/4] chore: remove console.log --- src/pages/tools.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/tools.tsx b/src/pages/tools.tsx index f2f3c740f..18fdd5974 100644 --- a/src/pages/tools.tsx +++ b/src/pages/tools.tsx @@ -69,7 +69,6 @@ const ToolsPage: NextPageWithLayout = () => { const { transactions: nfts } = useNearBlocksTxns('nft.primitives.near', 'nft_mint'); const nftsProcessed = processTransactionsToNFT(nfts); - console.log('near', { nftsProcessed, ftProcessed }); const { requestAuthentication } = useSignInRedirect(); return ( From 66363d95a8b9ab61d3a20c08888363c7c124fbdb Mon Sep 17 00:00:00 2001 From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:03:08 +0300 Subject: [PATCH 2/4] fix: hide ListToken component when empty --- src/components/tools/FungibleToken/index.tsx | 8 ++++++-- src/components/tools/NonFungibleToken/index.tsx | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/tools/FungibleToken/index.tsx b/src/components/tools/FungibleToken/index.tsx index 03b04706a..721ab72c8 100644 --- a/src/components/tools/FungibleToken/index.tsx +++ b/src/components/tools/FungibleToken/index.tsx @@ -7,8 +7,12 @@ const FungibleToken = ({ tokens }: { tokens: FT[] }) => { return ( <> -
- + {tokens.length != 0 && ( + <> +
+ + + )} ); }; diff --git a/src/components/tools/NonFungibleToken/index.tsx b/src/components/tools/NonFungibleToken/index.tsx index 1958e31a5..418b5121b 100644 --- a/src/components/tools/NonFungibleToken/index.tsx +++ b/src/components/tools/NonFungibleToken/index.tsx @@ -8,9 +8,13 @@ const NonFungibleToken = ({ tokens }: { tokens: NFT[] }) => { return ( <> -
- -
+ {tokens.length != 0 && ( + <> +
+ +
+ + )} ); From 17dc68d00a70b7ddc4e0678b02ccddd3219b77bb Mon Sep 17 00:00:00 2001 From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:28:08 +0300 Subject: [PATCH 3/4] fix: scrollbar-gutter pushing content --- src/styles/globals.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/globals.css b/src/styles/globals.css index 670f82fac..bffbe4cdc 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -3,6 +3,7 @@ :root { --gateway-page-container-padding-y: 2rem; --gateway-page-container-padding-x: 1rem; + scrollbar-gutter: stable; } p, @@ -75,4 +76,4 @@ w3m-modal { right: 2px; bottom: 10px; } -} \ No newline at end of file +} From 9de52ba0cdd7d9efe45f8a078630a5458085f7dc Mon Sep 17 00:00:00 2001 From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:47:52 +0300 Subject: [PATCH 4/4] fix: add validation for ft total_supply --- src/components/tools/FungibleToken/CreateTokenForm.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/tools/FungibleToken/CreateTokenForm.tsx b/src/components/tools/FungibleToken/CreateTokenForm.tsx index 4f1729e5c..714d002d2 100644 --- a/src/components/tools/FungibleToken/CreateTokenForm.tsx +++ b/src/components/tools/FungibleToken/CreateTokenForm.tsx @@ -124,7 +124,13 @@ const CreateTokenForm: React.FC = () => { label="Total Supply" placeholder="e.g., 1000" error={errors.total_supply?.message} - {...register('total_supply', { required: 'Total supply is required' })} + {...register('total_supply', { + required: 'Total supply is required', + pattern: { + value: /^[1-9][0-9]*$/, + message: 'Total supply must be a whole number', + }, + })} />