Skip to content

Commit 56c40e7

Browse files
committed
fix emails
1 parent eaba62d commit 56c40e7

File tree

5 files changed

+37
-46
lines changed

5 files changed

+37
-46
lines changed

app/(main)/(top-level-pages)/sponsorships/page.tsx

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ import {
1717
FormMessage,
1818
} from "@/components/ui/form";
1919
import { Input } from "@/components/ui/input";
20-
import {
21-
Select,
22-
SelectContent,
23-
SelectItem,
24-
SelectTrigger,
25-
SelectValue,
26-
} from "@/components/ui/select";
2720
import { Checkbox } from "@/components/ui/checkbox";
2821
import { Textarea } from "@/components/ui/textarea";
2922
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
@@ -67,21 +60,7 @@ const sponsorshipTiers = [
6760
},
6861
];
6962

70-
const formSchema = z.object({
71-
fullName: z.string().min(2, {
72-
message: "Full name must be at least 2 characters.",
73-
}),
74-
email: z.string().email({
75-
message: "Please enter a valid email address.",
76-
}),
77-
companyName: z.string().optional(),
78-
sponsorshipTier: z.array(z.string()).refine((value) => value.some((item) => item), {
79-
message: "You have to select at least one item.",
80-
}),
81-
message: z.string().optional(),
82-
honeypot: z.string().optional(), // Honeypot field
83-
"cf-turnstile-response": z.string().min(1, { message: "Please complete the CAPTCHA." }),
84-
});
63+
import { formSchema } from "@/lib/sponsorship-schema";
8564

8665
export default function SponsorshipsPage() {
8766
const [isSuccess, setIsSuccess] = useState(false);
@@ -254,10 +233,10 @@ export default function SponsorshipsPage() {
254233
return checked
255234
? field.onChange([...field.value, item.value])
256235
: field.onChange(
257-
field.value?.filter(
258-
(value) => value !== item.value,
259-
),
260-
);
236+
field.value?.filter(
237+
(value: string) => value !== item.value,
238+
),
239+
);
261240
}}
262241
/>
263242
</FormControl>

app/api/sponsorship/route.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { apiVersion, dataset, projectId } from "@/sanity/lib/api";
55
import { createClient } from "next-sanity";
66
import { Resend } from 'resend';
77
import { EmailTemplate } from "./sponsorship-template";
8+
import { formSchema } from "@/lib/sponsorship-schema";
89

910
const sanityWriteClient = createClient({
1011
projectId,
@@ -22,17 +23,6 @@ const rateLimitStore: Record<string, { count: number; timestamp: number }> = {};
2223
const RATE_LIMIT_COUNT = 2; // 2 requests
2324
const RATE_LIMIT_WINDOW = 60 * 1000; // 1 minute
2425

25-
26-
export const formSchema = z.object({
27-
fullName: z.string(),
28-
email: z.string().email(),
29-
companyName: z.string().optional(),
30-
sponsorshipTier: z.array(z.string()),
31-
message: z.string().optional(),
32-
honeypot: z.string().optional(),
33-
"cf-turnstile-response": z.string(),
34-
});
35-
3626
export async function POST(request: Request) {
3727
const body = await request.json();
3828

components/podmatch-badge.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use client';
22

3+
import Image from "next/image";
4+
35
export default function PodmatchBadge() {
46
return (
57
<div style={{ minWidth: 160, maxWidth: 400 }}>
@@ -26,13 +28,15 @@ export default function PodmatchBadge() {
2628
background: "none",
2729
}}
2830
>
29-
<img
31+
<Image
3032
onError={(e) => {
3133
const target = e.target as HTMLImageElement;
3234
target.src = "https://podmatch.com/assets/img/waveform_img.png";
3335
}}
3436
alt="Cover Art"
35-
style={{ height: 85 }}
37+
width={85}
38+
height={85}
39+
style={{ height: 85, width: 85 }}
3640
src="https://img.rephonic.com/artwork/purrfectdev.jpg?width=600&height=600&quality=95"
3741
/>
3842
</div>
@@ -45,9 +49,11 @@ export default function PodmatchBadge() {
4549
}}
4650
>
4751
<span style={{ display: "block", marginBottom: 3 }}>
48-
<img
52+
<Image
4953
src="https://podmatch.com/assets/img/PodMatch_Logo.png"
5054
alt="PodMatch Logo"
55+
width={80}
56+
height={18}
5157
style={{ width: 80 }}
5258
/>
5359
</span>

components/youtube.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Image from "next/image";
12
import { youtubeParser } from "@/lib/utils";
23
import type { CloudinaryAsset } from "@/sanity/types";
34
import CoverImage from "@/components/cover-image";
@@ -25,15 +26,12 @@ export function YouTube(props: {
2526
`https://i.ytimg.com/vi_webp/${id}/sddefault.webp 640w`,
2627
].join(", ")}
2728
/>
28-
<img
29+
<Image
2930
style={{ width: "100%", height: "100%", objectFit: "cover" }}
3031
src={`https://i.ytimg.com/vi/${id}/sddefault.jpg`}
31-
srcSet={[
32-
`https://i.ytimg.com/vi/${id}/mqdefault.jpg 320w`,
33-
`https://i.ytimg.com/vi/${id}/hqdefault.jpg 480w`,
34-
`https://i.ytimg.com/vi/${id}/sddefault.jpg 640w`,
35-
].join(", ")}
3632
alt=""
33+
width={640}
34+
height={480}
3735
/>
3836
</picture>
3937
)}

lib/sponsorship-schema.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import { z } from "zod";
3+
4+
export const formSchema = z.object({
5+
fullName: z.string().min(2, {
6+
message: "Full name must be at least 2 characters.",
7+
}),
8+
email: z.string().email({
9+
message: "Please enter a valid email address.",
10+
}),
11+
companyName: z.string().optional(),
12+
sponsorshipTier: z.array(z.string()).refine((value) => value.some((item) => item), {
13+
message: "You have to select at least one item.",
14+
}),
15+
message: z.string().optional(),
16+
honeypot: z.string().optional(), // Honeypot field
17+
"cf-turnstile-response": z.string().min(1, { message: "Please complete the CAPTCHA." }),
18+
});

0 commit comments

Comments
 (0)