From a9c30e98c55c1c23313516c99dd9b51c902ac46f Mon Sep 17 00:00:00 2001 From: jnsdls Date: Fri, 6 Dec 2024 19:08:46 +0000 Subject: [PATCH] remove a bunch of (#5646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes: DASH-557 --- ## PR-Codex overview This PR focuses on refactoring the layout of various components in the application from using `Flex` elements to using `div` elements with Tailwind CSS classes for styling, improving consistency and readability. ### Detailed summary - Changed `Flex` components to `div` with Tailwind CSS classes in `nft-property.tsx`. - Updated layout in `external-links-fieldset.tsx` to use `fieldset` and `div`. - Modified `engine-wallet-config.tsx` to replace `Flex` with `div`. - Refactored `engine-relayer.tsx` to use `div` instead of `Flex`. - Updated `ContractTokensPage.tsx` to use `div` for layout. - Changed `ContractExplorerPage.tsx` layout from `Flex` to `div`. - Refactored `proposal.tsx` to replace `Flex` with `div`. - Updated `EngineSystemMetrics.tsx` to use `div` instead of `Flex`. - Changed layout in `airdrop-tab.tsx` to replace `Flex` with `div`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../explorer/ContractExplorerPage.tsx | 23 +++--- .../nfts/[tokenId]/components/airdrop-tab.tsx | 73 +++++++++---------- .../nfts/components/nft-property.tsx | 3 +- .../proposals/components/proposal.tsx | 30 ++++---- .../tokens/ContractTokensPage.tsx | 8 +- .../components/engine-wallet-config.tsx | 9 +-- .../components/EngineSystemMetrics.tsx | 13 ++-- .../relayers/components/engine-relayer.tsx | 9 +-- .../external-links-fieldset.tsx | 13 ++-- 9 files changed, 82 insertions(+), 99 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/ContractExplorerPage.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/ContractExplorerPage.tsx index 2ec7f4538a6..6718847ba5f 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/ContractExplorerPage.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/ContractExplorerPage.tsx @@ -1,5 +1,4 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; -import { Flex } from "@chakra-ui/react"; import type { Abi } from "abitype"; import { getContractFunctionsFromAbi } from "components/contract-components/getContractFunctionsFromAbi"; import { ContractFunctionsOverview } from "components/contract-functions/contract-functions"; @@ -33,7 +32,7 @@ export const ContractExplorerPage: React.FC = ({ const functions = getContractFunctionsFromAbi(abi); return ( - +
{functions && functions.length > 0 ? ( = ({ contract={contract} /> ) : ( -
- -

- No callable functions discovered in ABI. -

-

- Please note that proxy contracts are not yet supported in the - explorer, check back soon for full proxy support. -

-
+
+

+ No callable functions discovered in ABI. +

+

+ Please note that proxy contracts are not yet supported in the + explorer, check back soon for full proxy support. +

)} - +
); }; diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/airdrop-tab.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/airdrop-tab.tsx index 249191fb972..909397744d3 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/airdrop-tab.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/airdrop-tab.tsx @@ -8,7 +8,7 @@ import { SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; -import { Flex } from "@chakra-ui/react"; +import { cn } from "@/lib/utils"; import { TransactionButton } from "components/buttons/TransactionButton"; import { useTrack } from "hooks/analytics/useTrack"; import { UploadIcon } from "lucide-react"; @@ -114,44 +114,41 @@ const AirdropTab: React.FC = ({ contract, tokenId }) => { })} >
-
- - - - - - - - - Airdrop NFTs - - - setOpen(false)} - setAirdrop={(value) => - setValue("addresses", value, { shouldDirty: true }) - } - /> - - +
+ + + + + + + + Airdrop NFTs + + + setOpen(false)} + setAirdrop={(value) => + setValue("addresses", value, { shouldDirty: true }) + } + /> + + - - {addresses.length > 0 && ( -

- ● {addresses.length} addresses ready to be - airdropped -

- )} -
- +
0, + })} + > + {addresses.length > 0 && ( +

+ ● {addresses.length} addresses ready to be + airdropped +

+ )} +

You can airdrop to a maximum of 250 addresses at a time. If you have diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/nft-property.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/nft-property.tsx index 92392de14ad..779bbb36a84 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/nft-property.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/nft-property.tsx @@ -1,4 +1,3 @@ -import { Flex } from "@chakra-ui/react"; import { Card, Text } from "tw-components"; interface NftPropertyProps { @@ -8,7 +7,7 @@ interface NftPropertyProps { export const NftProperty: React.FC = ({ property }) => { return ( - + {property?.trait_type && ( = ({ proposal, contract }) => { return ( - - - - {`${proposal.stateLabel?.charAt(0).toUpperCase()}${proposal.stateLabel?.slice(1)}`} - - - + ] || undefined, + }} + > + + {`${proposal.stateLabel?.charAt(0).toUpperCase()}${proposal.stateLabel?.slice(1)}`} + +

Proposal: {proposal.description} @@ -134,7 +130,7 @@ export const Proposal: React.FC = ({ proposal, contract }) => { !hasVotedQuery.data && !hasVotedQuery.isPending && tokensDelegatedQuery.data ? ( - +
= ({ proposal, contract }) => { Abstain
-
+
) : ( canExecuteQuery.data && (
-
-
+ + ); };