From 00d511df26195c240b1f253157df52e6240805c1 Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Sun, 7 Jun 2026 23:44:27 +0000 Subject: [PATCH] Bob AI: Add floating discount pill with 5 minute countdown timer --- src/components/Layout.tsx | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index d44a06a..b2b3027 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -4,6 +4,52 @@ import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; import SiteBackgroundSlot from "@/components/ui/SiteBackgroundSlot"; import { Outlet } from 'react-router-dom'; import { StyleProvider } from "@/components/ui/StyleProvider"; +import { useState, useEffect } from 'react'; +import { motion } from 'motion/react'; +import Button from '@/components/ui/Button'; + +function DiscountPill() { + const [timeLeft, setTimeLeft] = useState(300); + const [isVisible, setIsVisible] = useState(true); + + useEffect(() => { + if (timeLeft <= 0) return; + const timer = setInterval(() => { + setTimeLeft(prev => prev - 1); + }, 1000); + return () => clearInterval(timer); + }, [timeLeft]); + + if (!isVisible) return null; + + const minutes = Math.floor(timeLeft / 60); + const seconds = timeLeft % 60; + + return ( +
+ +
+ + Opt in for today's discount! + + + {String(minutes).padStart(2, '0')}:{String(seconds).padStart(2, '0')} + +
+
+ ); +} export default function Layout() { const navItems = [ @@ -44,6 +90,7 @@ export default function Layout() {
+