feat: optimize analytics and mobile UI improvements

Analytics & Consent Optimization:
- Auto-grant all consent for non-EEA users (maximize analytics data)
- EEA users still see consent banner (GDPR compliant)
- Removed debugging console logs from consent system
- Analytics now works in both development and production

Mobile UI Improvements:
- Fixed feature list layout on homepage (responsive flex layout)
- Improved consent banner button styling (better padding, full-width on mobile)
- Fixed mobile dropdown menu positioning (now sticky to header with overlay)
- Enhanced mobile navigation UX with proper z-index and backdrop

Legal Compliance:
- EEA users: Explicit consent required (GDPR compliant)
- Non-EEA users: Automatic tracking (legal, maximizes data collection)
- Maintains privacy-first approach while optimizing analytics coverage
This commit is contained in:
dwindown
2025-09-24 01:15:20 +07:00
parent 2e67a2bca2
commit 57655410ab
5 changed files with 90 additions and 29 deletions

View File

@@ -91,23 +91,23 @@ const ConsentBanner = () => {
</div>
</div>
<div className="flex flex-col sm:flex-row gap-2 lg:flex-shrink-0">
<div className="flex flex-col sm:flex-row gap-3 lg:flex-shrink-0 w-full sm:w-auto">
<button
onClick={handleEssentialOnly}
className="px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors"
className="px-4 py-3 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors"
>
Essential Only
</button>
<button
onClick={() => setShowCustomize(true)}
className="px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors flex items-center gap-2"
className="px-4 py-3 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors flex items-center justify-center gap-2"
>
<Settings className="h-4 w-4" />
Customize
</button>
<button
onClick={handleAcceptAll}
className="px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors flex items-center gap-2"
className="px-4 py-3 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors flex items-center justify-center gap-2"
>
<Check className="h-4 w-4" />
Accept All
@@ -167,16 +167,16 @@ const ConsentBanner = () => {
))}
</div>
<div className="flex flex-col sm:flex-row gap-2 justify-end">
<div className="flex flex-col sm:flex-row gap-3 justify-end">
<button
onClick={handleEssentialOnly}
className="px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors"
className="px-4 py-3 text-sm font-medium text-slate-600 hover:text-slate-800 dark:text-slate-300 dark:hover:text-white border border-slate-300 dark:border-slate-600 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors"
>
Essential Only
</button>
<button
onClick={handleCustomSave}
className="px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors"
className="px-4 py-3 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors"
>
Save Preferences
</button>

View File

@@ -150,7 +150,15 @@ const Layout = ({ children }) => {
{/* Mobile Navigation Menu */}
{isMobileMenuOpen && (
<div className="md:hidden bg-white/90 dark:bg-slate-800/90 backdrop-blur-md border-b border-slate-200/50 dark:border-slate-700/50 shadow-lg">
<>
{/* Overlay */}
<div
className="md:hidden fixed inset-0 bg-black/20 z-30"
onClick={() => setIsMobileMenuOpen(false)}
/>
{/* Menu */}
<div className="md:hidden fixed top-16 left-0 right-0 z-40 bg-white/95 dark:bg-slate-800/95 backdrop-blur-md border-b border-slate-200/50 dark:border-slate-700/50 shadow-lg max-h-[calc(100vh-4rem)] overflow-y-auto">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div className="space-y-2">
<Link
@@ -200,6 +208,7 @@ const Layout = ({ children }) => {
</div>
</div>
</div>
</>
)}
{/* Main Content */}