Skip to content

Commit 7855c3e

Browse files
committed
Move Contract page components to app router folder (no code change) (#5071)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on restructuring the file organization and imports within the `dashboard` application. It moves components to a more cohesive structure, enhancing maintainability and clarity. ### Detailed summary - Updated imports to use relative paths instead of absolute paths. - Renamed several component files for consistency. - Moved `CancelDirectListing` and `CancelEnglishAuction` to a new structure under `components`. - Adjusted imports in various `page.tsx` files to reflect new component paths. - Consolidated marketplace-related components under a unified structure. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 6597cb6 commit 7855c3e

32 files changed

+25
-26
lines changed

apps/dashboard/src/contract-ui/tabs/direct-listings/components/cancel.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/CancelDirectListing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CancelTab } from "contract-ui/tabs/shared-components/cancel-tab";
21
import type { ThirdwebContract } from "thirdweb";
2+
import { CancelTab } from "./cancel-tab";
33

44
interface CancelDirectListingProps {
55
contract: ThirdwebContract;

apps/dashboard/src/contract-ui/tabs/english-auctions/components/cancel.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/CancelEnglishAuction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CancelTab } from "contract-ui/tabs/shared-components/cancel-tab";
21
import type { ThirdwebContract } from "thirdweb";
2+
import { CancelTab } from "./cancel-tab";
33

44
interface CancelEnglishAuctionProps {
55
contract: ThirdwebContract;

apps/dashboard/src/contract-ui/tabs/shared-components/cancel-tab.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/cancel-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import { TransactionButton } from "components/buttons/TransactionButton";
44
import { useTrack } from "hooks/analytics/useTrack";
5+
import { useAllChainsData } from "hooks/chains/allChains";
56
import { useTxNotifications } from "hooks/useTxNotifications";
67
import type { ThirdwebContract } from "thirdweb";
78
import { cancelAuction, cancelListing } from "thirdweb/extensions/marketplace";
89
import { useSendAndConfirmTransaction } from "thirdweb/react";
9-
import { useAllChainsData } from "../../../hooks/chains/allChains";
1010

1111
interface CancelTabProps {
1212
id: string;

apps/dashboard/src/contract-ui/tabs/shared-components/list-button.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useState } from "react";
88
import type { ThirdwebContract } from "thirdweb";
99
import { useActiveAccount } from "thirdweb/react";
1010
import { Button, Drawer } from "tw-components";
11-
import { CreateListingsForm } from "../listings/components/list-form";
11+
import { CreateListingsForm } from "./list-form";
1212

1313
const LIST_FORM_ID = "marketplace-list-form";
1414

apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { CurrencySelector } from "components/shared/CurrencySelector";
1616
import { SolidityInput } from "contract-ui/components/solidity-inputs";
1717
import { useTrack } from "hooks/analytics/useTrack";
18+
import { useAllChainsData } from "hooks/chains/allChains";
1819
import { useTxNotifications } from "hooks/useTxNotifications";
1920
import { isAlchemySupported } from "lib/wallet/nfts/alchemy";
2021
import { isMoralisSupported } from "lib/wallet/nfts/moralis";
@@ -57,8 +58,6 @@ import {
5758
import { NFTMediaWithEmptyState } from "tw-components/nft-media";
5859
import { shortenIfAddress } from "utils/usedapp-external";
5960

60-
import { useAllChainsData } from "../../../../hooks/chains/allChains";
61-
6261
type ListForm =
6362
| (Omit<CreateListingParams, "quantity" | "currencyContractAddress"> & {
6463
currencyContractAddress: string;

apps/dashboard/src/contract-ui/tabs/shared-components/listing-drawer.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/listing-drawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { useActiveAccount } from "thirdweb/react";
2121
import { Badge, Card, CodeBlock, Heading, Text } from "tw-components";
2222
import { AddressCopyButton } from "tw-components/AddressCopyButton";
2323
import { NFTMediaWithEmptyState } from "tw-components/nft-media";
24-
import { CancelDirectListing } from "../direct-listings/components/cancel";
25-
import { CancelEnglishAuction } from "../english-auctions/components/cancel";
24+
import { CancelDirectListing } from "./CancelDirectListing";
25+
import { CancelEnglishAuction } from "./CancelEnglishAuction";
2626
import { LISTING_STATUS } from "./types";
2727

2828
interface NFTDrawerProps {

apps/dashboard/src/contract-ui/tabs/shared-components/marketplace-table.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/marketplace-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from "@chakra-ui/react";
1818
import type { UseQueryResult } from "@tanstack/react-query";
1919
import { MediaCell } from "components/contract-pages/table/table-columns/cells/media-cell";
20-
import { ListingDrawer } from "contract-ui/tabs/shared-components/listing-drawer";
2120
import {
2221
ChevronFirstIcon,
2322
ChevronLastIcon,
@@ -40,6 +39,7 @@ import type {
4039
} from "thirdweb/extensions/marketplace";
4140
import { min } from "thirdweb/utils";
4241
import { Button, Text } from "tw-components";
42+
import { ListingDrawer } from "./listing-drawer";
4343
import { LISTING_STATUS } from "./types";
4444

4545
const tableColumns: Column<DirectListing | EnglishAuction>[] = [

apps/dashboard/src/contract-ui/tabs/direct-listings/page.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/ContractDirectListingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { ThirdwebContract } from "thirdweb";
44
import { Heading } from "tw-components";
5-
import { CreateListingButton } from "../shared-components/list-button";
5+
import { CreateListingButton } from "../components/list-button";
66
import { DirectListingsTable } from "./components/table";
77

88
interface ContractDirectListingsPageProps {

apps/dashboard/src/contract-ui/tabs/direct-listings/components/table.tsx renamed to apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/components/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import { MarketplaceTable } from "contract-ui/tabs/shared-components/marketplace-table";
43
import { useState } from "react";
54
import type { ThirdwebContract } from "thirdweb";
65
import {
@@ -9,6 +8,7 @@ import {
98
totalListings,
109
} from "thirdweb/extensions/marketplace";
1110
import { useReadContract } from "thirdweb/react";
11+
import { MarketplaceTable } from "../../components/marketplace-table";
1212

1313
interface DirectListingsTableProps {
1414
contract: ThirdwebContract;

0 commit comments

Comments
 (0)