Skip to content

Dashboard import paths cleanup #7229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { MultiSelect } from "@/components/blocks/multi-select";
import { SelectWithSearch } from "@/components/blocks/select-with-search";
import { Badge } from "@/components/ui/badge";
import { ChainIconClient } from "components/icons/ChainIcon";
import { useAllChainsData } from "hooks/chains/allChains";
import { useCallback, useMemo } from "react";
import type { ThirdwebClient } from "thirdweb";
import { ChainIconClient } from "../../../components/icons/ChainIcon";
import { useAllChainsData } from "../../../hooks/chains/allChains";

function cleanChainName(chainName: string) {
return chainName.replace("Mainnet", "");
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/@/components/blocks/TokenSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useAllChainsData } from "hooks/chains/allChains";
import { useTokensData } from "hooks/tokens/tokens";
import { useCallback, useMemo } from "react";
import {
NATIVE_TOKEN_ADDRESS,
type ThirdwebClient,
getAddress,
} from "thirdweb";
import { shortenAddress } from "thirdweb/utils";
import { useAllChainsData } from "../../../hooks/chains/allChains";
import { useTokensData } from "../../../hooks/tokens/tokens";
import { replaceIpfsUrl } from "../../../lib/sdk";
import { fallbackChainIcon } from "../../../utils/chain-icons";
import type { TokenMetadata } from "../../api/universal-bridge/tokens";
Expand Down
10 changes: 5 additions & 5 deletions apps/dashboard/src/@/components/blocks/charts/area-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import { formatDate } from "date-fns";
import { useMemo } from "react";
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
import { cn } from "@/lib/utils";
import {
EmptyChartState,
LoadingChartState,
} from "../../../../components/analytics/empty-chart-state";
import { cn } from "../../../lib/utils";
} from "components/analytics/empty-chart-state";
import { formatDate } from "date-fns";
import { useMemo } from "react";
import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";

type ThirdwebAreaChartProps<TConfig extends ChartConfig> = {
header?: {
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/src/@/components/blocks/charts/bar-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import {
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
import { formatDate } from "date-fns";
import { useMemo } from "react";
import { cn } from "@/lib/utils";
import {
EmptyChartState,
LoadingChartState,
} from "../../../../components/analytics/empty-chart-state";
import { cn } from "../../../lib/utils";
} from "components/analytics/empty-chart-state";
import { formatDate } from "date-fns";
import { useMemo } from "react";

type ThirdwebBarChartProps<TConfig extends ChartConfig> = {
// metadata
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useLocalStorage } from "hooks/useLocalStorage";
import { XIcon } from "lucide-react";
import { useLocalStorage } from "../../../hooks/useLocalStorage";
import { Button } from "../ui/button";

export function DismissibleAlert(props: {
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/@/components/blocks/pricing-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { ToolTipLabel } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { RenewSubscriptionButton } from "components/settings/Account/Billing/renew-subscription/renew-subscription-button";
import { useTrack } from "hooks/analytics/useTrack";
import { CheckIcon, DollarSignIcon } from "lucide-react";
import Link from "next/link";
import type React from "react";
import { remainingDays } from "utils/date-utils";
import { TEAM_PLANS } from "utils/pricing";
import { RenewSubscriptionButton } from "../../../components/settings/Account/Billing/renew-subscription/renew-subscription-button";
import { useTrack } from "../../../hooks/analytics/useTrack";
import { remainingDays } from "../../../utils/date-utils";
import type { ProductSKU } from "../../lib/billing";
import { CheckoutButton } from "../billing";

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/@/components/ui/NavLink.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import { cn } from "@/lib/utils";
import { useTrack } from "hooks/analytics/useTrack";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useTrack } from "../../../hooks/analytics/useTrack";

export type NavButtonProps = {
className?: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/@/lib/time.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { differenceInCalendarDays } from "date-fns";
import {
type DurationId,
type Range,
getLastNDaysRange,
} from "../../components/analytics/date-range-selector";
} from "components/analytics/date-range-selector";
import { differenceInCalendarDays } from "date-fns";

export function normalizeTime(date: Date) {
const newDate = new Date(date);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import { Button } from "@/components/ui/button";
import { useStore } from "@/lib/reactive";
import { getSDKTheme } from "app/(app)/components/sdk-component-theme";
import { LazyConfigureNetworkModal } from "components/configure-networks/LazyConfigureNetworkModal";
import { CustomChainRenderer } from "components/selects/CustomChainRenderer";
import { mapV4ChainToV5Chain } from "contexts/map-chains";
import { useTrack } from "hooks/analytics/useTrack";
import { useAllChainsData } from "hooks/chains/allChains";
import { useTheme } from "next-themes";
import Image from "next/image";
import Link from "next/link";
Expand All @@ -20,8 +22,6 @@ import {
} from "thirdweb/react";
import { useFavoriteChainIds } from "../../../../app/(app)/(dashboard)/(chain)/components/client/star-button";
import { doLogout } from "../../../../app/(app)/login/auth-actions";
import { LazyConfigureNetworkModal } from "../../../../components/configure-networks/LazyConfigureNetworkModal";
import { useAllChainsData } from "../../../../hooks/chains/allChains";
import {
type StoredChain,
addRecentlyUsedChainId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { defineChain } from "thirdweb";
import { getChainMetadata } from "thirdweb/chains";
import { serverThirdwebClient } from "../../../../../../../@/constants/thirdweb-client.server";

type RouteListCardProps = {
originChainId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { ImageResponse } from "next/og";
import { download } from "thirdweb/storage";
import { fetchChain } from "utils/fetchChain";
import { serverThirdwebClient } from "../../../../../../@/constants/thirdweb-client.server";

// Route segment config
export const runtime = "edge";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { CircleAlertIcon } from "lucide-react";
import { getClientThirdwebClient } from "../../../../../../@/constants/thirdweb-client.client";
import { getRawAccount } from "../../../../account/settings/getAccount";
import { getChain, getChainMetadata } from "../../utils";
import NextSteps from "./components/client/NextSteps";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { ToolTipLabel } from "@/components/ui/tooltip";
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { cn } from "@/lib/utils";
import { ChainIconClient } from "components/icons/ChainIcon";
import { DiscordIcon } from "components/icons/brand-icons/DiscordIcon";
import { GithubIcon } from "components/icons/brand-icons/GithubIcon";
import { InstagramIcon } from "components/icons/brand-icons/InstagramIcon";
import { LinkedInIcon } from "components/icons/brand-icons/LinkedinIcon";
import { RedditIcon } from "components/icons/brand-icons/RedditIcon";
import { TelegramIcon } from "components/icons/brand-icons/TelegramIcon";
import { TiktokIcon } from "components/icons/brand-icons/TiktokIcon";
import { XIcon as TwitterXIcon } from "components/icons/brand-icons/XIcon";
import { YoutubeIcon } from "components/icons/brand-icons/YoutubeIcon";
Expand All @@ -17,8 +19,6 @@ import Link from "next/link";
import { useMemo } from "react";
import type { ThirdwebContract } from "thirdweb";
import type { ChainMetadata } from "thirdweb/chains";
import { DiscordIcon } from "../../../../../../../../../components/icons/brand-icons/DiscordIcon";
import { TelegramIcon } from "../../../../../../../../../components/icons/brand-icons/TelegramIcon";

const platformToIcons: Record<string, React.FC<{ className?: string }>> = {
twitter: TwitterXIcon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { notFound } from "next/navigation";
import { fetchDeployMetadata } from "thirdweb/contract";
import { serverThirdwebClient } from "../../../../../../@/constants/thirdweb-client.server";
import { DeployContractInfo } from "../../../published-contract/components/contract-info";
import { DeployFormForUri } from "../../../published-contract/components/uri-based-deploy";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Spinner } from "@/components/ui/Spinner/Spinner";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { fetchPublishedContracts } from "components/contract-components/fetchPublishedContracts";
import { Suspense } from "react";
import type { ThirdwebClient } from "thirdweb";
import { serverThirdwebClient } from "../../../../../@/constants/thirdweb-client.server";
import { ProfileHeader } from "./components/profile-header";
import { PublishedContracts } from "./components/published-contracts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { GradientBlobbie } from "@/components/blocks/Avatars/GradientBlobbie";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
/* eslint-disable @next/next/no-img-element */
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { notFound } from "next/navigation";
import { ImageResponse } from "next/og";
import { resolveAvatar } from "thirdweb/extensions/ens";
import { shortenIfAddress } from "utils/usedapp-external";
import { serverThirdwebClient } from "../../../../../@/constants/thirdweb-client.server";
import { resolveAddressAndEns } from "./resolveAddressAndEns";

export const runtime = "edge";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import {
fetchPublishedContractVersion,
fetchPublishedContractVersions,
Expand All @@ -6,7 +7,6 @@ import { ZERO_FEE_VERSIONS } from "constants/fee-config";
import { isAddress } from "thirdweb";
import { fetchDeployMetadata } from "thirdweb/contract";
import { resolveAddress } from "thirdweb/extensions/ens";
import { serverThirdwebClient } from "../../../../../@/constants/thirdweb-client.server";
import { DeployContractHeader } from "./contract-header";
import { DeployFormForUri } from "./uri-based-deploy";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getTeams } from "@/api/team";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { BookOpenIcon, ChevronRightIcon } from "lucide-react";
Expand All @@ -9,7 +10,6 @@ import contractsIcon from "../../../../../public/assets/support/contracts.png";
import engineIcon from "../../../../../public/assets/support/engine.png";
import miscIcon from "../../../../../public/assets/support/misc.svg";
import connectIcon from "../../../../../public/assets/support/wallets.png";
import { getTeams } from "../../../../@/api/team";
import { CustomChatButton } from "../../../nebula-app/(app)/components/CustomChat/CustomChatButton";
import {
getAuthToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { ToolTipLabel } from "@/components/ui/tooltip";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import type { Abi, AbiFunction } from "abitype";
import { useV5DashboardChain } from "lib/v5-adapter";
import { ArrowDownIcon, WalletIcon } from "lucide-react";
Expand All @@ -24,7 +25,6 @@ import {
import { resolveContractAbi } from "thirdweb/contract";
import { useActiveAccount } from "thirdweb/react";
import { parseAbiParams } from "thirdweb/utils";
import { getClientThirdwebClient } from "../../../../../../@/constants/thirdweb-client.client";
import { ShareButton } from "../../components/share";

export type SimulateTransactionForm = {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/account/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { getProjects } from "@/api/projects";
import { type Team, getTeams } from "@/api/team";
import { AppFooter } from "@/components/blocks/app-footer";
import { TabPathLinks } from "@/components/ui/tabs";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
import { AnnouncementBanner } from "components/notices/AnnouncementBanner";
import type React from "react";
import type { ThirdwebClient } from "thirdweb";
import { getClientThirdwebClient } from "../../../@/constants/thirdweb-client.client";
import {
getAuthToken,
getAuthTokenWalletAddress,
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/account/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getDefaultTeam } from "@/api/team";
import { getClientThirdwebClient } from "../../../../@/constants/thirdweb-client.client";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../api/lib/getAuthToken";
import { loginRedirect } from "../../login/loginRedirect";
import { AccountSettingsPage } from "./AccountSettingsPage";
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/account/wallets/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getLinkedWallets } from "@/api/linked-wallets";
import { getClientThirdwebClient } from "../../../../@/constants/thirdweb-client.client";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../api/lib/getAuthToken";
import { loginRedirect } from "../../login/loginRedirect";
import { getValidAccount } from "../settings/getAccount";
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/api/lib/getAuthToken.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { COOKIE_ACTIVE_ACCOUNT, COOKIE_PREFIX_TOKEN } from "@/constants/cookie";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { LAST_USED_TEAM_ID } from "constants/cookies";
import { cookies } from "next/headers";
import { getClientThirdwebClient } from "../../../../@/constants/thirdweb-client.client";

export async function getAuthToken() {
const cookiesManager = await cookies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import type { Team } from "@/api/team";
import { Badge, type BadgeProps } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
import { useTrack } from "hooks/analytics/useTrack";
import Link from "next/link";
import { useTrack } from "../../../hooks/analytics/useTrack";

const teamPlanToBadgeVariant: Record<
Team["billingPlan"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { ImageResponse } from "next/og";
import { download } from "thirdweb/storage";
import { fetchChain } from "utils/fetchChain";
import { serverThirdwebClient } from "../../../../@/constants/thirdweb-client.server";
import { DROP_PAGES } from "./data";

// Route segment config
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/drops/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { defineDashboardChain } from "lib/defineDashboardChain";
import type { Metadata } from "next";
import { notFound } from "next/navigation";
Expand All @@ -12,7 +13,6 @@ import {
getActiveClaimCondition as getActiveClaimCondition1155,
getNFT as getNFT1155,
} from "thirdweb/extensions/erc1155";
import { serverThirdwebClient } from "../../../../@/constants/thirdweb-client.server";
import { DROP_PAGES } from "./data";
import { NftMint } from "./mint-ui";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getTeamBySlug } from "@/api/team";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { notFound } from "next/navigation";
import { getClientThirdwebClient } from "../../../../../../@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../../api/lib/getAuthToken";
import { TeamOnboardingLayout } from "../../../../login/onboarding/onboarding-layout";
import { InviteTeamMembers } from "../../../../login/onboarding/team-onboarding/team-onboarding";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getProjects } from "@/api/projects";
import { getTeamBySlug, getTeams } from "@/api/team";
import { AppFooter } from "@/components/blocks/app-footer";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { notFound } from "next/navigation";
import { getClientThirdwebClient } from "../../../../../@/constants/thirdweb-client.client";
import { getValidAccount } from "../../../account/settings/getAccount";
import {
getAuthToken,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getTeamBySlug } from "@/api/team";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { notFound } from "next/navigation";
import { getClientThirdwebClient } from "../../../../../@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../api/lib/getAuthToken";
import { loginRedirect } from "../../../login/loginRedirect";
import { TeamOnboardingLayout } from "../../../login/onboarding/onboarding-layout";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Spinner } from "@/components/ui/Spinner/Spinner";
import { Button } from "@/components/ui/button";
import { TrackedLinkTW } from "@/components/ui/tracked-link";
import { useMutation } from "@tanstack/react-query";
import type { TrackingParams } from "hooks/analytics/useTrack";
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
import { toast } from "sonner";
import { shortenString } from "utils/usedapp-external";
import type { TrackingParams } from "../../../../../hooks/analytics/useTrack";

export function LinkWalletPrompt(props: {
email: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
updateAccountClient,
verifyEmailClient,
} from "@3rdweb-sdk/react/hooks/useApi";
import { useTrack } from "hooks/analytics/useTrack";
import { useActiveWallet } from "thirdweb/react";
import { useDisconnect } from "thirdweb/react";
import { useTrack } from "../../../../hooks/analytics/useTrack";
import { doLogout } from "../auth-actions";
import { AccountOnboardingUI } from "./account-onboarding-ui";

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientThirdwebClient } from "../../../@/constants/thirdweb-client.client";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getRawAccount } from "../account/settings/getAccount";
import { LoginAndOnboardingPage } from "./LoginPage";
import { isValidEncodedRedirectPath } from "./isValidEncodedRedirectPath";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { PROJECT_SHOWCASE_DATA } from "lib/project-showcase-constants";
import { ExternalLinkIcon, FileTextIcon } from "lucide-react";
import Link from "next/link";
import { serverThirdwebClient } from "../../../../@/constants/thirdweb-client.server";

export default async function DetailPage(props: {
params: Promise<{ slug: string }>;
Expand Down
Loading