diff --git a/docs/app/actions.ts b/docs/app/actions.ts index 5ce5a3a653e..9f015bd44e7 100644 --- a/docs/app/actions.ts +++ b/docs/app/actions.ts @@ -9,7 +9,7 @@ export async function subscribeToButtondown (pathname: string, formData: FormDat email: formData.get('email'), tags: [ ...formData.getAll('tags'), - `keystone website${pathname !== '/' ? `: ${pathname}` : ' homepage'}`, + `source:keystonejs.com${pathname}`, ], } diff --git a/packages/auth/src/pages/InitPage.tsx b/packages/auth/src/pages/InitPage.tsx index cc92c2ee987..171ca7378ec 100644 --- a/packages/auth/src/pages/InitPage.tsx +++ b/packages/auth/src/pages/InitPage.tsx @@ -4,9 +4,9 @@ import { useMemo, useState } from 'react' import fetch from 'cross-fetch' -import { jsx, H1, Stack, Inline, VisuallyHidden } from '@keystone-ui/core' +import { jsx, H1, Stack, Inline } from '@keystone-ui/core' import { Button } from '@keystone-ui/button' -import { Checkbox, TextInput } from '@keystone-ui/fields' +import { Checkbox, FieldLabel, TextInput } from '@keystone-ui/fields' import { type FieldMeta } from '@keystone-6/core/types' import isDeepEqual from 'fast-deep-equal' @@ -24,10 +24,15 @@ import { IconTwitter, IconGithub } from '../components/Icons' import { SigninContainer } from '../components/SigninContainer' import { useRedirect } from '../lib/useFromRedirect' -const signupURL = 'https://signup.keystonejs.cloud/api/newsletter-signup' +const signupURL = 'https://endpoints.thinkmill.com.au/newsletter' function Welcome ({ value, onContinue }: { value: any, onContinue: () => void }) { - const [subscribe, setSubscribe] = useState(false) + const [subscribe, setSubscribe] = useState<{ keystone: boolean, thinkmill: boolean}>( + { + keystone: false, + thinkmill: false, + } + ) const [email, setEmail] = useState(guessEmailFromValue(value)) const [error, setError] = useState(null) const [loading, setLoading] = useState(false) @@ -37,7 +42,7 @@ function Welcome ({ value, onContinue }: { value: any, onContinue: () => void }) setError(null) // Check if user wants to subscribe and a valid email address - if (subscribe) { + if (subscribe.keystone || subscribe.thinkmill) { setLoading(true) if (!validEmail(email)) { @@ -45,15 +50,18 @@ function Welcome ({ value, onContinue }: { value: any, onContinue: () => void }) return } + const tags = ['source:@keystone-6/auth'] + if (subscribe.keystone) tags.push('keystone_list') + if (subscribe.thinkmill) tags.push('thinkmill_list') + const res = await fetch(signupURL, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ - name: value.username, email, - source: '@keystone-6/auth InitPage', + tags, }), }) @@ -76,7 +84,7 @@ function Welcome ({ value, onContinue }: { value: any, onContinue: () => void }) } return ( - + void }) >

Welcome

- void })

- Thanks for installing KeystoneJS. While you're getting started, check out the docs at{' '} + Thanks for installing Keystone, for help getting started see our documentation at{' '} keystonejs.com

-
- If you'd like to stay up to date with the exciting things we have planned, join our mailing - list (just useful announcements, no spam!) -
-
- { - setError(null) - setSubscribe(!subscribe) - }} - > - sign up to our mailing list - -
+ +

+ To stay connected to the latest Keystone and Thinkmill news, signup to our newsletters: +

+
- - Email Address - - setEmail(e.target.value)} - /> + + Email + setEmail(e.target.value)} + /> + + { + setError(null) + setSubscribe((prevState) => ({ ...prevState, keystone: !subscribe.keystone })) + }} + > + Keystone news + + { + setError(null) + setSubscribe((prevState) => ({ ...prevState, thinkmill: !subscribe.thinkmill })) + }} + > + Thinkmill news ( + + example + + ) + + +

{error}