Skip to content

Commit

Permalink
Move Contract page components to app router folder #2 (no code change) (
Browse files Browse the repository at this point in the history
#5073)

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors the structure of the dashboard application, changing the import paths for several components and pages to a more localized format. It also moves certain components related to contract management and permissions to new locations.

### Detailed summary
- Updated import paths for various pages and components to local paths.
- Moved `ContractSplitPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/split/ContractSplitPage.tsx`.
- Moved `DistributeButton` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/split/components/distribute-button.tsx`.
- Moved `ContractProposalsPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/proposals/ContractProposalsPage.tsx`.
- Moved `ContractEditModulesPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/ContractEditModulesPage.tsx`.
- Moved `ContractPermissionsPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/permissions/ContractPermissionsPage.tsx`.
- Moved `ContractExplorerPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/explorer/ContractExplorerPage.tsx`.
- Moved `ContractSettingsPage` to `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/ContractSettingsPage.tsx`.
- Updated import statements in `events-feed.tsx` and `permissions/index.tsx` to reflect new paths.
- Adjusted type imports in various components to align with the new structure.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
MananTank committed Oct 17, 2024
1 parent 7855c3e commit 00a6a56
Show file tree
Hide file tree
Showing 33 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
Tooltip,
} from "@chakra-ui/react";
import { AnimatePresence, motion } from "framer-motion";
import { useChainSlug } from "hooks/chains/chainSlug";
import { useClipboard } from "hooks/useClipboard";
import { ChevronDownIcon, CircleHelpIcon, CopyIcon } from "lucide-react";
import { useSearchParams } from "next/navigation";
Expand All @@ -39,7 +40,6 @@ import {
Heading,
Text,
} from "tw-components";
import { useChainSlug } from "../../../../hooks/chains/chainSlug";

interface EventsFeedProps {
contract: ThirdwebContract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { notFound } from "next/navigation";
import { EventsFeed } from "../../../../../../contract-ui/tabs/events/components/events-feed";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { EventsFeed } from "./events-feed";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { CircleAlertIcon } from "lucide-react";
import { notFound } from "next/navigation";
import { resolveContractAbi } from "thirdweb/contract";
import { ContractExplorerPage } from "../../../../../../contract-ui/tabs/explorer/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { ContractExplorerPage } from "./ContractExplorerPage";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
import { SidebarLayout } from "@/components/blocks/SidebarLayout";
import { ContractMetadata } from "components/custom-contract/contract-header/contract-metadata";
import { DeprecatedAlert } from "components/shared/DeprecatedAlert";
import { PrimaryDashboardButton } from "contract-ui/components/primary-dashboard-button";
import type { Metadata } from "next";
import { getContractMetadata } from "thirdweb/extensions/common";
import { resolveFunctionSelectors } from "../../../../../lib/selectors";
import { shortenIfAddress } from "../../../../../utils/usedapp-external";
import { ConfigureCustomChain } from "./ConfigureCustomChain";
import { PrimaryDashboardButton } from "./_components/primary-dashboard-button";
import { supportedERCs } from "./_utils/detectedFeatures/supportedERCs";
import { getContractPageParamsInfo } from "./_utils/getContractFromParams";
import { getContractPageMetadata } from "./_utils/getContractPageMetadata";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FormControl } from "@chakra-ui/react";
import { useQuery } from "@tanstack/react-query";
import { SolidityInput } from "contract-ui/components/solidity-inputs";
import invariant from "tiny-invariant";
import { FormErrorMessage, FormLabel } from "tw-components";
import { SolidityInput } from "../../../components/solidity-inputs";
import type { InstallModuleForm } from "./ModuleForm";
import { getModuleInstalledParams } from "./getModuleInstalledParams";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound, redirect } from "next/navigation";
import { ContractEditModulesPage } from "../../../../../../contract-ui/tabs/manage/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
import { ContractEditModulesPage } from "./ContractEditModulesPage";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import { ButtonGroup, Flex } from "@chakra-ui/react";
import { TransactionButton } from "components/buttons/TransactionButton";
import { ROLE_DESCRIPTION_MAP } from "constants/mappings";
import {
createSetAllRoleMembersTx,
getAllRoleMembers,
} from "contract-ui/hooks/permissions";
import { useTrack } from "hooks/analytics/useTrack";
import { useTxNotifications } from "hooks/useTxNotifications";
import { useMemo } from "react";
Expand All @@ -14,10 +18,6 @@ import {
useSendAndConfirmTransaction,
} from "thirdweb/react";
import { Button } from "tw-components";
import {
createSetAllRoleMembersTx,
getAllRoleMembers,
} from "../../../hooks/permissions";
import { ContractPermission } from "./contract-permission";

type PermissionFormContext = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound } from "next/navigation";
import { ContractPermissionsPage } from "../../../../../../contract-ui/tabs/permissions/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
import { ContractPermissionsPage } from "./ContractPermissionsPage";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound, redirect } from "next/navigation";
import { ContractProposalsPage } from "../../../../../../contract-ui/tabs/proposals/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
import { ContractProposalsPage } from "./ContractProposalsPage";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { notFound } from "next/navigation";
import * as CommonExt from "thirdweb/extensions/common";
import { ContractSettingsPage } from "../../../../../../contract-ui/tabs/settings/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
import { ContractSettingsPage } from "./ContractSettingsPage";

export default async function Page(props: {
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
StatLabel,
StatNumber,
} from "@chakra-ui/react";
import { useAllChainsData } from "hooks/chains/allChains";
import { useMemo } from "react";
import {
type ThirdwebContract,
Expand All @@ -24,7 +25,6 @@ import {
} from "thirdweb/react";
import { Card, Heading, Text } from "tw-components";
import { shortenIfAddress } from "utils/usedapp-external";
import { useAllChainsData } from "../../../hooks/chains/allChains";
import { DistributeButton } from "./components/distribute-button";

export type Balance = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useTxNotifications } from "hooks/useTxNotifications";
import { useMemo } from "react";
import type { ThirdwebContract } from "thirdweb";
import { Button } from "tw-components";
import type { Balance } from "../page";
import type { Balance } from "../ContractSplitPage";

interface DistributeButtonProps {
contract: ThirdwebContract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound, redirect } from "next/navigation";
import { ContractSplitPage } from "../../../../../../contract-ui/tabs/split/page";
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
import { ContractSplitPage } from "./ContractSplitPage";

export default async function Page(props: {
params: {
Expand Down

0 comments on commit 00a6a56

Please sign in to comment.