Files
kolaytercih/src/lib/sosyal-kanit-sabitler.ts
bilalgursen 2278d2a218
All checks were successful
Deploy / deploy (push) Successful in 22m12s
Update app.db, enhance Home component with social proof feature, and improve error handling in auth module
- Updated app.db to reflect recent changes.
- Added a Suspense-wrapped SosyalKanitBandi component in the Home page for improved user engagement.
- Refactored the sendMagicLinkEmail function in auth.ts to handle errors more effectively, ensuring users receive appropriate feedback on email sending issues.
- Removed the Rybbit live visitor widget from the site footer for a cleaner design.
2026-08-02 21:10:43 +03:00

34 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Sosyal kanıt şeridinin eşikleri ve veri tipi. Ayrı dosya, çünkü şeridin
* istemci gövdesi de bunları okuyor; `sosyal-kanit.ts` veritabanı ve Rybbit
* anahtarını içeri aldığı için istemci paketine girmemeli.
*/
/**
* Liste sayısı bu eşiğin altındaysa şerit hiç gösterilmez: "12 öğrenci
* oluşturdu" satın almaya itmez, tersine yeni/boş izlenimi verir.
*/
export const LISTE_ESIGI = 25;
/**
* Canlı sayı bu eşiğin altındaysa canlı satır gizlenir. 1 kişi zaten
* ziyaretçinin kendisi; "1 kişi sitede" sosyal kanıt değil, tam tersi.
*/
export const CANLI_ESIGI = 3;
/**
* Eşikler yalnızca prod'da işler. Geliştirmede veritabanında bir avuç kayıt
* olur; şeridi gizlemek "kod çalışmıyor" gibi görünür, oysa çalışıyor.
*/
export function esikGecti(sayi: number, esik: number): boolean {
if (process.env.NODE_ENV !== "production") return sayi > 0;
return sayi >= esik;
}
export interface SosyalKanitVerisi {
/** Üretilmiş tercih listesi sayısı. */
liste: number;
/** Son 30 dakikadaki ziyaretçi; kaynak yoksa null. */
canli: number | null;
}