From 1776173cabb4be88f248ada493ee6483bbe2e8de Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 13 Jun 2022 06:47:29 -0400 Subject: [PATCH] finally fix slow typescript compilation! see https://github.com/stitchesjs/stitches/issues/1038 --- components/Captcha/Captcha.tsx | 2 +- components/ContactForm/ContactForm.tsx | 9 +- components/Footer/Footer.tsx | 2 +- components/Image/Image.tsx | 7 +- components/Link/Link.tsx | 9 +- components/NoteMeta/NoteMeta.tsx | 2 +- components/NoteTitle/NoteTitle.tsx | 6 +- components/NotesList/NotesList.tsx | 9 +- components/RepositoryCard/RepositoryCard.tsx | 4 +- components/VNC/VNC.tsx | 4 +- contexts/ThemeContext.tsx | 10 +- lib/config/constants.ts | 2 +- lib/config/seo.ts | 2 +- lib/helpers/build-feed.ts | 2 +- lib/helpers/sentry.ts | 2 +- lib/styles/helpers/normalize.ts | 2 +- package.json | 6 +- pages/api/hits.ts | 2 +- pages/notes/[slug].tsx | 10 +- pages/projects.tsx | 8 +- tsconfig.json | 4 +- yarn.lock | 101 +++++++++---------- 22 files changed, 104 insertions(+), 101 deletions(-) diff --git a/components/Captcha/Captcha.tsx b/components/Captcha/Captcha.tsx index 46853324..a7d45cab 100644 --- a/components/Captcha/Captcha.tsx +++ b/components/Captcha/Captcha.tsx @@ -28,7 +28,7 @@ const Captcha = ({ size = "normal", theme, className, ...rest }: CaptchaProps) =
{hasMounted && ( { // status/feedback: const [submitted, setSubmitted] = useState(false); - const [success, setSuccess] = useState(null); + const [success, setSuccess] = useState(false); const [feedback, setFeedback] = useState(""); const handleSubmit = (values: Values, { setSubmitting }: FormikHelpers) => { @@ -197,7 +197,7 @@ const ContactForm = ({ className }: ContactFormProps) => { "h-captcha-response": "", }} validate={(values: Values) => { - const errors: { name?: boolean; email?: boolean; message?: boolean; "h-captcha-response"?: boolean } = {}; + const errors: Partial> = {}; errors.name = !values.name; errors.email = !values.email; // also loosely validated that it's email-like via browser (not foolproof) @@ -206,7 +206,7 @@ const ContactForm = ({ className }: ContactFormProps) => { if (!errors.name && !errors.email && !errors.message && !errors["h-captcha-response"]) { setFeedback(""); - return null; + return {}; } else { setSuccess(false); setFeedback("Please make sure that all fields are properly filled in."); @@ -218,6 +218,7 @@ const ContactForm = ({ className }: ContactFormProps) => { {({ setFieldValue, isSubmitting }) => (
+ {/* @ts-ignore */} {({ field, meta }) => ( { + {/* @ts-ignore */} {({ field, meta }) => ( { + {/* @ts-ignore */} {({ field, meta }) => (