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.
-
-
- {(renderData.quantity || 0n).toString()}{" "}
- {/* For listings that are completed, the `quantity` would be `0`
+ {(renderData.quantity || 0n).toString()}{" "}
+ {/* For listings that are completed, the `quantity` would be `0`
So we show this text to make it clear */}
- {LISTING_STATUS[renderData.status] === "Completed"
- ? "(Sold out)"
- : ""}
-
+ {LISTING_STATUS[renderData.status] === "Completed"
+ ? "(Sold out)"
+ : ""}
{renderData.type === "direct-listing" && (
<>
- Price
+