Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { COOKIE_ACTIVE_ACCOUNT, COOKIE_PREFIX_TOKEN } from "@/constants/cookie";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import { API_SERVER_SECRET } from "@/constants/server-envs";
import { isVercel } from "@/utils/vercel";
import { verifyTurnstileToken } from "./verifyTurnstileToken";
import { verifyTurnstileToken } from "../../app/login/verifyTurnstileToken";

export async function getLoginPayload(
params: GenerateLoginPayloadParams,
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/@/components/connect-wallet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { useFavoriteChainIds } from "@app/(dashboard)/(chain)/components/client/star-button";
import { doLogout } from "@app/login/auth-actions";
import Image from "next/image";
import Link from "next/link";
import { usePathname } from "next/navigation";
Expand All @@ -14,6 +13,7 @@ import {
useActiveAccount,
useConnectModal,
} from "thirdweb/react";
import { doLogout } from "@/actions/auth-actions";
import { resetAnalytics } from "@/analytics/reset";
import { CustomChainRenderer } from "@/components/misc/CustomChainRenderer";
import { LazyConfigureNetworkModal } from "@/components/misc/configure-networks/LazyConfigureNetworkModal";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ThirdwebClient } from "thirdweb";
import type { ChainMetadata } from "thirdweb/chains";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { mapV4ChainToV5Chain } from "../../../../../../../../@/utils/map-chains";
import { mapV4ChainToV5Chain } from "@/utils/map-chains";
import { ChainIcon } from "../../../../components/server/chain-icon";
import { AddChainToWallet } from "../client/add-chain-to-wallet";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { mapV4ChainToV5Chain } from "../../../../../../@/utils/map-chains";
import { mapV4ChainToV5Chain } from "@/utils/map-chains";
import { TeamHeader } from "../../../../team/components/TeamHeader/team-header";
import { StarButton } from "../../components/client/star-button";
import { getChain, getChainMetadata } from "../../utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getAddress, getContract, isAddress } from "thirdweb";
import { localhost } from "thirdweb/chains";
import { getUserThirdwebClient } from "@/api/auth-token";
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
import { getConfiguredThirdwebClient } from "@/constants/thirdweb.server";
import { fetchChainWithLocalOverrides } from "@/utils/fetchChainWithLocalOverrides";
import { mapV4ChainToV5Chain } from "@/utils/map-chains";
import { getUserThirdwebClient } from "../../../../../../../@/api/auth-token";
import { fetchChainWithLocalOverrides } from "../../../../../../../@/utils/fetchChainWithLocalOverrides";

export async function getContractPageParamsInfo(params: {
contractAddress: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { notFound, redirect } from "next/navigation";
import { getAuthTokenWalletAddress } from "../../../../../../../../@/api/auth-token";
import { getAuthTokenWalletAddress } from "@/api/auth-token";
import type { ProjectMeta } from "../../../../../../team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/types";
import { redirectToContractLandingPage } from "../../../../../../team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/utils";
import { buildContractPagePath } from "../../_utils/contract-page-path";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ThirdwebContract } from "thirdweb";
import { getAuthTokenWalletAddress } from "../../../../../../../../@/api/auth-token";
import { getAuthTokenWalletAddress } from "@/api/auth-token";
import { getPublishedByCardProps, PublishedByUI } from "./published-by-ui";

interface PublishedByProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import { Spinner } from "@/components/ui/Spinner/Spinner";
import { ToolTipLabel } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { parseError } from "@/utils/errorParser";
import { getSDKTheme } from "@/utils/sdk-component-theme";
import { tryCatch } from "@/utils/try-catch";
import { getSDKTheme } from "../../../../../../../../../../@/utils/sdk-component-theme";
import { PublicPageConnectButton } from "../../../_components/PublicPageConnectButton";
import { SupplyClaimedProgress } from "../../../_components/supply-claimed-progress";
import { TokenPrice } from "../../../_components/token-price";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChevronDownIcon } from "lucide-react";
import { headers } from "next/headers";
import Link from "next/link";
import { getAuthToken } from "@/api/auth-token";
import {
Breadcrumb,
BreadcrumbItem,
Expand All @@ -14,7 +15,6 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { getAuthToken } from "../../../../../../@/api/auth-token";
import {
AllFilters,
ChainOptionsFilter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
import { headers } from "next/headers";
import { getAuthToken } from "../../../../../@/api/auth-token";
import { getAuthToken } from "@/api/auth-token";
import {
AllFilters,
ChainOptionsFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import "server-only";
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
import { getConfiguredThirdwebClient } from "@/constants/thirdweb.server";
import { cn } from "@/lib/utils";
import { fallbackChainIcon } from "@/utils/chain-icons";
import { resolveSchemeWithErrorHandler } from "@/utils/resolveSchemeWithErrorHandler";
import { fallbackChainIcon } from "../../../../../../@/utils/chain-icons";

export async function ChainIcon(props: {
iconUrl?: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppFooter } from "@/components/footers/app-footer";
import { ErrorProvider } from "../../../@/contexts/error-handler";
import { ErrorProvider } from "@/contexts/error-handler";

export default function DashboardLayout(props: { children: React.ReactNode }) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChakraProviderSetup } from "chakra/ChakraProviderSetup";
import { notFound } from "next/navigation";
import { getAuthToken } from "@/api/auth-token";
import { PublishedContract } from "@/components/contracts/published-contract";
import { Separator } from "@/components/ui/separator";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { getAuthToken } from "../../../../../../@/api/auth-token";
import { getRawAccount } from "../../../../account/settings/getAccount";
import { PublishedActions } from "../../components/contract-actions-published.client";
import { DeployContractHeader } from "../../components/contract-header";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getUserThirdwebClient } from "@/api/auth-token";
import { getProjects } from "@/api/projects";
import { getTeams } from "@/api/team";
import { CustomContractForm } from "@/components/contract-components/contract-deploy-form/custom-contract";
import { loginRedirect } from "../../../login/loginRedirect";
import { loginRedirect } from "@/utils/redirects";

type DeployFormForUriProps = {
contractMetadata: FetchDeployMetadataResult | null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use server";
import "server-only";

import { getAuthTokenWalletAddress } from "@/api/auth-token";
import { getTeamById } from "@/api/team";
import { getAuthTokenWalletAddress } from "../../../../../../@/api/auth-token";
import { loginRedirect } from "@/utils/redirects";
import { getRawAccount } from "../../../../account/settings/getAccount";
import { loginRedirect } from "../../../../login/loginRedirect";

type State = {
success: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { loginRedirect } from "../../../login/loginRedirect";
import { loginRedirect } from "@/utils/redirects";
import { CreateTicket } from "./components/create-ticket.client";

export default async function Page() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useCallback, useState } from "react";
import { toast } from "sonner";
import type { ThirdwebClient } from "thirdweb";
import { useActiveWallet, useDisconnect } from "thirdweb/react";
import { doLogout } from "@/actions/auth-actions";
import { createTeam } from "@/actions/createTeam";
import { resetAnalytics } from "@/analytics/reset";
import type { Project } from "@/api/projects";
Expand All @@ -12,7 +13,6 @@ import { CustomConnectWallet } from "@/components/connect-wallet";
import { LazyCreateProjectDialog } from "@/components/project/create-project-modal/LazyCreateAPIKeyDialog";
import type { Account } from "@/hooks/useApi";
import { useDashboardRouter } from "@/lib/DashboardRouter";
import { doLogout } from "../../login/auth-actions";
import {
type AccountHeaderCompProps,
AccountHeaderDesktopUI,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
getProjectContracts,
type ProjectContract,
} from "../../../../../@/api/getProjectContracts";
import { fetchChainWithLocalOverrides } from "../../../../../@/utils/fetchChainWithLocalOverrides";
} from "@/api/getProjectContracts";
import { fetchChainWithLocalOverrides } from "@/utils/fetchChainWithLocalOverrides";

export async function getSortedDeployedContracts(params: {
onlyMainnet?: boolean;
Expand Down
7 changes: 2 additions & 5 deletions apps/dashboard/src/app/(app)/account/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import type React from "react";
import type { ThirdwebClient } from "thirdweb";
import { getAuthToken, getAuthTokenWalletAddress } from "@/api/auth-token";
import { getProjects } from "@/api/projects";
import { getTeams, type Team } from "@/api/team";
import { AppFooter } from "@/components/footers/app-footer";
import { AnnouncementBanner } from "@/components/misc/AnnouncementBanner";
import { TabPathLinks } from "@/components/ui/tabs";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import type { Account } from "@/hooks/useApi";
import {
getAuthToken,
getAuthTokenWalletAddress,
} from "../../../@/api/auth-token";
import { loginRedirect } from "@/utils/redirects";
import { TWAutoConnect } from "../components/autoconnect";
import { loginRedirect } from "../login/loginRedirect";
import { AccountHeader } from "./components/AccountHeader";
import { getValidAccount } from "./settings/getAccount";

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/app/(app)/account/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { notFound } from "next/navigation";
import { getAuthToken } from "@/api/auth-token";
import { getTeams } from "@/api/team";
import { getMemberByAccountId } from "@/api/team-members";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../@/api/auth-token";
import { loginRedirect } from "../login/loginRedirect";
import { loginRedirect } from "@/utils/redirects";
import { AccountTeamsUI } from "./overview/AccountTeamsUI";
import { getValidAccount } from "./settings/getAccount";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import type { ThirdwebClient } from "thirdweb";
import { useActiveWallet, useDisconnect } from "thirdweb/react";
import { upload } from "thirdweb/storage";
import { doLogout } from "@/actions/auth-actions";
import { confirmEmailWithOTP } from "@/actions/confirmEmail";
import { apiServerProxy } from "@/actions/proxies";
import { updateAccount } from "@/actions/updateAccount";
import { resetAnalytics } from "@/analytics/reset";
import type { Account } from "@/hooks/useApi";
import { useDashboardRouter } from "@/lib/DashboardRouter";
import { doLogout } from "../../login/auth-actions";
import { AccountSettingsPageUI } from "./AccountSettingsPageUI";

export function AccountSettingsPage(props: {
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/app/(app)/account/settings/getAccount.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getAuthToken } from "@/api/auth-token";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import type { Account } from "@/hooks/useApi";
import { getAuthToken } from "../../../../@/api/auth-token";
import { loginRedirect } from "../../login/loginRedirect";
import { isAccountOnboardingComplete } from "../../login/onboarding/isOnboardingRequired";
import { loginRedirect } from "@/utils/redirects";
import { isAccountOnboardingComplete } from "../../../login/onboarding/isOnboardingRequired";

/**
* Just get the account object without enforcing onboarding.
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/app/(app)/account/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAuthToken } from "@/api/auth-token";
import { getDefaultTeam } from "@/api/team";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../../@/api/auth-token";
import { loginRedirect } from "../../login/loginRedirect";
import { loginRedirect } from "@/utils/redirects";
import { AccountSettingsPage } from "./AccountSettingsPage";
import { getValidAccount } from "./getAccount";

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/app/(app)/account/wallets/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAuthToken } from "@/api/auth-token";
import { getLinkedWallets } from "@/api/linked-wallets";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../../@/api/auth-token";
import { loginRedirect } from "../../login/loginRedirect";
import { loginRedirect } from "@/utils/redirects";
import { getValidAccount } from "../settings/getAccount";
import { LinkWallet } from "./LinkWalletUI";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { notFound } from "next/navigation";
import { getAuthToken } from "@/api/auth-token";
import { getTeamBySlug } from "@/api/team";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../../../../@/api/auth-token";
import { TeamOnboardingLayout } from "../../../../login/onboarding/onboarding-layout";
import { InviteTeamMembers } from "../../../../login/onboarding/team-onboarding/team-onboarding";
import { TeamOnboardingLayout } from "../../../../../login/onboarding/onboarding-layout";
import { InviteTeamMembers } from "../../../../../login/onboarding/team-onboarding/team-onboarding";

export default async function Page(props: {
params: Promise<{ team_slug: string }>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { differenceInDays } from "date-fns";
import { InfoIcon } from "lucide-react";
import { notFound } from "next/navigation";
import { getAuthToken, getAuthTokenWalletAddress } from "@/api/auth-token";
import { getProjects } from "@/api/projects";
import { getTeamBySlug, getTeams } from "@/api/team";
import { AppFooter } from "@/components/footers/app-footer";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import {
getAuthToken,
getAuthTokenWalletAddress,
} from "../../../../../@/api/auth-token";
import { loginRedirect } from "@/utils/redirects";
import { getValidAccount } from "../../../account/settings/getAccount";
import { loginRedirect } from "../../../login/loginRedirect";
import { TeamHeaderLoggedIn } from "../../../team/components/TeamHeader/team-header-logged-in.client";

export default async function Layout(props: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { notFound } from "next/navigation";
import { getAuthToken } from "@/api/auth-token";
import { getTeamBySlug } from "@/api/team";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { getAuthToken } from "../../../../../@/api/auth-token";
import { loginRedirect } from "../../../login/loginRedirect";
import { TeamOnboardingLayout } from "../../../login/onboarding/onboarding-layout";
import { TeamInfoForm } from "../../../login/onboarding/team-onboarding/team-onboarding";
import { loginRedirect } from "@/utils/redirects";
import { TeamOnboardingLayout } from "../../../../login/onboarding/onboarding-layout";
import { TeamInfoForm } from "../../../../login/onboarding/team-onboarding/team-onboarding";

export default async function Page(props: {
params: Promise<{ team_slug: string }>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound } from "next/navigation";
import { getAuthToken } from "@/api/auth-token";
import { getTeamBySlug, type Team } from "@/api/team";
import { getAuthToken } from "../../../../../../@/api/auth-token";
import { TeamOnboardingLayout } from "../../../../login/onboarding/onboarding-layout";
import { TeamOnboardingLayout } from "../../../../../login/onboarding/onboarding-layout";
import { PlanSelector } from "./_components/plan-selector";

export default async function Page(props: {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function RootLayout({
<body
className={cn("bg-background font-sans antialiased", fontSans.variable)}
>
<AppRouterProviders>{children}</AppRouterProviders>
<AppRouterProviders autoConnect={true}>{children}</AppRouterProviders>
<DashboardRouterTopProgressBar />
<NextTopLoader
color="hsl(var(--foreground))"
Expand Down
18 changes: 8 additions & 10 deletions apps/dashboard/src/app/(app)/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ThemeProvider, useTheme } from "next-themes";
import { ThemeProvider } from "next-themes";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import { useEffect, useMemo } from "react";
import { Toaster } from "sonner";
import {
ThirdwebProvider,
useActiveAccount,
useConnectionManager,
} from "thirdweb/react";
import { CustomConnectWallet } from "@/components/connect-wallet";
import { Toaster } from "@/components/ui/sonner";
import { isSanctionedAddress } from "@/constants/eth-sanctioned-addresses";
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { useAllChainsData } from "@/hooks/chains/allChains";
Expand All @@ -20,21 +20,24 @@ import { TWAutoConnect } from "./components/autoconnect";
const queryClient = new QueryClient();
const thirdwebClient = getClientThirdwebClient();

export function AppRouterProviders(props: { children: React.ReactNode }) {
export function AppRouterProviders(props: {
children: React.ReactNode;
autoConnect: boolean;
}) {
return (
<NuqsAdapter>
<QueryClientProvider client={queryClient}>
<SyncChainStores />
<ThirdwebProvider>
<SyncChainDefinitionsToConnectionManager />
<TWAutoConnect client={thirdwebClient} />
{props.autoConnect && <TWAutoConnect client={thirdwebClient} />}
<ThemeProvider
attribute="class"
defaultTheme="dark"
disableTransitionOnChange
enableSystem={false}
>
<ToasterSetup />
<Toaster richColors />
<SanctionedAddressesChecker>
{props.children}
</SanctionedAddressesChecker>
Expand All @@ -45,11 +48,6 @@ export function AppRouterProviders(props: { children: React.ReactNode }) {
);
}

function ToasterSetup() {
const { theme } = useTheme();
return <Toaster richColors theme={theme === "light" ? "light" : "dark"} />;
}

function SyncChainDefinitionsToConnectionManager() {
const { allChainsV5 } = useAllChainsData();
const connectionManager = useConnectionManager();
Expand Down
Loading
Loading