Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor layout and enhance login/signup UI components

Bill Yangc2ababf52d33
diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx
index 02efbb416..1f68d9e0e 100644
--- a/client/src/app/layout.tsx
+++ b/client/src/app/layout.tsx
@@ -84,20 +84,14 @@ export default function RootLayout({
return (
<html lang="en" className="dark">
- <body className={`${inter.className} bg-background text-foreground`}>
- <Toaster />
- <TooltipProvider>
- <QueryProvider>
- {pathname === "/login" ? (
- <div className="min-h-full flex items-center justify-center">
- {children}
- </div>
- ) : (
- children
- )}
- </QueryProvider>
- </TooltipProvider>
- </body>
+ <Toaster />
+ <TooltipProvider>
+ <body
+ className={`${inter.className} bg-background text-foreground h-full`}
+ >
+ <QueryProvider>{children}</QueryProvider>
+ </body>
+ </TooltipProvider>
</html>
);
}
diff --git a/client/src/app/login/page.tsx b/client/src/app/login/page.tsx
index 6fb82f937..ee8824fec 100644
--- a/client/src/app/login/page.tsx
+++ b/client/src/app/login/page.tsx
@@ -12,6 +12,8 @@ import { Alert, AlertDescription, AlertTitle } from "../../components/ui/alert";
import { authClient } from "../../lib/auth";
import { IS_CLOUD } from "../../lib/const";
import { userStore } from "../../lib/userStore";
+import { StandardPage } from "../../components/StandardPage";
+import { GithubLogo, GoogleLogo } from "@phosphor-icons/react/dist/ssr";
export default function Page() {
const [email, setEmail] = useState("");
@@ -61,10 +63,10 @@ export default function Page() {
return (
<div className="flex justify-center items-center h-screen w-full">
- <Card className="w-full max-w-sm">
+ <Card className="w-full max-w-sm p-1">
<CardHeader>
<CardTitle className="text-2xl flex justify-center">
- Welcome back!
+ Sign in
</CardTitle>
</CardHeader>
<CardContent>
@@ -75,7 +77,7 @@ export default function Page() {
<Input
id={"email"}
type={"email"}
- placeholder={"email"}
+ placeholder={"[email protected]"}
required
value={email}
onChange={(e) => setEmail(e.target.value)}
@@ -94,13 +96,18 @@ export default function Page() {
<Input
id="password"
type="password"
- placeholder="password"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
+ placeholder="••••••••"
/>
</div>
- <Button type="submit" className="w-full" disabled={isLoading}>
+ <Button
+ type="submit"
+ className="w-full"
+ disabled={isLoading}
+ variant={"success"}
+ >
{isLoading ? "Logging in..." : "Login"}
</Button>
@@ -118,6 +125,7 @@ export default function Page() {
variant="outline"
onClick={() => handleSocialSignIn("google")}
>
+ <GoogleLogo weight="bold" />
Google
</Button>
<Button
@@ -125,15 +133,9 @@ export default function Page() {
variant="outline"
onClick={() => handleSocialSignIn("github")}
>
+ <GithubLogo weight="bold" />
GitHub
</Button>
- <Button
- type="button"
- variant="outline"
- onClick={() => handleSocialSignIn("twitter")}
- >
- X (Twitter)
- </Button>
</div>
</>
)}
diff --git a/client/src/app/settings/account/components/DeleteAccount.tsx b/client/src/app/settings/account/components/DeleteAccount.tsx
index 0d7d43ef8..5b88da0d3 100644
--- a/client/src/app/settings/account/components/DeleteAccount.tsx
+++ b/client/src/app/settings/account/components/DeleteAccount.tsx
@@ -104,7 +104,7 @@ export function DeleteAccount() {
<Input
id="password"
type="password"
- placeholder="Enter your password"
+ placeholder="••••••••"
value={password}
onChange={(e) => setPassword(e.target.value)}
className={`mt-1 ${passwordError ? "border-red-500" : ""}`}
diff --git a/client/src/app/settings/organizations/components/AddUser.tsx b/client/src/app/settings/organizations/components/AddUser.tsx
index f26b66f8a..70d74da4d 100644
--- a/client/src/app/settings/organizations/components/AddUser.tsx
+++ b/client/src/app/settings/organizations/components/AddUser.tsx
@@ -117,6 +117,7 @@ export function AddUser({ refetch }: { refetch: () => void }) {
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
+ placeholder="••••••••"
type="password"
/>
</div>
@@ -126,6 +127,7 @@ export function AddUser({ refetch }: { refetch: () => void }) {
id="confirmPassword"
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)}
+ placeholder="••••••••"
type="password"
/>
</div>
diff --git a/client/src/app/signup/page.tsx b/client/src/app/signup/page.tsx
index 4a946771f..7d3423165 100644
--- a/client/src/app/signup/page.tsx
+++ b/client/src/app/signup/page.tsx
@@ -1,31 +1,31 @@
"use client";
-import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { GithubLogo, GoogleLogo } from "@phosphor-icons/react/dist/ssr";
+import { motion } from "framer-motion";
import {
AlertCircle,
- Building2,
- ArrowRight,
+ AppWindow,
ArrowLeft,
+ ArrowRight,
+ Building2,
Check,
- AppWindow,
Code,
Sparkles,
User,
} from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
+import { useState } from "react";
+import { addSite } from "../../api/admin/sites";
+import { CodeSnippet } from "../../components/CodeSnippet";
import { Alert, AlertDescription, AlertTitle } from "../../components/ui/alert";
import { authClient } from "../../lib/auth";
-import { userStore } from "../../lib/userStore";
import { BACKEND_URL } from "../../lib/const";
-import { CodeSnippet } from "../../components/CodeSnippet";
-import { StandardPage } from "../../components/StandardPage";
-import { motion } from "framer-motion";
-import { addSite } from "../../api/admin/sites";
+import { userStore } from "../../lib/userStore";
// Animation variants for step transitions
const contentVariants = {
@@ -226,7 +226,7 @@ export default function SignupPage() {
<Input
id="password"
type="password"
- placeholder="password"
+ placeholder="••••••••"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
@@ -248,7 +248,7 @@ export default function SignupPage() {
</span>
</div>
- <div className="grid grid-cols-3 gap-2">
+ <div className="grid grid-cols-2 gap-2">
<Button
type="button"
variant="outline"
@@ -260,6 +260,7 @@ export default function SignupPage() {
}}
className="transition-all duration-300 hover:bg-muted"
>
+ <GoogleLogo weight="bold" />
Google
</Button>
<Button
@@ -273,23 +274,10 @@ export default function SignupPage() {
}}
className="transition-all duration-300 hover:bg-muted"
>
+ <GithubLogo weight="bold" />
GitHub
</Button>
- <Button
- type="button"
- variant="outline"
- onClick={() => {
- authClient.signIn.social({
- provider: "twitter",
- callbackURL: "/",
- });
- }}
- className="transition-all duration-300 hover:bg-muted"
- >
- X
- </Button>
</div>
-
<div className="text-center text-sm">
Already have an account?{" "}
<Link
@@ -478,36 +466,35 @@ export default function SignupPage() {
const progressPercentage = ((currentStep - 1) / 3) * 100;
return (
- <StandardPage>
- <div className="flex justify-center items-center min-h-screen bg-background p-4">
- <Card className="w-full max-w-4xl p-0 overflow-hidden shadow-lg border-border">
- <div className="flex flex-col md:flex-row h-full">
- {/* Left sidebar with steps */}
- <div className="bg-muted/70 md:w-80 p-6 relative overflow-hidden">
- <div className="absolute top-0 left-0 right-0 h-1 bg-muted-foreground/20 overflow-hidden">
- <div
- className="h-full bg-primary transition-all duration-500 ease-out"
- style={{ width: `${progressPercentage}%` }}
- />
- </div>
- <div className="relative z-10 flex flex-col space-y-4">
- <h1 className="text-xl font-bold mb-6">
- Get Started with Frogstats
- </h1>
+ <div className="flex justify-center items-center min-h-screen bg-background p-4">
+ <Card className="w-full max-w-4xl p-0 overflow-hidden shadow-lg border-border">
+ <div className="flex flex-col md:flex-row h-full">
+ {/* Left sidebar with steps */}
+ <div className="bg-muted/70 md:w-80 p-6 relative overflow-hidden">
+ <div className="absolute top-0 left-0 right-0 h-1 bg-muted-foreground/20 overflow-hidden">
+ <div
+ className="h-full bg-primary transition-all duration-500 ease-out"
+ style={{ width: `${progressPercentage}%` }}
+ />
+ </div>
+ <div className="relative z-10 flex flex-col space-y-4">
+ <h1 className="text-xl font-bold mb-6">
+ Get Started with Frogstats
+ </h1>
- {[1, 2, 3, 4].map((step) => (
+ {[1, 2, 3, 4].map((step) => (
+ <div
+ key={step}
+ className={`flex items-center space-x-3 py-3 ${
+ currentStep === step
+ ? "text-primary font-medium"
+ : currentStep > step
+ ? "text-muted-foreground"
+ : "text-muted-foreground/60"
+ }`}
+ >
<div
- key={step}
- className={`flex items-center space-x-3 py-3 ${
- currentStep === step
- ? "text-primary font-medium"
- : currentStep > step
- ? "text-muted-foreground"
- : "text-muted-foreground/60"
- }`}
- >
- <div
- className={`
+ className={`
flex items-center justify-center w-8 h-8 rounded-full
${
currentStep === step
@@ -518,41 +505,40 @@ export default function SignupPage() {
}
transition-all duration-300
`}
- >
- {currentStep > step ? (
- <Check className="h-4 w-4" />
- ) : (
- getStepIcon(step)
- )}
- </div>
- <span>
- {step === 1 && "Create account"}
- {step === 2 && "Create organization"}
- {step === 3 && "Add website"}
- {step === 4 && "Track your first pageview"}
- </span>
+ >
+ {currentStep > step ? (
+ <Check className="h-4 w-4" />
+ ) : (
+ getStepIcon(step)
+ )}
</div>
- ))}
- </div>
+ <span>
+ {step === 1 && "Create account"}
+ {step === 2 && "Create organization"}
+ {step === 3 && "Add website"}
+ {step === 4 && "Track your first pageview"}
+ </span>
+ </div>
+ ))}
</div>
+ </div>
- {/* Right content area */}
- <div className="p-6 md:p-8 flex-1 h-[600px] flex flex-col">
- {error && (
- <Alert variant="destructive" className="mb-6">
- <AlertCircle className="h-4 w-4" />
- <AlertTitle>Error</AlertTitle>
- <AlertDescription>{error}</AlertDescription>
- </Alert>
- )}
-
- <div className="flex-1 flex flex-col justify-between">
- <div className="min-h-[400px]">{renderStepContent()}</div>
- </div>
+ {/* Right content area */}
+ <div className="p-6 md:p-8 flex-1 h-[600px] flex flex-col">
+ {error && (
+ <Alert variant="destructive" className="mb-6">
+ <AlertCircle className="h-4 w-4" />
+ <AlertTitle>Error</AlertTitle>
+ <AlertDescription>{error}</AlertDescription>
+ </Alert>
+ )}
+
+ <div className="flex-1 flex flex-col justify-between">
+ <div className="min-h-[400px]">{renderStepContent()}</div>
</div>
</div>
- </Card>
- </div>
- </StandardPage>
+ </div>
+ </Card>
+ </div>
);
}
diff --git a/client/src/components/StandardPage.tsx b/client/src/components/StandardPage.tsx
index b001b7e0b..409d09710 100644
--- a/client/src/components/StandardPage.tsx
+++ b/client/src/components/StandardPage.tsx
@@ -4,7 +4,7 @@ export function StandardPage({ children }: { children: React.ReactNode }) {
return (
<div className="min-h-full">
<TopBar />
- <main className="flex min-h-screen flex-col items-center p-4">
+ <main className="flex flex-col items-center p-4">
<div className="w-full max-w-6xl">{children}</div>
</main>
</div>
diff --git a/client/src/components/ui/button.tsx b/client/src/components/ui/button.tsx
index b5e74b9ae..8cde26852 100644
--- a/client/src/components/ui/button.tsx
+++ b/client/src/components/ui/button.tsx
@@ -16,7 +16,7 @@ const buttonVariants = cva(
accent:
"bg-neutral-500 text-neutral-900 shadow-sm hover:bg-neutral-500/80 dark:bg-accent-600 dark:text-neutral-50 dark:hover:bg-accent-600/90",
success:
- "bg-green-500 text-neutral-50 shadow-sm hover:bg-green-500/90 dark:bg-green-900 dark:text-neutral-50 dark:hover:bg-green-900/90",
+ "bg-green-500 text-neutral-50 shadow-sm hover:bg-green-500/90 dark:bg-green-800 dark:text-neutral-50 dark:hover:bg-green-700/90",
destructive:
"bg-red-500 text-neutral-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/90",
warning: