Skip to content

Commit 9d8cfbb

Browse files
authored
Sanity upgrade (#591)
Updated Sanity and fixed a ton of linting issues.
1 parent a105914 commit 9d8cfbb

File tree

258 files changed

+48317
-35028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+48317
-35028
lines changed

Diff for: .vscode/launch.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"version": "0.2.0",
3-
"runtimeArgs": ["--preserve-symlinks"],
4-
"configurations": [
5-
{
6-
"name": "Next.js: debug server-side",
7-
"type": "node-terminal",
8-
"request": "launch",
9-
"command": "npm run dev"
10-
},
11-
{
12-
"name": "Next.js: debug client-side",
13-
"type": "chrome",
14-
"request": "launch",
15-
"url": "http://localhost:3000"
16-
},
17-
{
18-
"name": "Next.js: debug full stack",
19-
"type": "node-terminal",
20-
"request": "launch",
21-
"command": "npm run dev",
22-
"serverReadyAction": {
23-
"pattern": "- Local:.+(https?://.+)",
24-
"uriFormat": "%s",
25-
"action": "debugWithChrome"
26-
}
27-
}
28-
]
2+
"version": "0.2.0",
3+
"runtimeArgs": ["--preserve-symlinks"],
4+
"configurations": [
5+
{
6+
"name": "Next.js: debug server-side",
7+
"type": "node-terminal",
8+
"request": "launch",
9+
"command": "npm run dev"
10+
},
11+
{
12+
"name": "Next.js: debug client-side",
13+
"type": "chrome",
14+
"request": "launch",
15+
"url": "http://localhost:3000"
16+
},
17+
{
18+
"name": "Next.js: debug full stack",
19+
"type": "node-terminal",
20+
"request": "launch",
21+
"command": "npm run dev",
22+
"serverReadyAction": {
23+
"pattern": "- Local:.+(https?://.+)",
24+
"uriFormat": "%s",
25+
"action": "debugWithChrome"
26+
}
27+
}
28+
]
2929
}

Diff for: app/(main)/(auth)/login/github.tsx

+40-40
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ import { FaGithub } from "react-icons/fa";
1313
import { useRouter, useSearchParams } from "next/navigation";
1414

1515
export default function GitHubAuth() {
16-
const router = useRouter();
17-
const searchParams = useSearchParams();
18-
const redirect = searchParams.get("redirectTo");
19-
const { toast } = useToast();
16+
const router = useRouter();
17+
const searchParams = useSearchParams();
18+
const redirect = searchParams.get("redirectTo");
19+
const { toast } = useToast();
2020

21-
const login = async () => {
22-
try {
23-
await ccdSignInWithPopUp(provider);
24-
redirect
25-
? router.replace(
26-
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect
27-
)
28-
: router.replace("/dashboard");
29-
} catch (err: any) {
30-
if (err instanceof FirebaseError) {
31-
if (err.code === "auth/account-exists-with-different-credential") {
32-
toast({
33-
variant: "destructive",
34-
description:
35-
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
36-
});
37-
} else {
38-
toast({
39-
variant: "destructive",
40-
description: err.message,
41-
});
42-
}
43-
} else {
44-
toast({
45-
variant: "destructive",
46-
description: JSON.stringify(err),
47-
});
48-
console.error(err);
49-
}
50-
}
51-
};
21+
const login = async () => {
22+
try {
23+
await ccdSignInWithPopUp(provider);
24+
redirect
25+
? router.replace(
26+
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect,
27+
)
28+
: router.replace("/dashboard");
29+
} catch (err: any) {
30+
if (err instanceof FirebaseError) {
31+
if (err.code === "auth/account-exists-with-different-credential") {
32+
toast({
33+
variant: "destructive",
34+
description:
35+
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
36+
});
37+
} else {
38+
toast({
39+
variant: "destructive",
40+
description: err.message,
41+
});
42+
}
43+
} else {
44+
toast({
45+
variant: "destructive",
46+
description: JSON.stringify(err),
47+
});
48+
console.error(err);
49+
}
50+
}
51+
};
5252

53-
return (
54-
<Button onClick={login} variant="secondary">
55-
<FaGithub className="mr-2 h-4 w-4" /> Login with GitHub
56-
</Button>
57-
);
53+
return (
54+
<Button onClick={login} variant="secondary">
55+
<FaGithub className="mr-2 h-4 w-4" /> Login with GitHub
56+
</Button>
57+
);
5858
}

Diff for: app/(main)/(auth)/login/google.tsx

+40-40
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ import { FaGoogle } from "react-icons/fa";
1313
import { useRouter, useSearchParams } from "next/navigation";
1414

1515
export default function GoogleAuth() {
16-
const router = useRouter();
17-
const searchParams = useSearchParams();
18-
const redirect = searchParams.get("redirectTo");
19-
const { toast } = useToast();
16+
const router = useRouter();
17+
const searchParams = useSearchParams();
18+
const redirect = searchParams.get("redirectTo");
19+
const { toast } = useToast();
2020

21-
const login = async () => {
22-
try {
23-
await ccdSignInWithPopUp(provider);
24-
redirect
25-
? router.replace(
26-
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect
27-
)
28-
: router.replace("/dashboard");
29-
} catch (err: any) {
30-
if (err instanceof FirebaseError) {
31-
if (err.code === "auth/account-exists-with-different-credential") {
32-
toast({
33-
variant: "destructive",
34-
description:
35-
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
36-
});
37-
} else {
38-
toast({
39-
variant: "destructive",
40-
description: err.message,
41-
});
42-
}
43-
} else {
44-
toast({
45-
variant: "destructive",
46-
description: JSON.stringify(err),
47-
});
48-
console.error(err);
49-
}
50-
}
51-
};
21+
const login = async () => {
22+
try {
23+
await ccdSignInWithPopUp(provider);
24+
redirect
25+
? router.replace(
26+
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect,
27+
)
28+
: router.replace("/dashboard");
29+
} catch (err: any) {
30+
if (err instanceof FirebaseError) {
31+
if (err.code === "auth/account-exists-with-different-credential") {
32+
toast({
33+
variant: "destructive",
34+
description:
35+
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
36+
});
37+
} else {
38+
toast({
39+
variant: "destructive",
40+
description: err.message,
41+
});
42+
}
43+
} else {
44+
toast({
45+
variant: "destructive",
46+
description: JSON.stringify(err),
47+
});
48+
console.error(err);
49+
}
50+
}
51+
};
5252

53-
return (
54-
<Button onClick={login} variant="outline">
55-
<FaGoogle className="mr-2 h-4 w-4" /> Login with Google
56-
</Button>
57-
);
53+
return (
54+
<Button onClick={login} variant="outline">
55+
<FaGoogle className="mr-2 h-4 w-4" /> Login with Google
56+
</Button>
57+
);
5858
}

Diff for: app/(main)/(auth)/login/page.tsx

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
import {
2-
Card,
3-
CardContent,
4-
CardDescription,
5-
CardHeader,
6-
CardTitle,
2+
Card,
3+
CardContent,
4+
CardDescription,
5+
CardHeader,
6+
CardTitle,
77
} from "@/components/ui/card";
88
import GoogleAuth from "./google";
99
import GitHubAuth from "./github";
1010
import { Suspense } from "react";
1111

1212
export default function LoginForm() {
13-
return (
14-
<div className="container px-5 mx-auto">
15-
<div className="w-full flex justify-center p-8 sm:p-20 md:p-32">
16-
<Card className="w-full max-w-sm">
17-
<CardHeader>
18-
<CardTitle className="text-2xl">Login</CardTitle>
19-
<CardDescription>
20-
Enter your email below to login to your account.
21-
</CardDescription>
22-
</CardHeader>
23-
<CardContent className="grid gap-4">
24-
<Suspense>
25-
<GoogleAuth />
26-
<GitHubAuth />
27-
</Suspense>
28-
</CardContent>
29-
</Card>
30-
</div>
31-
</div>
32-
);
13+
return (
14+
<div className="container px-5 mx-auto">
15+
<div className="w-full flex justify-center p-8 sm:p-20 md:p-32">
16+
<Card className="w-full max-w-sm">
17+
<CardHeader>
18+
<CardTitle className="text-2xl">Login</CardTitle>
19+
<CardDescription>
20+
Enter your email below to login to your account.
21+
</CardDescription>
22+
</CardHeader>
23+
<CardContent className="grid gap-4">
24+
<Suspense>
25+
<GoogleAuth />
26+
<GitHubAuth />
27+
</Suspense>
28+
</CardContent>
29+
</Card>
30+
</div>
31+
</div>
32+
);
3333
}

0 commit comments

Comments
 (0)