Skip to content

Commit a5b8885

Browse files
committed
Dashboard: Login page UI tweaks, remove phone login notice (#8524)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR enhances the `LoginPage.tsx` component by adding a theme toggle button, updating the layout, and improving the UI elements. It incorporates new components and refines the existing structure for better aesthetics and functionality. ### Detailed summary - Added imports for `MoonIcon`, `SunIcon`, `DotsBackgroundPattern`, `Button`, and `Skeleton`. - Updated header background and layout, adjusting padding and margins. - Introduced a `ToggleThemeButton` component for theme switching. - Removed deprecated login message and background image. - Enhanced the `LoginPageContainer` structure for cleaner rendering. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added decorative dots background pattern to enhance the login page visual design. * Added theme toggle button enabling light and dark mode switching. * Enhanced header with brand text display alongside the logo. * **Style** * Streamlined login page layout with a simplified and cleaner container structure. * Adjusted spacing, padding, and overall dimensions for improved visual hierarchy. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 53b6d1b commit a5b8885

1 file changed

Lines changed: 44 additions & 31 deletions

File tree

apps/dashboard/src/app/login/LoginPage.tsx

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { Turnstile } from "@marsidev/react-turnstile";
4+
import { MoonIcon, SunIcon } from "lucide-react";
45
import Link from "next/link";
56
import { useTheme } from "next-themes";
67
import { lazy, Suspense, useEffect, useState } from "react";
@@ -20,13 +21,16 @@ import {
2021
} from "@/actions/auth-actions";
2122
import { resetAnalytics } from "@/analytics/reset";
2223
import { ClientOnly } from "@/components/blocks/client-only";
23-
import { ToggleThemeButton } from "@/components/blocks/color-mode-toggle";
2424
import { GenericLoadingPage } from "@/components/blocks/skeletons/GenericLoadingPage";
25+
import { DotsBackgroundPattern } from "@/components/ui/background-patterns";
26+
import { Button } from "@/components/ui/button";
2527
import { Spinner } from "@/components/ui/Spinner";
28+
import { Skeleton } from "@/components/ui/skeleton";
2629
import { LAST_USED_PROJECT_ID, LAST_USED_TEAM_ID } from "@/constants/cookie";
2730
import { NEXT_PUBLIC_TURNSTILE_SITE_KEY } from "@/constants/public-envs";
2831
import type { Account } from "@/hooks/useApi";
2932
import { useDashboardRouter } from "@/lib/DashboardRouter";
33+
import { cn } from "@/lib/utils";
3034
import { isAccountOnboardingComplete } from "@/utils/account-onboarding";
3135
import { deleteCookie } from "@/utils/cookie";
3236
import { getSDKTheme } from "@/utils/sdk-component-theme";
@@ -76,13 +80,16 @@ export function LoginAndOnboardingPage(props: {
7680
}) {
7781
return (
7882
<div className="relative flex min-h-dvh flex-col overflow-hidden bg-background">
79-
<div className="border-b bg-card">
80-
<header className="container flex w-full flex-row items-center justify-between px-6 py-4">
81-
<div className="flex shrink-0 items-center gap-3">
83+
<div className="bg-background backdrop-blur-lg">
84+
<header className="container flex w-full flex-row items-center justify-between px-6 py-5 max-w-5xl">
85+
<div className="flex shrink-0 items-center gap-2">
8286
<ThirdwebMiniLogo className="size-7 md:size-8" />
87+
<p className="text-2xl font-semibold tracking-tight hidden md:block">
88+
thirdweb
89+
</p>
8390
</div>
8491

85-
<div className="flex items-center gap-4">
92+
<div className="flex items-center gap-2">
8693
<div className="flex items-center gap-2">
8794
<Link
8895
className="px-2 text-muted-foreground text-sm hover:text-foreground"
@@ -114,39 +121,17 @@ export function LoginAndOnboardingPage(props: {
114121
redirectPath={props.redirectPath}
115122
/>
116123

124+
<DotsBackgroundPattern />
117125
<ResetLastUsedCookies />
118126
</div>
119127
);
120128
}
121129

122130
function LoginPageContainer(props: { children: React.ReactNode }) {
123131
return (
124-
<>
125-
<main className="container z-10 flex grow flex-col items-center justify-center gap-6 py-24 px-2">
126-
{props.children}
127-
</main>
128-
129-
{/* eslint-disable-next-line @next/next/no-img-element */}
130-
<img
131-
alt=""
132-
className="-bottom-12 -right-12 pointer-events-none fixed lg:right-0 lg:bottom-0"
133-
src="/assets/login/background.svg"
134-
/>
135-
136-
<footer className="z-20 relative bg-background">
137-
<div className="px-4 border-t p-4 text-center">
138-
<div className="text-sm font-medium mb-1">
139-
<span>Login with phone number is no longer supported</span>
140-
</div>
141-
<div className="text-sm text-muted-foreground">
142-
<p>
143-
You can instead log into your account using your account email
144-
address.
145-
</p>
146-
</div>
147-
</div>
148-
</footer>
149-
</>
132+
<main className="container z-10 flex grow flex-col items-center justify-center gap-6 py-24 px-2">
133+
{props.children}
134+
</main>
150135
);
151136
}
152137

@@ -357,3 +342,31 @@ function ConnectEmbedSizedLoadingCard() {
357342
</ConnectEmbedSizedCard>
358343
);
359344
}
345+
346+
function ToggleThemeButton(props: { className?: string }) {
347+
const { setTheme, theme } = useTheme();
348+
349+
return (
350+
<ClientOnly
351+
ssr={<Skeleton className="size-[36px] rounded-full border bg-accent" />}
352+
>
353+
<Button
354+
aria-label="Toggle theme"
355+
className={cn(
356+
"h-auto w-auto rounded-full p-2 text-muted-foreground hover:text-foreground",
357+
props.className,
358+
)}
359+
onClick={() => {
360+
setTheme(theme === "dark" ? "light" : "dark");
361+
}}
362+
variant="ghost"
363+
>
364+
{theme === "light" ? (
365+
<SunIcon className="size-5 " />
366+
) : (
367+
<MoonIcon className="size-5 " />
368+
)}
369+
</Button>
370+
</ClientOnly>
371+
);
372+
}

0 commit comments

Comments
 (0)