remove email submissions now that we have sign in
This commit is contained in:
parent
d3ec75873c
commit
08cd5384be
@ -7,9 +7,6 @@ import {
|
|||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from "./ui/alert-dialog";
|
} from "./ui/alert-dialog";
|
||||||
import { Input } from "./ui/input";
|
|
||||||
import toast from "react-hot-toast";
|
|
||||||
import { PICO_BACKEND_FORM_SECRET } from "../config";
|
|
||||||
import { addEvent } from "../lib/analytics";
|
import { addEvent } from "../lib/analytics";
|
||||||
|
|
||||||
const LOGOS = ["microsoft", "amazon", "mit", "stanford", "bytedance", "baidu"];
|
const LOGOS = ["microsoft", "amazon", "mit", "stanford", "bytedance", "baidu"];
|
||||||
@ -18,40 +15,19 @@ const TermsOfServiceDialog: React.FC<{
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
}> = ({ open, onOpenChange }) => {
|
}> = ({ open, onOpenChange }) => {
|
||||||
const [email, setEmail] = React.useState("");
|
|
||||||
|
|
||||||
const onSubscribe = async () => {
|
|
||||||
await fetch("https://backend.buildpicoapps.com/form", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({ email, secret: PICO_BACKEND_FORM_SECRET }),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle className="mb-2 text-xl">
|
<AlertDialogTitle className="mb-2 text-xl">
|
||||||
Enter your email to get started
|
One last step
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
|
|
||||||
<div className="mb-2">
|
|
||||||
<Input
|
|
||||||
placeholder="Email"
|
|
||||||
value={email}
|
|
||||||
onChange={(e) => {
|
|
||||||
setEmail(e.target.value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col space-y-3 text-sm">
|
<div className="flex flex-col space-y-3 text-sm">
|
||||||
<p>
|
<p>
|
||||||
By providing your email, you consent to receiving occasional product
|
You consent to receiving occasional product updates via email, and
|
||||||
updates, and you accept the{" "}
|
you accept the{" "}
|
||||||
<a
|
<a
|
||||||
href="https://a.picoapps.xyz/camera-write"
|
href="https://a.picoapps.xyz/camera-write"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -77,14 +53,8 @@ const TermsOfServiceDialog: React.FC<{
|
|||||||
|
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={(e) => {
|
onClick={() => {
|
||||||
if (!email.trim() || !email.trim().includes("@")) {
|
addEvent("EmailSubmit");
|
||||||
e.preventDefault();
|
|
||||||
toast.error("Please enter your email");
|
|
||||||
} else {
|
|
||||||
addEvent("EmailSubmit");
|
|
||||||
onSubscribe();
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Agree & Continue
|
Agree & Continue
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user