Skip to content

Commit ac3cf29

Browse files
committed
rename kit
1 parent 5f7fac1 commit ac3cf29

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

app/components/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function NewsletterSection() {
3131
</div>
3232

3333
<div className="mt-8">
34-
<KitForm formId="newsletter" KitFormId="827139" />
34+
<KitForm formId="newsletter" kitFormId="827139" />
3535
</div>
3636
</div>
3737
)

app/kit/form.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { type ActionData } from './types.ts'
99
function KitForm({
1010
formId,
1111
kitTagId,
12-
KitFormId,
12+
kitFormId,
1313
}: { formId: string } & (
14-
| { kitTagId?: never; KitFormId: string }
15-
| { kitTagId: string; KitFormId?: never }
16-
| { kitTagId: string; KitFormId: string }
14+
| { kitTagId?: never; kitFormId: string }
15+
| { kitTagId: string; kitFormId?: never }
16+
| { kitTagId: string; kitFormId: string }
1717
)) {
1818
const websiteId = React.useId()
1919
const kit = useFetcher<ActionData>()
@@ -54,7 +54,7 @@ function KitForm({
5454
</div>
5555
<input type="hidden" name="formId" value={formId} />
5656
<input type="hidden" name="kitTagId" value={kitTagId} />
57-
<input type="hidden" name="KitFormId" value={KitFormId} />
57+
<input type="hidden" name="kitFormId" value={kitFormId} />
5858
<Field
5959
name="firstName"
6060
label="First name"

app/kit/kit.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function ensureSubscriber({
5757
subscriber = await addSubscriberToForm({
5858
email,
5959
firstName,
60-
KitFormId: '2500372',
60+
kitFormId: '2500372',
6161
})
6262
}
6363

@@ -67,11 +67,11 @@ async function ensureSubscriber({
6767
async function addSubscriberToForm({
6868
email,
6969
firstName,
70-
KitFormId,
70+
kitFormId,
7171
}: {
7272
email: string
7373
firstName: string
74-
KitFormId: string
74+
kitFormId: string
7575
}) {
7676
const subscriberData = {
7777
api_key: KIT_API_KEY,
@@ -83,7 +83,7 @@ async function addSubscriberToForm({
8383
// this is a basic form that doesn't really do anything. It's just a way to
8484
// get the users on the mailing list
8585
const response = await fetch(
86-
`https://api.kit.com/v3/forms/${KitFormId}/subscribe`,
86+
`https://api.kit.com/v3/forms/${kitFormId}/subscribe`,
8787
{
8888
method: 'POST',
8989
body: JSON.stringify(subscriberData),

app/kit/remix.server.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ function getErrorForEmail(email: string | null) {
1717
}
1818

1919
function getErrorForkitTagId(tagId: string | null, form: URLSearchParams) {
20-
if (!form.get('KitFormId') && !tagId) {
21-
return `kitTagId is required if KitFormId is not specified`
20+
if (!form.get('kitFormId') && !tagId) {
21+
return `kitTagId is required if kitFormId is not specified`
2222
}
2323
if (!tagId) return null
2424
if (tagId.length < 2) return `Convert Kit Tag ID is incorrect`
2525
return null
2626
}
2727

28-
function getErrorForKitFormId(formId: string | null, form: URLSearchParams) {
28+
function getErrorForkitFormId(formId: string | null, form: URLSearchParams) {
2929
if (!form.get('kitTagId') && !formId) {
30-
return `KitFormId is required if kitTagId is not specified`
30+
return `kitFormId is required if kitTagId is not specified`
3131
}
3232
if (!formId) return null
3333
if (formId.length < 2) return `Convert Kit Form ID is incorrect`
@@ -48,7 +48,7 @@ async function handleKitFormSubmission(request: Request) {
4848
firstName: form.get('firstName') ?? '',
4949
email: form.get('email') ?? '',
5050
kitTagId: form.get('kitTagId') ?? '',
51-
KitFormId: form.get('KitFormId') ?? '',
51+
kitFormId: form.get('kitFormId') ?? '',
5252
url: form.get('url'),
5353
}
5454

@@ -58,7 +58,7 @@ async function handleKitFormSubmission(request: Request) {
5858
firstName: getErrorForFirstName(fields.firstName),
5959
email: getErrorForEmail(fields.email),
6060
kitTagId: getErrorForkitTagId(fields.kitTagId, form),
61-
KitFormId: getErrorForKitFormId(fields.KitFormId, form),
61+
kitFormId: getErrorForkitFormId(fields.kitFormId, form),
6262
url: null,
6363
}
6464

@@ -77,7 +77,7 @@ async function handleKitFormSubmission(request: Request) {
7777

7878
try {
7979
let subscriberId: number | null = null
80-
if (fields.KitFormId) {
80+
if (fields.kitFormId) {
8181
const subscriber = await ck.addSubscriberToForm(fields)
8282
subscriberId = subscriber.id
8383
}

app/kit/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export type Fields = {
44
email: string
55
url: string | null
66
kitTagId: string
7-
KitFormId: string
7+
kitFormId: string
88
}
99
export type Errors = Record<keyof Fields | 'generalError', string | null>
1010

app/routes/subscribe.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default function SubscribeScreen() {
172172
id="subscribe-form"
173173
className="col-span-full mt-8 lg:col-span-7"
174174
>
175-
<KitForm formId="newsletter" KitFormId="827139" />
175+
<KitForm formId="newsletter" kitFormId="827139" />
176176
</div>
177177
</>
178178
)}

content/blog/i-m-building-epicweb-dev.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ If you'd like to keep up-to-date, please sign up here:
123123
<SubscribeForm
124124
formId="epicweb-blog-post"
125125
kitTagId="3292661"
126-
KitFormId="3547851"
126+
kitFormId="3547851"
127127
/>
128128

129129
I'm really excited to turn you into an [EpicWeb.dev 🌌](https://epicweb.dev)

0 commit comments

Comments
 (0)