feat: refine Scan & Taste UI, fix desktop scrolling, and resolve production login fetch error
- Reverted theme from gold to amber and restored legacy typography. - Refactored ScanAndTasteFlow and TastingEditor for robust desktop scrolling. - Hotfixed sw.js to completely bypass Supabase Auth/API requests to fix 'Failed to fetch' in production. - Integrated full tasting note persistence (tags, buddies, sessions).
This commit is contained in:
@@ -2,28 +2,37 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--foreground-rgb: 0, 0, 0;
|
||||
--background-start-rgb: 214, 219, 220;
|
||||
--background-end-rgb: 255, 255, 255;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@layer base {
|
||||
:root {
|
||||
--foreground-rgb: 255, 255, 255;
|
||||
--background-start-rgb: 0, 0, 0;
|
||||
--background-end-rgb: 0, 0, 0;
|
||||
--background: #0F1014;
|
||||
--surface: #1A1B20;
|
||||
--primary: #C89D46;
|
||||
--border: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
color: rgb(var(--foreground-rgb));
|
||||
background: linear-gradient(to bottom,
|
||||
transparent,
|
||||
rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
|
||||
@apply bg-[#0F1014] text-white antialiased;
|
||||
font-feature-settings: "cv02", "cv03", "cv04", "cv11";
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
.font-display {
|
||||
font-family: var(--font-playfair), serif;
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.glass {
|
||||
@apply backdrop-blur-md bg-white/5 border border-white/10;
|
||||
}
|
||||
|
||||
.glass-dark {
|
||||
@apply backdrop-blur-md bg-black/40 border border-white/5;
|
||||
}
|
||||
|
||||
.scrollbar-hide::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,10 @@ import MainContentWrapper from "@/components/MainContentWrapper";
|
||||
import AuthListener from "@/components/AuthListener";
|
||||
import SyncHandler from "@/components/SyncHandler";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
const inter = Inter({ subsets: ["latin"], variable: '--font-inter' });
|
||||
const playfair = Playfair_Display({ subsets: ["latin"], variable: '--font-playfair' });
|
||||
|
||||
import { Playfair_Display } from "next/font/google";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
@@ -45,7 +48,7 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
<html lang="de">
|
||||
<body className={inter.className}>
|
||||
<body className={`${inter.variable} ${playfair.variable} font-sans`}>
|
||||
<I18nProvider>
|
||||
<SessionProvider>
|
||||
<AuthListener />
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { createClient } from '@/lib/supabase/client';
|
||||
import CameraCapture from "@/components/CameraCapture";
|
||||
import BottleGrid from "@/components/BottleGrid";
|
||||
import AuthForm from "@/components/AuthForm";
|
||||
import BuddyList from "@/components/BuddyList";
|
||||
@@ -13,7 +12,9 @@ import LanguageSwitcher from "@/components/LanguageSwitcher";
|
||||
import OfflineIndicator from "@/components/OfflineIndicator";
|
||||
import { useI18n } from "@/i18n/I18nContext";
|
||||
import { useSession } from "@/context/SessionContext";
|
||||
import { Sparkles } from "lucide-react";
|
||||
import { Sparkles, Camera } from "lucide-react";
|
||||
import FloatingScannerButton from '@/components/FloatingScannerButton';
|
||||
import ScanAndTasteFlow from '@/components/ScanAndTasteFlow';
|
||||
|
||||
export default function Home() {
|
||||
const supabase = createClient();
|
||||
@@ -23,6 +24,13 @@ export default function Home() {
|
||||
const [fetchError, setFetchError] = useState<string | null>(null);
|
||||
const { t } = useI18n();
|
||||
const { activeSession } = useSession();
|
||||
const [isFlowOpen, setIsFlowOpen] = useState(false);
|
||||
const [capturedImage, setCapturedImage] = useState<string | null>(null);
|
||||
|
||||
const handleImageSelected = (base64: string) => {
|
||||
setCapturedImage(base64);
|
||||
setIsFlowOpen(true);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Check session
|
||||
@@ -200,7 +208,6 @@ export default function Home() {
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full max-w-5xl">
|
||||
<div className="flex flex-col gap-8">
|
||||
<CameraCapture onSaveComplete={fetchCollection} />
|
||||
<SessionList />
|
||||
</div>
|
||||
<div>
|
||||
@@ -232,10 +239,17 @@ export default function Home() {
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<BottleGrid bottles={bottles} />
|
||||
bottles.length > 0 && <BottleGrid bottles={bottles} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FloatingScannerButton onImageSelected={handleImageSelected} />
|
||||
<ScanAndTasteFlow
|
||||
isOpen={isFlowOpen}
|
||||
onClose={() => setIsFlowOpen(false)}
|
||||
base64Image={capturedImage}
|
||||
/>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user