Skip to content

Commit 20253e2

Browse files
committed
Refactor components for consistency and readability
- Ensured all components return statements are properly formatted.
1 parent 92d1bb9 commit 20253e2

File tree

27 files changed

+622
-431
lines changed

27 files changed

+622
-431
lines changed

convex/betterAuth/generatedSchema.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file is auto-generated. Do not edit this file manually.
33
* To regenerate the schema, run:
44
* `npx @better-auth/cli generate --output generatedSchema.ts -y`
5-
*
5+
*
66
* To customize the schema, generate to an alternate file and import
77
* the table definitions to your schema file. See
88
* https://labs.convex.dev/better-auth/features/local-install#adding-custom-indexes.
@@ -26,7 +26,7 @@ export const tables = {
2626
userId: v.optional(v.union(v.null(), v.string())),
2727
foo: v.optional(v.union(v.null(), v.string())),
2828
})
29-
.index("email_name", ["email","name"])
29+
.index("email_name", ["email", "name"])
3030
.index("name", ["name"])
3131
.index("userId", ["userId"])
3232
.index("username", ["username"]),
@@ -40,7 +40,7 @@ export const tables = {
4040
userId: v.string(),
4141
})
4242
.index("expiresAt", ["expiresAt"])
43-
.index("expiresAt_userId", ["expiresAt","userId"])
43+
.index("expiresAt_userId", ["expiresAt", "userId"])
4444
.index("token", ["token"])
4545
.index("userId", ["userId"]),
4646
account: defineTable({
@@ -58,8 +58,8 @@ export const tables = {
5858
updatedAt: v.number(),
5959
})
6060
.index("accountId", ["accountId"])
61-
.index("accountId_providerId", ["accountId","providerId"])
62-
.index("providerId_userId", ["providerId","userId"])
61+
.index("accountId_providerId", ["accountId", "providerId"])
62+
.index("providerId_userId", ["providerId", "userId"])
6363
.index("userId", ["userId"]),
6464
verification: defineTable({
6565
identifier: v.string(),
@@ -74,8 +74,7 @@ export const tables = {
7474
secret: v.string(),
7575
backupCodes: v.string(),
7676
userId: v.string(),
77-
})
78-
.index("userId", ["userId"]),
77+
}).index("userId", ["userId"]),
7978
jwks: defineTable({
8079
publicKey: v.string(),
8180
privateKey: v.string(),

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' 'src/**/*.tsx' -i '**/*.test.ts' -c 'npm run build' --initial",
1111
"predev": "convex dev --skip-push && node -e \"if (!require('fs').existsSync('dist')) require('fs').mkdirSync('dist', { recursive: true })\"",
1212
"build": "convex codegen && next build",
13-
"lint": "next lint && tsc -p convex && eslint convex"
13+
"lint": "next lint && tsc -p convex && eslint convex",
14+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\" \"convex/**/*.{ts,js}\"",
15+
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\" \"convex/**/*.{ts,js}\""
1416
},
1517
"dependencies": {
1618
"@convex-dev/better-auth": "^0.10.10",

src/app/(unauth)/forget-password/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Send } from "lucide-react"
2-
import { ForgotPassword } from "@/components/auth/ForgotPassword"
1+
import { Send } from "lucide-react";
2+
import { ForgotPassword } from "@/components/auth/ForgotPassword";
33

44
export default function ForgotPasswordPage() {
55
return (
@@ -27,5 +27,5 @@ export default function ForgotPasswordPage() {
2727
/>
2828
</div>
2929
</div>
30-
)
30+
);
3131
}

src/app/(unauth)/sign-in/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Send } from "lucide-react"
2-
import { SignInForm } from "@/components/auth/SignInForm"
1+
import { Send } from "lucide-react";
2+
import { SignInForm } from "@/components/auth/SignInForm";
33

44
export default function SignInPage() {
55
return (
@@ -27,5 +27,5 @@ export default function SignInPage() {
2727
/>
2828
</div>
2929
</div>
30-
)
30+
);
3131
}

src/app/(unauth)/sign-up/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Send } from "lucide-react"
2-
import { SignupForm } from "@/components/auth/SignUpForm"
1+
import { Send } from "lucide-react";
2+
import { SignupForm } from "@/components/auth/SignUpForm";
33

44
export default function SignupPage() {
55
return (
@@ -27,5 +27,5 @@ export default function SignupPage() {
2727
/>
2828
</div>
2929
</div>
30-
)
30+
);
3131
}

src/app/layout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { ConvexClientProvider } from "../components/providers/ConvexClientProvider";
22
import { getToken } from "@/lib/auth/server";
33
import { PropsWithChildren } from "react";
4-
import { Manrope } from "next/font/google"
5-
import type { Metadata } from "next"
4+
import { Manrope } from "next/font/google";
5+
import type { Metadata } from "next";
66
import "./globals.css";
77
import { ThemeProvider } from "@/components/providers/ThemeProvider";
88

9-
109
const manrope = Manrope({
1110
subsets: ["latin"],
1211
variable: "--font-manrope",
13-
})
12+
});
1413

1514
export const metadata: Metadata = {
1615
title: "Sendable.ai - AI-Powered Email Outreach Platform",
17-
description: "Generate personalized cold emails with AI. Automate research, personalization, and follow-ups for sales, recruiting, and networking.",
18-
}
16+
description:
17+
"Generate personalized cold emails with AI. Automate research, personalization, and follow-ups for sales, recruiting, and networking.",
18+
};
1919

2020
export default async function RootLayout({ children }: PropsWithChildren) {
2121
const token = await getToken();

src/app/not-found.tsx

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
"use client"
1+
"use client";
22

3-
import { motion } from "framer-motion"
4-
import { ArrowRight } from "lucide-react"
5-
import { Button } from "@/components/ui/button"
6-
import Link from "next/link"
3+
import { motion } from "framer-motion";
4+
import { ArrowRight } from "lucide-react";
5+
import { Button } from "@/components/ui/button";
6+
import Link from "next/link";
77

88
export default function NotFound() {
99
return (
@@ -18,7 +18,9 @@ export default function NotFound() {
1818
transition={{ duration: 0.6 }}
1919
className="mb-8"
2020
>
21-
<h1 className="text-7xl sm:text-8xl font-bold text-zinc-800 mb-4">404</h1>
21+
<h1 className="text-7xl sm:text-8xl font-bold text-zinc-800 mb-4">
22+
404
23+
</h1>
2224
</motion.div>
2325

2426
<motion.div
@@ -27,9 +29,12 @@ export default function NotFound() {
2729
transition={{ duration: 0.6, delay: 0.1 }}
2830
className="mb-6"
2931
>
30-
<h2 className="text-3xl sm:text-4xl font-bold text-white mb-4">Page Not Found</h2>
32+
<h2 className="text-3xl sm:text-4xl font-bold text-white mb-4">
33+
Page Not Found
34+
</h2>
3135
<p className="text-lg text-zinc-400">
32-
Looks like this page took a wrong turn. Don't worry, let's get you back on track.
36+
Looks like this page took a wrong turn. Don't worry, let's get you
37+
back on track.
3338
</p>
3439
</motion.div>
3540

@@ -40,7 +45,10 @@ export default function NotFound() {
4045
className="flex flex-col sm:flex-row items-center justify-center gap-4 mt-10"
4146
>
4247
<Link href="/">
43-
<Button size="lg" className="shimmer-btn bg-white text-zinc-950 hover:bg-zinc-200 rounded-full px-8 h-12 text-base font-medium shadow-lg shadow-white/10">
48+
<Button
49+
size="lg"
50+
className="shimmer-btn bg-white text-zinc-950 hover:bg-zinc-200 rounded-full px-8 h-12 text-base font-medium shadow-lg shadow-white/10"
51+
>
4452
Back to Home
4553
<ArrowRight className="ml-2 w-4 h-4" />
4654
</Button>
@@ -62,26 +70,34 @@ export default function NotFound() {
6270
transition={{ duration: 0.6, delay: 0.3 }}
6371
className="mt-16 pt-8 border-t border-zinc-800"
6472
>
65-
<p className="text-sm text-zinc-500 mb-6">Need help? Let's get you back on track</p>
73+
<p className="text-sm text-zinc-500 mb-6">
74+
Need help? Let's get you back on track
75+
</p>
6676
<div className="grid grid-cols-3 gap-4">
6777
<Link href="/" className="group">
6878
<div className="p-4 rounded-lg bg-zinc-900/50 hover:bg-zinc-800 border border-zinc-800 hover:border-zinc-700 transition-all">
69-
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">Home</div>
79+
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">
80+
Home
81+
</div>
7082
</div>
7183
</Link>
7284
<Link href="/#features" className="group">
7385
<div className="p-4 rounded-lg bg-zinc-900/50 hover:bg-zinc-800 border border-zinc-800 hover:border-zinc-700 transition-all">
74-
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">Features</div>
86+
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">
87+
Features
88+
</div>
7589
</div>
7690
</Link>
7791
<Link href="/#pricing" className="group">
7892
<div className="p-4 rounded-lg bg-zinc-900/50 hover:bg-zinc-800 border border-zinc-800 hover:border-zinc-700 transition-all">
79-
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">Pricing</div>
93+
<div className="text-sm font-semibold text-white group-hover:text-primary transition-colors">
94+
Pricing
95+
</div>
8096
</div>
8197
</Link>
8298
</div>
8399
</motion.div>
84100
</div>
85101
</div>
86-
)
102+
);
87103
}

src/app/page.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Hero } from "@/components/pages/(unauth)/home/hero"
2-
import { LogoMarquee } from "@/components/pages/(unauth)/home/logo-marquee"
3-
import { BentoGrid } from "@/components/pages/(unauth)/home/bento-grid"
4-
import { Pricing } from "@/components/pages/(unauth)/home/pricing"
5-
import { FinalCTA } from "@/components/pages/(unauth)/home/final-cta"
6-
import { Navbar } from "@/components/layout/navbar"
1+
import { Hero } from "@/components/pages/(unauth)/home/hero";
2+
import { LogoMarquee } from "@/components/pages/(unauth)/home/logo-marquee";
3+
import { BentoGrid } from "@/components/pages/(unauth)/home/bento-grid";
4+
import { Pricing } from "@/components/pages/(unauth)/home/pricing";
5+
import { FinalCTA } from "@/components/pages/(unauth)/home/final-cta";
6+
import { Navbar } from "@/components/layout/navbar";
77
import { Footer } from "@/components/layout/footer";
8-
import { SmoothScroll } from "@/components/pages/(unauth)/home/smooth-scroll"
8+
import { SmoothScroll } from "@/components/pages/(unauth)/home/smooth-scroll";
99

1010
export default function Home() {
1111
return (
@@ -20,5 +20,5 @@ export default function Home() {
2020
<Footer />
2121
</main>
2222
</SmoothScroll>
23-
)
24-
}
23+
);
24+
}

src/components/auth/ForgotPassword.tsx

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
1-
"use client"
1+
"use client";
22

3-
import { cn } from "@/lib/utils"
4-
import { Button } from "@/components/ui/button"
3+
import { cn } from "@/lib/utils";
4+
import { Button } from "@/components/ui/button";
55
import {
66
Field,
77
FieldDescription,
88
FieldGroup,
99
FieldLabel,
10-
} from "@/components/ui/field"
11-
import { Input } from "@/components/ui/input"
12-
import { useState } from "react"
13-
import { Loader2, ArrowLeft } from "lucide-react"
14-
import { authClient } from "@/lib/auth/client"
15-
import { toast } from "sonner"
16-
import Link from "next/link"
10+
} from "@/components/ui/field";
11+
import { Input } from "@/components/ui/input";
12+
import { useState } from "react";
13+
import { Loader2, ArrowLeft } from "lucide-react";
14+
import { authClient } from "@/lib/auth/client";
15+
import { toast } from "sonner";
16+
import Link from "next/link";
1717

1818
export function ForgotPassword({
1919
className,
2020
...props
2121
}: React.ComponentProps<"form">) {
22-
const [email, setEmail] = useState("")
23-
const [loading, setLoading] = useState(false)
24-
const [submitted, setSubmitted] = useState(false)
22+
const [email, setEmail] = useState("");
23+
const [loading, setLoading] = useState(false);
24+
const [submitted, setSubmitted] = useState(false);
2525

2626
const handleForgotPassword = async (e: React.FormEvent) => {
27-
e.preventDefault()
27+
e.preventDefault();
2828

2929
if (!email) {
30-
toast.error("Please enter your email address")
31-
return
30+
toast.error("Please enter your email address");
31+
return;
3232
}
3333

34-
setLoading(true)
34+
setLoading(true);
3535
try {
3636
await authClient.requestPasswordReset({
3737
email,
3838
redirectTo: `${window.location.origin}/reset-password`,
39-
})
40-
setSubmitted(true)
41-
toast.success("Check your email for the password reset link!")
39+
});
40+
setSubmitted(true);
41+
toast.success("Check your email for the password reset link!");
4242
} catch (error: any) {
43-
console.error("Forgot password error:", error)
44-
toast.error(error?.message || "Failed to send reset password link. Please try again.")
43+
console.error("Forgot password error:", error);
44+
toast.error(
45+
error?.message ||
46+
"Failed to send reset password link. Please try again.",
47+
);
4548
} finally {
46-
setLoading(false)
49+
setLoading(false);
4750
}
48-
}
51+
};
4952

5053
if (submitted) {
5154
return (
@@ -72,7 +75,8 @@ export function ForgotPassword({
7275
We've sent a password reset link to <strong>{email}</strong>
7376
</p>
7477
<p className="text-muted-foreground text-sm text-balance">
75-
Click the link in the email to reset your password. The link will expire in 24 hours.
78+
Click the link in the email to reset your password. The link will
79+
expire in 24 hours.
7680
</p>
7781
</div>
7882
<Field>
@@ -95,16 +99,21 @@ export function ForgotPassword({
9599
</Field>
96100
</FieldGroup>
97101
</div>
98-
)
102+
);
99103
}
100104

101105
return (
102-
<form className={cn("flex flex-col gap-6", className)} onSubmit={handleForgotPassword} {...props}>
106+
<form
107+
className={cn("flex flex-col gap-6", className)}
108+
onSubmit={handleForgotPassword}
109+
{...props}
110+
>
103111
<FieldGroup>
104112
<div className="flex flex-col items-center gap-1 text-center">
105113
<h1 className="text-2xl font-bold">Forgot your password?</h1>
106114
<p className="text-muted-foreground text-sm text-balance">
107-
Enter your email address and we'll send you a link to reset your password.
115+
Enter your email address and we'll send you a link to reset your
116+
password.
108117
</p>
109118
</div>
110119
<Field>
@@ -144,5 +153,5 @@ export function ForgotPassword({
144153
</Field>
145154
</FieldGroup>
146155
</form>
147-
)
156+
);
148157
}

0 commit comments

Comments
 (0)