From 453e45bd528c7cc6b7b67309b9f1332bfedaaa46 Mon Sep 17 00:00:00 2001 From: kien-ngo Date: Mon, 11 Nov 2024 00:09:18 +0000 Subject: [PATCH] [Dashboard] Remove tw-components from marketplace components (#5367) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Short description of the bug fixed or feature added --- ## PR-Codex overview This PR focuses on replacing the `tw-components` library's `Text` and `Heading` components with standard HTML elements like `

` and `

` to simplify the code structure and improve styling consistency across various components in the dashboard. ### Detailed summary - Replaced `Text` components with `

` in `csv-data-table.tsx`, `ContractDirectListingsPage.tsx`, and `ContractEnglishAuctionsPage.tsx`. - Changed `Heading` components to `

` in multiple files for consistency. - Updated button variants from `solid` to `default` in `marketplace-table.tsx`. - Removed unnecessary imports of `Text` and `Heading` from `tw-components` in several files. - Adjusted styling classes for better alignment and consistency. - Enhanced layout structure in the `ListingDrawer` and `CreateListingsForm` components. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../(marketplace)/components/list-form.tsx | 50 +++++--------- .../components/listing-drawer.tsx | 68 ++++++++----------- .../components/marketplace-table.tsx | 34 +++++----- .../ContractDirectListingsPage.tsx | 3 +- .../ContractEnglishAuctionsPage.tsx | 3 +- .../_components/csv-data-table.tsx | 5 +- 6 files changed, 67 insertions(+), 96 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx index 88cab8d9926..50507f5b34a 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx @@ -22,6 +22,7 @@ import { isMoralisSupported } from "lib/wallet/nfts/moralis"; import { isSimpleHashSupported } from "lib/wallet/nfts/simpleHash"; import type { WalletNFT } from "lib/wallet/nfts/types"; import { CircleAlertIcon, InfoIcon } from "lucide-react"; +import Link from "next/link"; import { type Dispatch, type SetStateAction, useMemo, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -47,14 +48,7 @@ import type { CreateListingParams, } from "thirdweb/extensions/marketplace"; import { useActiveAccount, useSendAndConfirmTransaction } from "thirdweb/react"; -import { - FormErrorMessage, - FormHelperText, - FormLabel, - Heading, - Link, - Text, -} from "tw-components"; +import { FormErrorMessage, FormHelperText, FormLabel } from "tw-components"; import { NFTMediaWithEmptyState } from "tw-components/nft-media"; import { shortenIfAddress } from "utils/usedapp-external"; @@ -357,9 +351,7 @@ export const CreateListingsForm: React.FC = ({ })} > - - Select NFT - + Select NFT Select the NFT you want to list for sale @@ -367,24 +359,22 @@ export const CreateListingsForm: React.FC = ({

- +

This chain is not supported by our NFT API yet, please enter the contract address of the NFT you want to list. - +

- - Contract address - + Contract address {form.formState.errors.selected?.contractAddress?.message} @@ -458,21 +448,19 @@ export const CreateListingsForm: React.FC = ({ ) : nfts && nfts.length === 0 ? (
- +

There are no NFTs owned by this wallet. You need NFTs to create a listing. You can create NFTs with thirdweb.{" "} - + Explore NFT contracts . - +

) : null}
- - Listing Currency - + Listing Currency = ({ - + {form.watch("listingType") === "auction" ? "Buyout Price Per Token" : "Listing Price"} - + {form.watch("listingType") === "auction" @@ -500,9 +488,7 @@ export const CreateListingsForm: React.FC = ({ {form.watch("selected")?.type?.toLowerCase() !== "erc721" && (
- - Quantity - + Quantity
@@ -513,18 +499,14 @@ export const CreateListingsForm: React.FC = ({ {form.watch("listingType") === "auction" && ( <> - - Reserve Price Per Token - + Reserve Price Per Token The minimum price per token necessary to bid on this auction - - Auction Duration - + Auction Duration - +
- + ); }; diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/ContractDirectListingsPage.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/ContractDirectListingsPage.tsx index 84374f3bb1f..0db0032f7a0 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/ContractDirectListingsPage.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/ContractDirectListingsPage.tsx @@ -1,7 +1,6 @@ "use client"; import type { ThirdwebContract } from "thirdweb"; -import { Heading } from "tw-components"; import { CreateListingButton } from "../components/list-button"; import { DirectListingsTable } from "./components/table"; @@ -15,7 +14,7 @@ export const ContractDirectListingsPage: React.FC< return (
- Contract Listings +

Contract Listings

- Contract Auctions +

Contract Auctions

{ data: T[]; @@ -78,9 +77,9 @@ export function CsvDataTable({ // biome-ignore lint/suspicious/noArrayIndexKey: FIXME key={columnIndex} > - +

{column.render("Header")} - +

))}