Skip to content

Commit d43f138

Browse files
committed
remove old stuff, added trunstile to contact us form
1 parent d574dbe commit d43f138

File tree

8 files changed

+24
-71
lines changed

8 files changed

+24
-71
lines changed

packages/website-helper-worker/src/contact-conductor.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

packages/website-helper-worker/src/env.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export interface Env {
33
CRISP_WEBSITE_ID: string;
44
NOTION_TOKEN: string;
55
NOTION_HELTIN_DATABASE_ID: string;
6-
NOTION_CONDUCTOR_DATABASE_ID: string;
76
NOTION_CONTACT_US_DATABASE_ID: string;
87
SENTRY_DSN: string;
98
BEEHIIV_API_KEY: string;

packages/website-helper-worker/src/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Toucan } from 'toucan-js';
22
import { Client } from '@notionhq/client';
3-
import { handleConductorContact } from './contact-conductor';
43
import { handleContactUs } from './contact-guild';
54
import { handleHeltinContact } from './contact-heltin';
65
import { buildResponseCorsHeaders } from './cors';
@@ -57,15 +56,6 @@ export default {
5756
});
5857
}
5958

60-
if (request.method === 'POST' && url.pathname === '/api/conductor') {
61-
return await handleConductorContact({
62-
request,
63-
body: maybeBody ? JSON.parse(maybeBody) : null,
64-
notion,
65-
notionDatabaseId: env.NOTION_CONDUCTOR_DATABASE_ID,
66-
});
67-
}
68-
6959
if (request.method === 'POST' && url.pathname === '/api/contact-us') {
7060
return await handleContactUs({
7161
email: env.EMAIL_SENDER,

packages/website-router/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const jsonConfig = {
7979
},
8080
'/graphql/shield': {
8181
redirect: 'https://github.com/maticzav/graphql-shield',
82-
status: 302
82+
status: 302,
8383
},
8484
'/graphql/apollo-angular': {
8585
rewrite: 'apollo-angular.pages.dev',

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"analyze": "ANALYZE=true pnpm build",
99
"build": "pnpm load-hive-feed && pnpm check-links && next build && next-sitemap",
1010
"check-links": "tsx check-links.ts",
11-
"dev": "next",
11+
"dev": "pnpm load-hive-feed && next",
1212
"export": "tsx rss-generator.ts",
1313
"load-hive-feed": "tsx load-hive-feed.ts",
1414
"start": "next start"

website/pages/_document.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export default class MyDocument extends Document {
2020
title="RSS Feed for the-guild.dev"
2121
href="/feed.xml"
2222
/>
23+
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
24+
<link rel="preconnect" href="https://challenges.cloudflare.com" />
2325
</Head>
2426
<body>
2527
<Main />

website/ui/client-only.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import dynamic from 'next/dynamic';
2+
3+
type ClientOnlyProps = { children: JSX.Element };
4+
const ClientOnly = (props: ClientOnlyProps) => {
5+
const { children } = props;
6+
7+
return children;
8+
};
9+
10+
export default dynamic(() => Promise.resolve(ClientOnly), {
11+
ssr: false,
12+
});

website/ui/get-in-touch-section.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import clsx from 'clsx';
33
import { useFormik } from 'formik';
44
import Confetti from 'react-confetti';
55
import * as Yup from 'yup';
6+
import ClientOnly from './client-only';
67
import { GuildButton, Heading, Input } from './components';
78

89
export const GetInTouchForm = (): ReactElement => {
@@ -108,6 +109,13 @@ export const GetInTouchForm = (): ReactElement => {
108109
{touched.notes && errors.notes && (
109110
<p className="-mt-9 text-sm text-[#f6547b]">{errors.notes}</p>
110111
)}
112+
<ClientOnly>
113+
<div
114+
className="cf-turnstile"
115+
data-sitekey="0x4AAAAAAB-9vuIUJrCPlFK3"
116+
data-theme="dark"
117+
/>
118+
</ClientOnly>
111119
<GuildButton
112120
as="button"
113121
type="submit"

0 commit comments

Comments
 (0)