Skip to content

Sanity upgrade #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
676eb28
installs
codercatdev Feb 9, 2025
0bdbb1b
types
codercatdev Feb 9, 2025
8553b0b
adjust types
codercatdev Feb 9, 2025
c6dcffe
adjust type location
codercatdev Feb 9, 2025
3fee765
working without live preview
codercatdev Feb 9, 2025
16e219f
fix stega
codercatdev Feb 9, 2025
53bba1c
make draft mode standout
codercatdev Feb 9, 2025
ba37d24
biome fixes
codercatdev Feb 9, 2025
bef9f62
fix fetch typings
codercatdev Feb 9, 2025
8d7b69c
not sure if we should keep as it should build again
codercatdev Feb 9, 2025
1b06123
packages working without bad plugins
codercatdev Feb 9, 2025
ab12ee2
cloudinary issue but no stega
codercatdev Feb 9, 2025
7857e8d
await params
codercatdev Feb 9, 2025
9e14f9a
no google ads
codercatdev Feb 9, 2025
71d179f
adjust all the things and format
codercatdev Feb 9, 2025
95146eb
fix types
codercatdev Feb 9, 2025
d7131fc
promises promises
codercatdev Feb 9, 2025
06d775f
sanity types
codercatdev Feb 9, 2025
f3bf981
t
codercatdev Feb 9, 2025
43aa72b
params
codercatdev Feb 9, 2025
d0064f7
fix slug
codercatdev Feb 9, 2025
34735d8
Update page.tsx
codercatdev Feb 9, 2025
4a422b3
Update page.tsx
codercatdev Feb 9, 2025
822e1e7
Update page.tsx
codercatdev Feb 9, 2025
ff720f6
Update page.tsx
codercatdev Feb 10, 2025
39c933a
Update page.tsx
codercatdev Feb 10, 2025
0571839
Update page.tsx
codercatdev Feb 10, 2025
7c6c63d
Update page.tsx
codercatdev Feb 10, 2025
4b35455
Update page.tsx
codercatdev Feb 10, 2025
6e78581
Update page.tsx
codercatdev Feb 10, 2025
5e3895c
Update page.tsx
codercatdev Feb 10, 2025
fe2098e
Update page.tsx
codercatdev Feb 10, 2025
3125f4e
Update page.tsx
codercatdev Feb 10, 2025
68f7db9
Update page.tsx
codercatdev Feb 10, 2025
7cd4890
Update page.tsx
codercatdev Feb 10, 2025
1b3f49f
Update route.tsx
codercatdev Feb 10, 2025
b6c21d7
Update route.tsx
codercatdev Feb 10, 2025
99b0f15
Update calendar.tsx
codercatdev Feb 10, 2025
2829ae3
Delete lib/actions.ts
codercatdev Feb 10, 2025
45d8668
biome linting
codercatdev Feb 10, 2025
08e3fdd
add socials
codercatdev Feb 10, 2025
271f84b
put back stupid firebase middleware
codercatdev Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"version": "0.2.0",
"runtimeArgs": ["--preserve-symlinks"],
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
"version": "0.2.0",
"runtimeArgs": ["--preserve-symlinks"],
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}
80 changes: 40 additions & 40 deletions app/(main)/(auth)/login/github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@ import { FaGithub } from "react-icons/fa";
import { useRouter, useSearchParams } from "next/navigation";

export default function GitHubAuth() {
const router = useRouter();
const searchParams = useSearchParams();
const redirect = searchParams.get("redirectTo");
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const redirect = searchParams.get("redirectTo");
const { toast } = useToast();

const login = async () => {
try {
await ccdSignInWithPopUp(provider);
redirect
? router.replace(
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect
)
: router.replace("/dashboard");
} catch (err: any) {
if (err instanceof FirebaseError) {
if (err.code === "auth/account-exists-with-different-credential") {
toast({
variant: "destructive",
description:
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
});
} else {
toast({
variant: "destructive",
description: err.message,
});
}
} else {
toast({
variant: "destructive",
description: JSON.stringify(err),
});
console.error(err);
}
}
};
const login = async () => {
try {
await ccdSignInWithPopUp(provider);
redirect
? router.replace(
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect,
)
: router.replace("/dashboard");
} catch (err: any) {
if (err instanceof FirebaseError) {
if (err.code === "auth/account-exists-with-different-credential") {
toast({
variant: "destructive",
description:
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
});
} else {
toast({
variant: "destructive",
description: err.message,
});
}
} else {
toast({
variant: "destructive",
description: JSON.stringify(err),
});
console.error(err);
}
}
};

return (
<Button onClick={login} variant="secondary">
<FaGithub className="mr-2 h-4 w-4" /> Login with GitHub
</Button>
);
return (
<Button onClick={login} variant="secondary">
<FaGithub className="mr-2 h-4 w-4" /> Login with GitHub
</Button>
);
}
80 changes: 40 additions & 40 deletions app/(main)/(auth)/login/google.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@ import { FaGoogle } from "react-icons/fa";
import { useRouter, useSearchParams } from "next/navigation";

export default function GoogleAuth() {
const router = useRouter();
const searchParams = useSearchParams();
const redirect = searchParams.get("redirectTo");
const { toast } = useToast();
const router = useRouter();
const searchParams = useSearchParams();
const redirect = searchParams.get("redirectTo");
const { toast } = useToast();

const login = async () => {
try {
await ccdSignInWithPopUp(provider);
redirect
? router.replace(
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect
)
: router.replace("/dashboard");
} catch (err: any) {
if (err instanceof FirebaseError) {
if (err.code === "auth/account-exists-with-different-credential") {
toast({
variant: "destructive",
description:
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
});
} else {
toast({
variant: "destructive",
description: err.message,
});
}
} else {
toast({
variant: "destructive",
description: JSON.stringify(err),
});
console.error(err);
}
}
};
const login = async () => {
try {
await ccdSignInWithPopUp(provider);
redirect
? router.replace(
redirect === "/pro" ? `${redirect}?showSubscribe=true` : redirect,
)
: router.replace("/dashboard");
} catch (err: any) {
if (err instanceof FirebaseError) {
if (err.code === "auth/account-exists-with-different-credential") {
toast({
variant: "destructive",
description:
"Account Exists with Different Login Method. Please first login and then link within your Account page.",
});
} else {
toast({
variant: "destructive",
description: err.message,
});
}
} else {
toast({
variant: "destructive",
description: JSON.stringify(err),
});
console.error(err);
}
}
};

return (
<Button onClick={login} variant="outline">
<FaGoogle className="mr-2 h-4 w-4" /> Login with Google
</Button>
);
return (
<Button onClick={login} variant="outline">
<FaGoogle className="mr-2 h-4 w-4" /> Login with Google
</Button>
);
}
50 changes: 25 additions & 25 deletions app/(main)/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import GoogleAuth from "./google";
import GitHubAuth from "./github";
import { Suspense } from "react";

export default function LoginForm() {
return (
<div className="container px-5 mx-auto">
<div className="w-full flex justify-center p-8 sm:p-20 md:p-32">
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle className="text-2xl">Login</CardTitle>
<CardDescription>
Enter your email below to login to your account.
</CardDescription>
</CardHeader>
<CardContent className="grid gap-4">
<Suspense>
<GoogleAuth />
<GitHubAuth />
</Suspense>
</CardContent>
</Card>
</div>
</div>
);
return (
<div className="container px-5 mx-auto">
<div className="w-full flex justify-center p-8 sm:p-20 md:p-32">
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle className="text-2xl">Login</CardTitle>
<CardDescription>
Enter your email below to login to your account.
</CardDescription>
</CardHeader>
<CardContent className="grid gap-4">
<Suspense>
<GoogleAuth />
<GitHubAuth />
</Suspense>
</CardContent>
</Card>
</div>
</div>
);
}
Loading