Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ph/remove-cfworker-ty…
Browse files Browse the repository at this point in the history
…pes-imports
  • Loading branch information
arcoraven committed Mar 4, 2025
2 parents fabb565 + 575b7b3 commit dd052a7
Show file tree
Hide file tree
Showing 53 changed files with 2,417 additions and 3,963 deletions.
5 changes: 0 additions & 5 deletions .changeset/brown-onions-tickle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rich-planes-drive.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/short-breads-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/service-utils": patch
---

[service-utils] remove unneeded cloudflare worker types
2 changes: 1 addition & 1 deletion apps/dashboard/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const baseNextConfig: NextConfig = {
// re-write /home to / (this is so that logged in users will be able to go to /home and NOT be redirected to the logged in app)
{
source: "/home",
destination: "/",
destination: "https://landing.thirdweb.com",
},
...FRAMER_PATHS.map((path) => ({
source: path,
Expand Down
40 changes: 20 additions & 20 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-switch": "^1.1.3",
"@radix-ui/react-tooltip": "1.1.8",
"@sentry/nextjs": "9.2.0",
"@shazow/whatsabi": "^0.19.0",
"@tanstack/react-query": "5.66.9",
"@sentry/nextjs": "9.3.0",
"@shazow/whatsabi": "0.20.0",
"@tanstack/react-query": "5.67.1",
"@tanstack/react-table": "^8.21.2",
"@thirdweb-dev/service-utils": "workspace:*",
"@vercel/functions": "2.0.0",
Expand All @@ -61,13 +61,13 @@
"date-fns": "4.1.0",
"fetch-event-stream": "0.1.5",
"flat": "^6.0.1",
"framer-motion": "12.4.7",
"framer-motion": "12.4.10",
"fuse.js": "7.1.0",
"idb-keyval": "^6.2.1",
"input-otp": "^1.4.1",
"ioredis": "^5.5.0",
"ipaddr.js": "^2.2.0",
"lucide-react": "0.476.0",
"lucide-react": "0.477.0",
"next": "15.2.0",
"next-plausible": "^3.12.4",
"next-themes": "^0.4.4",
Expand All @@ -94,7 +94,7 @@
"shiki": "1.27.0",
"sonner": "2.0.1",
"spdx-correct": "^3.2.0",
"swagger-ui-react": "^5.19.0",
"swagger-ui-react": "^5.20.0",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7",
"thirdweb": "workspace:*",
Expand All @@ -104,21 +104,21 @@
},
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@chromatic-com/storybook": "3.2.4",
"@chromatic-com/storybook": "3.2.5",
"@next/bundle-analyzer": "15.2.0",
"@next/eslint-plugin-next": "15.2.0",
"@playwright/test": "1.50.1",
"@storybook/addon-essentials": "8.6.0",
"@storybook/addon-interactions": "8.6.0",
"@storybook/addon-links": "8.6.0",
"@storybook/addon-onboarding": "8.6.0",
"@storybook/addon-viewport": "8.6.0",
"@storybook/blocks": "8.6.0",
"@storybook/nextjs": "8.6.0",
"@storybook/react": "8.6.0",
"@storybook/test": "8.6.0",
"@storybook/addon-essentials": "8.6.3",
"@storybook/addon-interactions": "8.6.3",
"@storybook/addon-links": "8.6.3",
"@storybook/addon-onboarding": "8.6.3",
"@storybook/addon-viewport": "8.6.3",
"@storybook/blocks": "8.6.3",
"@storybook/nextjs": "8.6.3",
"@storybook/react": "8.6.3",
"@storybook/test": "8.6.3",
"@types/color": "4.2.0",
"@types/node": "22.13.5",
"@types/node": "22.13.9",
"@types/papaparse": "^5.3.15",
"@types/pluralize": "^0.0.33",
"@types/qrcode": "^1.5.5",
Expand All @@ -130,16 +130,16 @@
"@typescript-eslint/eslint-plugin": "7.14.1",
"@typescript-eslint/parser": "7.14.1",
"autoprefixer": "^10.4.19",
"checkly": "^4.19.1",
"checkly": "5.0.1",
"eslint": "8.57.0",
"eslint-config-biome": "1.9.4",
"eslint-plugin-react-compiler": "19.0.0-beta-e1e972c-20250221",
"eslint-plugin-storybook": "0.11.3",
"knip": "5.45.0",
"next-sitemap": "^4.2.3",
"postcss": "8.5.3",
"storybook": "8.6.0",
"storybook": "8.6.3",
"tailwindcss": "3.4.17",
"typescript": "5.7.3"
"typescript": "5.8.2"
}
}
1 change: 0 additions & 1 deletion apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ export type RotateSecretKeyAPIReturnType = {
data: {
secret: string;
secretMasked: string;
secretHash: string;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function MobileBurgerMenuButton(
</Link>

<Link
href="/"
href="/home"
className="text-base text-muted-foreground hover:text-foreground"
>
Home Page
Expand Down
56 changes: 43 additions & 13 deletions apps/dashboard/src/app/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const LazyOnboardingUI = lazy(
() => import("./onboarding/on-boarding-ui.client"),
);

const wallets = [
const loginOptions = [
inAppWallet({
auth: {
options: [
Expand All @@ -45,9 +45,27 @@ const wallets = [
createWallet("io.zerion.wallet"),
];

const inAppWalletLoginOptions = [
inAppWallet({
auth: {
options: [
"google",
"apple",
"facebook",
"github",
"email",
"phone",
"passkey",
"wallet",
],
},
}),
];

export function LoginAndOnboardingPage(props: {
account: Account | undefined;
redirectPath: string;
loginWithInAppWallet: boolean;
}) {
return (
<div className="relative flex min-h-dvh flex-col overflow-hidden bg-background">
Expand Down Expand Up @@ -91,6 +109,7 @@ export function LoginAndOnboardingPage(props: {
<LoginAndOnboardingPageContent
account={props.account}
redirectPath={props.redirectPath}
loginWithInAppWallet={props.loginWithInAppWallet}
/>
</div>
);
Expand All @@ -99,6 +118,7 @@ export function LoginAndOnboardingPage(props: {
export function LoginAndOnboardingPageContent(props: {
account: Account | undefined;
redirectPath: string;
loginWithInAppWallet: boolean;
}) {
return (
<div className="relative flex grow flex-col">
Expand All @@ -114,6 +134,7 @@ export function LoginAndOnboardingPageContent(props: {
<PageContent
redirectPath={props.redirectPath}
account={props.account}
loginWithInAppWallet={props.loginWithInAppWallet}
/>
</ClientOnly>
</main>
Expand All @@ -139,6 +160,7 @@ function LoadingCard() {
function PageContent(props: {
redirectPath: string;
account: Account | undefined;
loginWithInAppWallet: boolean;
}) {
const [screen, setScreen] = useState<
| { id: "login" }
Expand Down Expand Up @@ -190,7 +212,12 @@ function PageContent(props: {
}

if (connectionStatus !== "connected" || screen.id === "login") {
return <CustomConnectEmbed onLogin={onLogin} />;
return (
<CustomConnectEmbed
onLogin={onLogin}
loginWithInAppWallet={props.loginWithInAppWallet}
/>
);
}

if (screen.id === "onboarding") {
Expand All @@ -215,13 +242,24 @@ function PageContent(props: {

function CustomConnectEmbed(props: {
onLogin: () => void;
loginWithInAppWallet: boolean;
}) {
const { theme } = useTheme();
const client = useThirdwebClient();
const [turnstileToken, setTurnstileToken] = useState("");

return (
<div className="flex flex-col items-center gap-4">
<Turnstile
options={{
// only show if interaction is required
appearance: "interaction-only",
// match the theme of the rest of the app
theme: theme === "light" ? "light" : "dark",
}}
siteKey={TURNSTILE_SITE_KEY}
onSuccess={(token) => setTurnstileToken(token)}
/>
<ConnectEmbed
auth={{
getLoginPayload,
Expand All @@ -247,24 +285,16 @@ function CustomConnectEmbed(props: {
return isLoggedInResult;
},
}}
wallets={wallets}
wallets={
props.loginWithInAppWallet ? inAppWalletLoginOptions : loginOptions
}
client={client}
modalSize="wide"
theme={getSDKTheme(theme === "light" ? "light" : "dark")}
className="shadow-lg"
privacyPolicyUrl="/privacy-policy"
termsOfServiceUrl="/terms"
/>
<Turnstile
options={{
// only show if interaction is required
appearance: "interaction-only",
// match the theme of the rest of the app
theme: theme === "light" ? "light" : "dark",
}}
siteKey={TURNSTILE_SITE_KEY}
onSuccess={(token) => setTurnstileToken(token)}
/>
</div>
);
}
13 changes: 10 additions & 3 deletions apps/dashboard/src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { isValidEncodedRedirectPath } from "./isValidEncodedRedirectPath";

export default async function Page(props: {
searchParams: Promise<{
next?: string;
next: string | string[] | undefined;
"in-app-wallet": string | string[] | undefined;
}>;
}) {
const nextPath = (await props.searchParams).next;
const searchParams = await props.searchParams;
const nextPath =
typeof searchParams.next === "string" ? searchParams.next : undefined;
const account = await getRawAccount();

// don't redirect away from login page if authToken is already present and onboarding is done
Expand All @@ -20,6 +23,10 @@ export default async function Page(props: {
nextPath && isValidEncodedRedirectPath(nextPath) ? nextPath : "/team";

return (
<LoginAndOnboardingPage account={account} redirectPath={redirectPath} />
<LoginAndOnboardingPage
account={account}
redirectPath={redirectPath}
loginWithInAppWallet={searchParams["in-app-wallet"] === "true"}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function NebulaLoginPage(props: {

{showPage === "connect" && (
<LoginAndOnboardingPageContent
loginWithInAppWallet={false}
account={props.account}
redirectPath={
message ? `/?prompt=${encodeURIComponent(message)}` : "/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import type { EngineInstance } from "@3rdweb-sdk/react/hooks/useEngine";
import { ChakraProvider } from "@chakra-ui/react";
import { ChakraProviderSetup } from "../../../../../../../../@/components/ChakraProviderSetup";
import { getValidAccount } from "../../../../../../../account/settings/getAccount";
import { getAuthToken } from "../../../../../../../api/lib/getAuthToken";
import { loginRedirect } from "../../../../../../../login/loginRedirect";
Expand Down Expand Up @@ -54,7 +54,7 @@ export default async function Layout(props: {
}

return (
<ChakraProvider>
<ChakraProviderSetup>
<div className="flex grow flex-col">
<EngineInstanceHeader
instance={instance}
Expand All @@ -77,7 +77,7 @@ export default async function Layout(props: {
</EnsureEnginePermission>
</EngineSidebarLayout>
</div>
</ChakraProvider>
</ChakraProviderSetup>
);
}

Expand All @@ -92,7 +92,7 @@ function EngineInstanceHeader(props: {
: instance.url;

return (
<div className="border-b">
<div className="border-border border-b">
<div className="container py-6">
<Breadcrumb>
<BreadcrumbList>
Expand Down
Loading

0 comments on commit dd052a7

Please sign in to comment.