fix: frontend consistency audit — 55 files cleaned up
Consistency fixes: - Extract getThisWeekRange/getThisMonthRange to shared lib/utils/dateRanges.ts (removed 4 identical copy-pasted definitions) - Add error boundaries for behavior, cdn, search, pagespeed pages (4 new error.tsx files — previously fell through to generic parent error) - Add "View setup guide" CTA to empty states on journeys and behavior pages (previously showed text with no actionable button) - Fix non-lazy useState initializer in funnel detail page - Fix Bot & Spam settings header from text-xl to text-2xl (matches all other sections) - Add useMinimumLoading to PageSpeed skeleton (consistent with all other pages) Cleanup: - Remove 438 redundant dark: class prefixes (app is dark-mode only) text-neutral-500 dark:text-neutral-400 → text-neutral-400 (206 occurrences) text-neutral-900 dark:text-white → text-white (232 occurrences) - Remove dead @stripe/react-stripe-js and @stripe/stripe-js packages (billing migrated to Polar, no code imports Stripe) - Remove duplicate motion package (framer-motion is the one actually used)
This commit is contained in:
@@ -124,7 +124,7 @@ export default function DeleteSiteModal({ open, onClose, onDeleted, siteName, si
|
||||
value={deleteConfirm}
|
||||
onChange={(e) => setDeleteConfirm(e.target.value)}
|
||||
autoComplete="off"
|
||||
className="w-full px-3 py-2 text-sm border border-neutral-300 dark:border-neutral-700 rounded-lg bg-white dark:bg-neutral-800 text-neutral-900 dark:text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400"
|
||||
className="w-full px-3 py-2 text-sm border border-neutral-300 dark:border-neutral-700 rounded-lg bg-white dark:bg-neutral-800 text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400"
|
||||
placeholder="DELETE"
|
||||
/>
|
||||
</div>
|
||||
@@ -187,7 +187,7 @@ export default function DeleteSiteModal({ open, onClose, onDeleted, siteName, si
|
||||
value={permanentConfirm}
|
||||
onChange={(e) => setPermanentConfirm(e.target.value)}
|
||||
autoComplete="off"
|
||||
className="w-full px-3 py-2 text-sm border border-neutral-300 dark:border-neutral-700 rounded-lg bg-white dark:bg-neutral-800 text-neutral-900 dark:text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400"
|
||||
className="w-full px-3 py-2 text-sm border border-neutral-300 dark:border-neutral-700 rounded-lg bg-white dark:bg-neutral-800 text-white placeholder-neutral-400 focus:outline-none focus:ring-2 focus:ring-red-500 dark:focus:ring-red-400"
|
||||
placeholder={siteDomain}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -167,7 +167,7 @@ export default function ScriptSetupBlock({
|
||||
|
||||
{/* ── Feature toggles ─────────────────────────────────────────────── */}
|
||||
<div className="mt-6">
|
||||
<h4 className="text-sm font-semibold text-neutral-900 dark:text-white mb-3">
|
||||
<h4 className="text-sm font-semibold text-white mb-3">
|
||||
Features
|
||||
</h4>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
@@ -177,10 +177,10 @@ export default function ScriptSetupBlock({
|
||||
className="flex items-center justify-between rounded-xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 px-4 py-3"
|
||||
>
|
||||
<div className="min-w-0 mr-3">
|
||||
<span className="text-sm font-medium text-neutral-900 dark:text-white block">
|
||||
<span className="text-sm font-medium text-white block">
|
||||
{f.label}
|
||||
</span>
|
||||
<span className="text-xs text-neutral-500 dark:text-neutral-400">
|
||||
<span className="text-xs text-neutral-400">
|
||||
{f.description}
|
||||
</span>
|
||||
</div>
|
||||
@@ -191,10 +191,10 @@ export default function ScriptSetupBlock({
|
||||
{/* * Frustration — full-width, visually distinct as add-on */}
|
||||
<div className="mt-3 flex items-center justify-between rounded-xl border border-dashed border-neutral-300 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-900/50 px-4 py-3">
|
||||
<div className="min-w-0 mr-3">
|
||||
<span className="text-sm font-medium text-neutral-900 dark:text-white block">
|
||||
<span className="text-sm font-medium text-white block">
|
||||
Frustration tracking
|
||||
</span>
|
||||
<span className="text-xs text-neutral-500 dark:text-neutral-400">
|
||||
<span className="text-xs text-neutral-400">
|
||||
Rage clicks & dead clicks · Loads separate add-on script
|
||||
</span>
|
||||
</div>
|
||||
@@ -204,15 +204,15 @@ export default function ScriptSetupBlock({
|
||||
|
||||
{/* ── Storage + TTL ───────────────────────────────────────────────── */}
|
||||
<div className="mt-6">
|
||||
<h4 className="text-sm font-semibold text-neutral-900 dark:text-white mb-1">
|
||||
<h4 className="text-sm font-semibold text-white mb-1">
|
||||
Visitor identity
|
||||
</h4>
|
||||
<p className="text-xs text-neutral-500 dark:text-neutral-400 mb-3">
|
||||
<p className="text-xs text-neutral-400 mb-3">
|
||||
How returning visitors are recognized. Stricter settings increase privacy but may raise unique visitor counts.
|
||||
</p>
|
||||
<div className="flex items-end gap-3">
|
||||
<div className="min-w-0">
|
||||
<label className="text-xs font-medium text-neutral-500 dark:text-neutral-400 mb-1 block">
|
||||
<label className="text-xs font-medium text-neutral-400 mb-1 block">
|
||||
Recognition
|
||||
</label>
|
||||
<Select
|
||||
@@ -224,7 +224,7 @@ export default function ScriptSetupBlock({
|
||||
</div>
|
||||
{storage === 'local' && (
|
||||
<div>
|
||||
<label className="text-xs font-medium text-neutral-500 dark:text-neutral-400 mb-1 block">
|
||||
<label className="text-xs font-medium text-neutral-400 mb-1 block">
|
||||
Reset after
|
||||
</label>
|
||||
<Select
|
||||
@@ -242,14 +242,14 @@ export default function ScriptSetupBlock({
|
||||
{showFrameworkPicker && (
|
||||
<div className="mt-6">
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<h4 className="text-sm font-semibold text-neutral-900 dark:text-white">
|
||||
<h4 className="text-sm font-semibold text-white">
|
||||
Setup guide
|
||||
</h4>
|
||||
<Link
|
||||
href="/integrations"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-xs font-medium text-neutral-500 dark:text-neutral-400 hover:text-brand-orange transition-colors"
|
||||
className="text-xs font-medium text-neutral-400 hover:text-brand-orange transition-colors"
|
||||
>
|
||||
All integrations →
|
||||
</Link>
|
||||
|
||||
@@ -46,8 +46,8 @@ function SiteCard({ site, stats, statsLoading, onDelete, canDelete }: SiteCardPr
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="font-semibold text-neutral-900 dark:text-white">{site.name}</h3>
|
||||
<div className="flex items-center gap-1 text-sm text-neutral-500 dark:text-neutral-400">
|
||||
<h3 className="font-semibold text-white">{site.name}</h3>
|
||||
<div className="flex items-center gap-1 text-sm text-neutral-400">
|
||||
{site.domain}
|
||||
<a
|
||||
href={`https://${site.domain}`}
|
||||
@@ -84,13 +84,13 @@ function SiteCard({ site, stats, statsLoading, onDelete, canDelete }: SiteCardPr
|
||||
<div className="mb-6 grid grid-cols-2 gap-4 rounded-lg bg-neutral-50 p-3 dark:bg-neutral-800/50">
|
||||
<div>
|
||||
<p className="text-xs text-neutral-500">Visitors (24h)</p>
|
||||
<p className="font-mono text-lg font-medium text-neutral-900 dark:text-white">
|
||||
<p className="font-mono text-lg font-medium text-white">
|
||||
{statsLoading ? '--' : formatNumber(visitors24h)}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs text-neutral-500">Pageviews</p>
|
||||
<p className="font-mono text-lg font-medium text-neutral-900 dark:text-white">
|
||||
<p className="font-mono text-lg font-medium text-white">
|
||||
{statsLoading ? '--' : formatNumber(pageviews)}
|
||||
</p>
|
||||
</div>
|
||||
@@ -144,8 +144,8 @@ export default function SiteList({ sites, siteStats, loading, onDelete }: SiteLi
|
||||
className="mb-6"
|
||||
unoptimized
|
||||
/>
|
||||
<h3 className="text-lg font-semibold text-neutral-900 dark:text-white">No sites yet</h3>
|
||||
<p className="mt-2 text-sm text-neutral-500 dark:text-neutral-400 mb-4">Create your first site to get started.</p>
|
||||
<h3 className="text-lg font-semibold text-white">No sites yet</h3>
|
||||
<p className="mt-2 text-sm text-neutral-400 mb-4">Create your first site to get started.</p>
|
||||
<Link href="/sites/new">
|
||||
<Button variant="primary" className="text-sm">
|
||||
Add your first site
|
||||
@@ -176,8 +176,8 @@ export default function SiteList({ sites, siteStats, loading, onDelete }: SiteLi
|
||||
<div className="mb-3 rounded-full bg-neutral-200 p-3 dark:bg-neutral-800">
|
||||
<BookOpenIcon className="h-6 w-6 text-neutral-500" />
|
||||
</div>
|
||||
<h3 className="font-semibold text-neutral-900 dark:text-white">Need help setup?</h3>
|
||||
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">Check our documentation for installation guides.</p>
|
||||
<h3 className="font-semibold text-white">Need help setup?</h3>
|
||||
<p className="mb-4 text-sm text-neutral-400">Check our documentation for installation guides.</p>
|
||||
<Link href="https://docs.ciphera.net" target="_blank" className="text-sm font-medium text-brand-orange hover:underline">
|
||||
Read Documentation →
|
||||
</Link>
|
||||
|
||||
@@ -105,7 +105,7 @@ export default function VerificationModal({ isOpen, onClose, site, onVerified }:
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between px-6 py-4 border-b border-neutral-100 dark:border-neutral-800">
|
||||
<h3 className="font-semibold text-neutral-900 dark:text-white">
|
||||
<h3 className="font-semibold text-white">
|
||||
Verify Installation
|
||||
</h3>
|
||||
<button
|
||||
@@ -148,10 +148,10 @@ export default function VerificationModal({ isOpen, onClose, site, onVerified }:
|
||||
<div className="absolute inset-0 w-16 h-16 border-4 border-brand-orange border-t-transparent rounded-full animate-spin" />
|
||||
</div>
|
||||
<div className="text-center space-y-1">
|
||||
<h4 className="font-medium text-neutral-900 dark:text-white">
|
||||
<h4 className="font-medium text-white">
|
||||
Checking connection...
|
||||
</h4>
|
||||
<p className="text-sm text-neutral-500 dark:text-neutral-400">
|
||||
<p className="text-sm text-neutral-400">
|
||||
Waiting for signal from {site.domain}
|
||||
</p>
|
||||
</div>
|
||||
@@ -164,10 +164,10 @@ export default function VerificationModal({ isOpen, onClose, site, onVerified }:
|
||||
<CheckCircleIcon className="w-8 h-8" />
|
||||
</div>
|
||||
<div className="text-center space-y-1">
|
||||
<h4 className="text-xl font-bold text-neutral-900 dark:text-white">
|
||||
<h4 className="text-xl font-bold text-white">
|
||||
You're all set!
|
||||
</h4>
|
||||
<p className="text-neutral-500 dark:text-neutral-400">
|
||||
<p className="text-neutral-400">
|
||||
We are successfully receiving data from your website.
|
||||
</p>
|
||||
</div>
|
||||
@@ -189,7 +189,7 @@ export default function VerificationModal({ isOpen, onClose, site, onVerified }:
|
||||
</div>
|
||||
|
||||
<div className="p-4 bg-neutral-50 dark:bg-neutral-800/50 rounded-xl border border-neutral-100 dark:border-neutral-800">
|
||||
<p className="text-sm font-medium text-neutral-900 dark:text-white mb-2">
|
||||
<p className="text-sm font-medium text-white mb-2">
|
||||
Troubleshooting Checklist:
|
||||
</p>
|
||||
<ul className="text-sm text-neutral-600 dark:text-neutral-400 space-y-1 list-disc list-inside">
|
||||
|
||||
Reference in New Issue
Block a user