diff --git a/app/newsletter/page.tsx b/app/newsletter/page.tsx new file mode 100644 index 0000000..0044da4 --- /dev/null +++ b/app/newsletter/page.tsx @@ -0,0 +1,5 @@ +import { NewsletterContent } from "@/components/newsletter-content"; + +export default function NewsletterPage() { + return ; +} diff --git a/components/newsletter-content.tsx b/components/newsletter-content.tsx new file mode 100644 index 0000000..4199e1c --- /dev/null +++ b/components/newsletter-content.tsx @@ -0,0 +1,90 @@ +"use client"; + +import { useState } from "react"; +import { Button, Card, Input, Label, Typography } from "poyraz-ui/atoms"; + +export function NewsletterContent() { + const [name, setName] = useState(""); + const [email, setEmail] = useState(""); + + const isValid = name.trim() && email.trim(); + + const handleSubmit = (event: React.FormEvent) => { + event.preventDefault(); + if (!isValid) return; + + const subject = encodeURIComponent(`Newsletter Subscription - ${name.trim()}`); + const body = encodeURIComponent( + `Hello,\n\nI want to subscribe to the weekly "Poyraz ile Yazilim" newsletter.\n\nName: ${name.trim()}\nEmail: ${email.trim()}`, + ); + + window.location.href = `mailto:poyrazavsever@gmail.com?subject=${subject}&body=${body}`; + }; + + return ( + + + + Weekly Software Newsletter + + + Mail version of Poyraz ile Yazilim. + + + + + + Schedule + + Every Sunday + + + + What you get + + Weekly software agenda and practical notes. + + + + Delivery + + Directly to your inbox. + + + + + + + + Name + setName(event.target.value)} + placeholder="Your name" + className="rounded-sm" + /> + + + + Email + setEmail(event.target.value)} + placeholder="you@example.com" + className="rounded-sm" + /> + + + + + Subscribe + + + + + + ); +}