Naprawa błędów awatara
This commit is contained in:
10
App.tsx
10
App.tsx
@@ -15,6 +15,10 @@ import { getEnvVar } from './utils/envUtils';
|
||||
import { AUTHOR_CONFIG } from './_EDITABLE_CONFIG/author';
|
||||
import { UI_TEXT } from './_EDITABLE_CONFIG/ui_text';
|
||||
|
||||
// --- ASSET IMPORT ---
|
||||
// Importujemy logo bezpośrednio, aby bundler poprawnie rozwiązał ścieżkę
|
||||
import logoImg from './logo.png';
|
||||
|
||||
const STORAGE_KEY = 'gpx-storyteller-state-v6';
|
||||
const AUTH_KEY = 'promptstory-auth-token';
|
||||
|
||||
@@ -131,7 +135,7 @@ const App: React.FC = () => {
|
||||
const [isLoaded, setIsLoaded] = useState(false);
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||
|
||||
// LOGO & AVATAR STATE: Default to false (no error), so we try to show image first.
|
||||
// LOGO & AVATAR STATE
|
||||
const [logoError, setLogoError] = useState(false);
|
||||
const [avatarError, setAvatarError] = useState(false);
|
||||
|
||||
@@ -245,10 +249,10 @@ const App: React.FC = () => {
|
||||
<header className="bg-white sticky top-0 z-10 border-b border-gray-100">
|
||||
<div className="max-w-4xl mx-auto px-6 py-4 flex justify-between items-center">
|
||||
<div className="flex items-center space-x-3">
|
||||
{/* LOGO LOGIC: Try to show image. If error, fallback to icon/text. */}
|
||||
{/* LOGO LOGIC: Use imported logoImg */}
|
||||
{!logoError ? (
|
||||
<img
|
||||
src="logo.png"
|
||||
src={logoImg}
|
||||
alt="Logo"
|
||||
onError={() => setLogoError(true)}
|
||||
className="h-10 object-contain"
|
||||
|
||||
Reference in New Issue
Block a user