diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx new file mode 100644 index 0000000..15da5c4 --- /dev/null +++ b/src/pages/Index.tsx @@ -0,0 +1,162 @@ +import { useState } from "react"; +import { Link } from "react-router-dom"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Clock, ArrowRight, Mail, Quote } from "lucide-react"; +import { toast } from "sonner"; +import { useSaasMutation } from "@/hooks/use-tygarun"; + +const featured = { + category: "Culture", + title: "The Quiet Revolution Reshaping How We Live", + excerpt: "A generation of designers, architects, and thinkers is redefining what it means to live well in the modern city.", + author: "Elena Vasquez", + date: "April 8, 2026", +}; + +const editorPicks = [ + { category: "Style", title: "The Return of Slow Fashion", author: "Mara Chen", readTime: "6 min", img: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=600&h=400&fit=crop" }, + { category: "Technology", title: "AI and the Future of Creativity", author: "Soren Blake", readTime: "8 min", img: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=600&h=400&fit=crop" }, + { category: "Travel", title: "Hidden Coastlines of the Adriatic", author: "Lila Osman", readTime: "5 min", img: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&h=400&fit=crop" }, +]; + +const latestStories = [ + { category: "Food", title: "Why Fermentation Is the New Fine Dining", excerpt: "Chefs worldwide are turning to ancient techniques for modern flavor.", author: "Nadia Park", date: "April 6, 2026", img: "https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=600&h=400&fit=crop" }, + { category: "Opinion", title: "The Case for Digital Minimalism", excerpt: "Why less screen time might be the key to deeper thinking.", author: "James Whitfield", date: "April 5, 2026", img: "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=600&h=400&fit=crop" }, + { category: "Culture", title: "Inside the New Museum of Sound", excerpt: "An immersive space dedicated to the art of listening.", author: "Amara Diallo", date: "April 4, 2026", img: "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=600&h=400&fit=crop" }, + { category: "Travel", title: "A Week on the Silk Road by Train", excerpt: "Crossing borders and centuries on one of the worlds great rail journeys.", author: "Henrik Solis", date: "April 3, 2026", img: "https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=600&h=400&fit=crop" }, + { category: "Style", title: "The Architects of Modern Elegance", excerpt: "How a new wave of designers is redefining luxury.", author: "Cleo Marsh", date: "April 2, 2026", img: "https://images.unsplash.com/photo-1483985988355-763728e1935b?w=600&h=400&fit=crop" }, + { category: "Technology", title: "When Algorithms Write the News", excerpt: "The ethical questions we still have not answered about AI journalism.", author: "Idris Kemp", date: "April 1, 2026", img: "https://images.unsplash.com/photo-1518770660439-4636190af475?w=600&h=400&fit=crop" }, +]; + +const categories = ["Culture", "Style", "Technology", "Travel", "Food", "Opinion"]; + +export default function Index() { + const [email, setEmail] = useState(""); + const { mutate: subscribeNewsletter, loading: subscribing } = useSaasMutation("email", "/send/newsletter-confirm"); + const handleSubscribe = async () => { + if (!email) return; + try { await subscribeNewsletter({ email }); setEmail(""); toast.success("Welcome aboard!"); } + catch { toast.error("Could not subscribe. Please try again."); } + }; + return ( +
+
+
+ + {/* Featured Story */} +
+ +
+ Featured +
+
+
+ {featured.category} +

{featured.title}

+

{featured.excerpt}

+
+ {featured.author} + · + {featured.date} +
+
+ +
+ + {/* Editors Picks */} +
+
+

Editor's Picks

+ View all +
+
+ {editorPicks.map((p, i) => ( + + +
+ {p.title} +
+ +

{p.category}

+

{p.title}

+
+ {p.author} + {p.readTime} +
+
+
+ + ))} +
+
+ + {/* Latest Stories */} +
+

Latest Stories

+
+ {latestStories.map((s, i) => ( + +
+ {s.title} +
+
+ {s.category} +

{s.title}

+

{s.excerpt}

+
+ {s.author.split(" ").map(w => w[0]).join("")} + {s.author} + · + {s.date} +
+
+ + ))} +
+
+ + {/* Categories */} +
+

Explore

+
+ {categories.map((c) => ( + + + + ))} +
+
+ + {/* Quote of the Day */} +
+
+ +
The task of the modern writer is not to describe the world but to reveal it.
+

— James Baldwin

+
+
+ + {/* Newsletter */} +
+
+ +

Stay Informed

+

Join 12,000+ readers who get our weekly digest.

+
+ setEmail(e.target.value)} placeholder="your@email.com" className="bg-stone-700 dark:bg-stone-200 border-stone-600 dark:border-stone-300 text-white dark:text-stone-900 placeholder:text-stone-400 dark:placeholder:text-stone-500" /> + +
+
+
+ +
+
+ ); +} \ No newline at end of file