diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..42b7686 Binary files /dev/null and b/public/logo.png differ diff --git a/src/components/common/Logo.tsx b/src/components/common/Logo.tsx index bd8ecd5..6100c6e 100644 --- a/src/components/common/Logo.tsx +++ b/src/components/common/Logo.tsx @@ -4,78 +4,21 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { getApiBaseUrl } from '@/services/api'; export function DefaultLogo() { - const { t } = useTranslation(); + const { t } = useTranslation() + return ( - - - - - ); + {t('logo.alt', + ) } export default function Logo() { - const { t } = useTranslation(); - const [logoUrl, setLogoUrl] = useState(null); - const [failed, setFailed] = useState(false); - - useEffect(() => { - const controller = new AbortController(); - - async function fetchLogo() { - try { - const response = await fetch(`${getApiBaseUrl()}/logo`, { - signal: controller.signal, - }); - const contentType = response.headers.get('content-type') ?? ''; - - if (response.ok && contentType.startsWith('image/')) { - const blob = await response.blob(); - if (!controller.signal.aborted) { - const url = URL.createObjectURL(blob); - setLogoUrl(url); - } - } else { - if (!controller.signal.aborted) setFailed(true); - } - } catch { - if (!controller.signal.aborted) setFailed(true); - } - } - - fetchLogo(); - - return () => { - controller.abort(); - }; - }, []); - - useEffect(() => { - return () => { - if (logoUrl) { - URL.revokeObjectURL(logoUrl); - } - }; - }, [logoUrl]); - - if (logoUrl && !failed) { - return {t('logo.alt',; - } - - return ; + return }