feat(sonuc): girişsiz kullanıcıya telefonda sabit "Google ile kaydet" çubuğu
BACKLOG #4. md altında, oturum sinyali girişsiz dediğinde görünür; tık mevcut /giris akışına (callback'li) gider, giris_cta_tiklandi{kaynak:"sonuc_cubuk"} olayı düşer. Güvenli alan ve içerik altı ara parçası var. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import { LISTE_SAYI_CEREZ_ADI } from "@/features/liste/liste-dogrula";
|
||||
import { TadimlikBolumu } from "@/features/rapor/components/tadimlik-bolumu";
|
||||
import { SonucSihirbazi } from "@/features/sihirbaz/components/sihirbaz-bolumu";
|
||||
import { SiraGerekli } from "@/features/sihirbaz/components/sira-gerekli";
|
||||
import { SonucKaydetCubugu } from "@/features/liste/components/sonuc-kaydet-cubugu";
|
||||
import { SiteFooter } from "@/components/site-footer";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
@@ -183,6 +184,9 @@ export default function SonucPage({
|
||||
</p>
|
||||
</main>
|
||||
<SiteFooter />
|
||||
{/* Girişsiz + telefonda sabit "kaydet" çubuğu; footer'ın altına
|
||||
kendi boyu kadar boşluk bırakır. */}
|
||||
<SonucKaydetCubugu />
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
85
src/features/liste/components/sonuc-kaydet-cubugu.tsx
Normal file
85
src/features/liste/components/sonuc-kaydet-cubugu.tsx
Normal file
@@ -0,0 +1,85 @@
|
||||
"use client";
|
||||
|
||||
// /sonuc'ta girişsiz kullanıcıya telefonda sabit alt çubuk (BACKLOG #4):
|
||||
// sayfadaki giriş paneli görünse de tıklanmıyordu, telefonda /sonuc'tan
|
||||
// çıkış hızlıydı; kaydetme kapısı parmağın altında dursun. Yalnız `md`
|
||||
// altında ve oturum sinyali "girişsiz" dediğinde görünür (sinyal gelmeden
|
||||
// gizli: girişli kullanıcıya bir an bile çıkmaz).
|
||||
//
|
||||
// Tık yeni bir giriş akışı açmaz: diğer giriş CTA'ları gibi /giris'e
|
||||
// (bu sayfaya dönen callback'le) gider. Google düğmesi orada ilk sıradadır
|
||||
// ve KVKK aydınlatma/koşullar notu o sayfada; çubuktan doğrudan Google'a
|
||||
// atlamak o notu atlatırdı.
|
||||
//
|
||||
// Çubuk içerik akışında kendi boyu kadar boşluk bırakır (ara parça), böylece
|
||||
// sayfanın en altı (dipnot, footer) çubuğun altında kalmaz.
|
||||
|
||||
import Link from "next/link";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
import { ViewportPortal } from "@/components/viewport-portal";
|
||||
import { olay } from "@/lib/analitik";
|
||||
import { YAY } from "@/lib/hareket";
|
||||
import { useManuelListe } from "../liste-store";
|
||||
import { useOturumDurumu } from "../liste-oturum-sinyali";
|
||||
import { useGirisUrl } from "../liste-giris-url";
|
||||
|
||||
export function SonucKaydetCubugu() {
|
||||
const girisli = useOturumDurumu();
|
||||
const liste = useManuelListe();
|
||||
const girisUrl = useGirisUrl();
|
||||
const azalt = useReducedMotion();
|
||||
|
||||
if (girisli !== false) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Ara parça: çubuğun yüksekliği (p-2 + h-12 + alt boşluk) + güvenli alan */}
|
||||
<div
|
||||
aria-hidden
|
||||
className="h-[calc(env(safe-area-inset-bottom)+6rem)] md:hidden"
|
||||
/>
|
||||
<ViewportPortal>
|
||||
<div className="pointer-events-none fixed inset-x-0 bottom-[calc(env(safe-area-inset-bottom)+0.75rem)] z-40 px-4 md:hidden print:hidden">
|
||||
<motion.div
|
||||
initial={azalt ? { opacity: 0 } : { opacity: 0, y: 24 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={YAY.varsayilan}
|
||||
className="pointer-events-auto mx-auto flex max-w-xl items-center gap-3 rounded-2xl border border-slate-200 bg-card p-2 pl-4 shadow-xl"
|
||||
>
|
||||
<p className="min-w-0 flex-1 text-sm leading-snug text-slate-600">
|
||||
{liste.length > 0 ? (
|
||||
<>
|
||||
<span className="font-semibold text-slate-900">
|
||||
<SayiRulo deger={liste.length} /> seçimin
|
||||
</span>{" "}
|
||||
yalnız bu tarayıcıda
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span className="font-semibold text-slate-900">
|
||||
Seçimlerin
|
||||
</span>{" "}
|
||||
yalnız bu tarayıcıda
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
<Button asChild size="lg" variant="cta" className="shrink-0 px-5">
|
||||
<Link
|
||||
href={girisUrl}
|
||||
onClick={() =>
|
||||
olay("giris_cta_tiklandi", { kaynak: "sonuc_cubuk" })
|
||||
}
|
||||
>
|
||||
Google ile kaydet
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
</motion.div>
|
||||
</div>
|
||||
</ViewportPortal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user