Merge pull request #932 from notmd/911_sigin_captcha

911 signin captcha
This commit is contained in:
Keith Stevens
2023-02-01 15:56:14 +09:00
committed by GitHub
12 changed files with 227 additions and 55 deletions
@@ -0,0 +1,20 @@
import { useColorMode } from "@chakra-ui/react";
import { Turnstile, TurnstileInstance, TurnstileProps } from "@marsidev/react-turnstile";
import { forwardRef } from "react";
export const CloudFlareCaptcha = forwardRef<TurnstileInstance, Omit<TurnstileProps, "siteKey">>((props, ref) => {
const { colorMode } = useColorMode();
return (
<Turnstile
ref={ref}
{...props}
siteKey={process.env.NEXT_PUBLIC_CLOUDFLARE_CAPTCHA_SITE_KEY}
options={{
theme: colorMode,
...props.options,
}}
/>
);
});
CloudFlareCaptcha.displayName = "CloudFlareCaptcha";