feat(ui): unified AppHeader, logo brand, tagline update, and header simplification
- Brand component now renders horizontal SVG logo instead of text - New AppHeader shared component replaces per-route header boilerplate - Tagline updated to "Outils pour ostéopathes animaliers" - All routes use AppHeader (HomeRoute, EditorsRoute, NewReportRoute, SvgEditorRoute) - ReportHeader and Footer simplified - DEPLOY.md URLs updated zoosteo.fr → faunosteo.com - Logo assets added (favicon.svg, logo-horizontal.svg, apple-touch-icon.png) - Removed unused eslint-disable directive in SvgEditorRoute Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2d6ed809e2
commit
1f30280762
25 files changed
+141
-153
No files matched your search
@@ -1,29 +1,18 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import Card from '@/components/ui/Card'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export default function EditorsRoute() {
|
||||
const cfg = useConfig()
|
||||
const t = useT()
|
||||
|
||||
return (
|
||||
<main className="flex-1 flex flex-col">
|
||||
<header className="px-6 py-4 border-b border-[var(--color-border)] flex items-center justify-between">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<Link to="/" className="no-underline">
|
||||
<Brand size="lg" />
|
||||
</Link>
|
||||
<span className="text-sm text-[var(--color-ink-muted)]">{cfg.tagline}</span>
|
||||
</div>
|
||||
<LanguageSwitcher />
|
||||
</header>
|
||||
<section className="flex-1 grid place-items-center px-6">
|
||||
<AppHeader />
|
||||
<section className="flex-1 grid place-items-center px-4 sm:px-6">
|
||||
<div className="grid gap-4 md:grid-cols-2 max-w-3xl w-full">
|
||||
<Card className="p-6 space-y-4">
|
||||
<h2 className="font-serif text-2xl">{t('editors.svg.title')}</h2>
|
||||
<Card className="p-4 sm:p-6 space-y-3 sm:space-y-4">
|
||||
<h2 className="font-serif text-xl sm:text-2xl">{t('editors.svg.title')}</h2>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">
|
||||
{t('editors.svg.description')}
|
||||
</p>
|
||||
@@ -34,8 +23,8 @@ export default function EditorsRoute() {
|
||||
{t('editors.svg.cta')}
|
||||
</Link>
|
||||
</Card>
|
||||
<Card className="p-6 space-y-4">
|
||||
<h2 className="font-serif text-2xl">{t('editors.pathology.title')}</h2>
|
||||
<Card className="p-4 sm:p-6 space-y-3 sm:space-y-4">
|
||||
<h2 className="font-serif text-xl sm:text-2xl">{t('editors.pathology.title')}</h2>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">
|
||||
{t('editors.pathology.description')}
|
||||
</p>
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useRef, useState } from 'react'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Card from '@/components/ui/Card'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { importReportFromPdf, ImportError } from '@/pdf/import'
|
||||
import { useReportStore } from '@/state/reportStore'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export default function HomeRoute() {
|
||||
const navigate = useNavigate()
|
||||
const cfg = useConfig()
|
||||
const fileRef = useRef<HTMLInputElement | null>(null)
|
||||
const hydrate = useReportStore((s) => s.hydrateReport)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
@@ -53,22 +50,16 @@ export default function HomeRoute() {
|
||||
|
||||
return (
|
||||
<main className="flex-1 flex flex-col">
|
||||
<header className="px-6 py-4 border-b border-[var(--color-border)] flex items-center justify-between">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<Brand size="lg" />
|
||||
<span className="text-sm text-[var(--color-ink-muted)]">{cfg.tagline}</span>
|
||||
</div>
|
||||
<LanguageSwitcher />
|
||||
</header>
|
||||
<section className="flex-1 grid place-items-center px-6">
|
||||
<AppHeader />
|
||||
<section className="flex-1 grid place-items-center px-4 sm:px-6">
|
||||
<div className="grid gap-4 md:grid-cols-2 max-w-3xl w-full">
|
||||
<Card className="p-6 space-y-4">
|
||||
<h2 className="font-serif text-2xl">{t('home.new_report.title')}</h2>
|
||||
<Card className="p-4 sm:p-6 space-y-3 sm:space-y-4">
|
||||
<h2 className="font-serif text-xl sm:text-2xl">{t('home.new_report.title')}</h2>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">{t('home.new_report.description')}</p>
|
||||
<Button onClick={() => navigate('/new')} size="lg">{t('home.new_report.cta')}</Button>
|
||||
</Card>
|
||||
<Card className="p-6 space-y-4">
|
||||
<h2 className="font-serif text-2xl">{t('home.import.title')}</h2>
|
||||
<Card className="p-4 sm:p-6 space-y-3 sm:space-y-4">
|
||||
<h2 className="font-serif text-xl sm:text-2xl">{t('home.import.title')}</h2>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">{t('home.import.description')}</p>
|
||||
<input ref={fileRef} type="file" accept="application/pdf,.pdf" className="hidden" onChange={onPickFile} />
|
||||
<Button variant="secondary" size="lg" onClick={() => fileRef.current?.click()} disabled={busy}>
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import PractitionerForm from '@/components/report/PractitionerForm'
|
||||
import AnimalForm from '@/components/report/AnimalForm'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Input from '@/components/ui/Input'
|
||||
import Label from '@/components/ui/Label'
|
||||
import { todayIso } from '@/lib/dates'
|
||||
import { readCachedPractitioner, writeCachedPractitioner } from '@/state/practitionerCache'
|
||||
import { useReportStore } from '@/state/reportStore'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export default function NewReportRoute() {
|
||||
const navigate = useNavigate()
|
||||
const initReport = useReportStore((s) => s.initReport)
|
||||
const cfg = useConfig()
|
||||
const t = useT()
|
||||
|
||||
const [practitioner, setPractitioner] = useState({ name: '' })
|
||||
@@ -48,21 +45,9 @@ export default function NewReportRoute() {
|
||||
|
||||
return (
|
||||
<main className="min-h-screen">
|
||||
<header className="px-6 py-4 border-b border-[var(--color-border)] flex items-center justify-between">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<Link
|
||||
to="/"
|
||||
aria-label={t('common.back_to_home')}
|
||||
className="rounded-md px-1 py-0.5 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]"
|
||||
>
|
||||
<Brand />
|
||||
</Link>
|
||||
<span className="text-sm text-[var(--color-ink-muted)]">{cfg.tagline}</span>
|
||||
</div>
|
||||
<LanguageSwitcher />
|
||||
</header>
|
||||
<div className="max-w-3xl mx-auto px-6 py-8 space-y-8">
|
||||
<h1 className="font-serif text-3xl">{t('new_report.title')}</h1>
|
||||
<AppHeader />
|
||||
<div className="max-w-3xl mx-auto px-4 sm:px-6 py-6 sm:py-8 space-y-6 sm:space-y-8">
|
||||
<h1 className="font-serif text-2xl sm:text-3xl">{t('new_report.title')}</h1>
|
||||
<div>
|
||||
<Label htmlFor="date">{t('new_report.date_label')}</Label>
|
||||
<Input id="date" type="date" value={date} onChange={(e) => setDate(e.target.value)} />
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
import { getDict } from '@/i18n/index'
|
||||
@@ -15,7 +13,6 @@ export default function SvgEditorRoute() {
|
||||
const canvasInnerRef = useRef<HTMLDivElement>(null)
|
||||
const sidebarRef = useRef<HTMLDivElement>(null)
|
||||
const cleanupRef = useRef<(() => void) | null>(null)
|
||||
const cfg = useConfig()
|
||||
const t = useT()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
|
||||
@@ -45,20 +42,11 @@ export default function SvgEditorRoute() {
|
||||
cleanupRef.current = null
|
||||
}
|
||||
// Re-init when locale changes so all vanilla JS strings update
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [locale])
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-screen">
|
||||
<header className="px-4 py-2 border-b border-[var(--color-border)] flex items-center justify-between shrink-0">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<Link to="/" className="no-underline">
|
||||
<Brand size="sm" />
|
||||
</Link>
|
||||
<span className="text-xs text-[var(--color-ink-muted)]">{cfg.tagline}</span>
|
||||
</div>
|
||||
<LanguageSwitcher />
|
||||
</header>
|
||||
<AppHeader />
|
||||
|
||||
<div className="svg-editor-root">
|
||||
<div
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
import Brand from './Brand'
|
||||
import LanguageSwitcher from './LanguageSwitcher'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
interface AppHeaderProps {
|
||||
children?: React.ReactNode
|
||||
}
|
||||
|
||||
export default function AppHeader({ children }: AppHeaderProps) {
|
||||
const cfg = useConfig()
|
||||
const t = useT()
|
||||
return (
|
||||
<header className="px-3 sm:px-6 py-2 sm:py-3 border-b border-[var(--color-border)] flex items-center justify-between bg-[var(--color-surface)]">
|
||||
<div className="flex items-center gap-3">
|
||||
<Link
|
||||
to="/"
|
||||
aria-label={t('common.home')}
|
||||
className="rounded-md px-1 py-0.5 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]"
|
||||
>
|
||||
<Brand size="lg" />
|
||||
</Link>
|
||||
<span className="text-sm text-[var(--color-ink-muted)] hidden sm:inline">
|
||||
{cfg.tagline}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 sm:gap-4">
|
||||
{children}
|
||||
<LanguageSwitcher />
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
const HEIGHT = { sm: 'h-7', md: 'h-9', lg: 'h-11' } as const
|
||||
|
||||
export default function Brand({ size = 'md' }: { size?: 'sm' | 'md' | 'lg' }) {
|
||||
const cfg = useConfig()
|
||||
const cls = size === 'lg' ? 'text-3xl' : size === 'sm' ? 'text-base' : 'text-xl'
|
||||
return (
|
||||
<span className={`font-serif font-semibold tracking-tight ${cls}`}>
|
||||
{cfg.brandName}
|
||||
</span>
|
||||
<img
|
||||
src="/logo-horizontal.svg"
|
||||
alt="Faunosteo"
|
||||
className={`${HEIGHT[size]} w-auto`}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -7,18 +7,18 @@ export default function Footer() {
|
||||
const t = useT()
|
||||
const year = new Date().getFullYear()
|
||||
return (
|
||||
<footer className="mt-12 border-t border-neutral-200 bg-neutral-50 py-6 text-center text-sm text-neutral-600">
|
||||
<footer className="mt-8 sm:mt-12 border-t border-neutral-200 bg-neutral-50 py-4 sm:py-6 text-center text-xs sm:text-sm text-neutral-600">
|
||||
<p className="mb-3">
|
||||
© {year} {cfg.footerName}. {t('footer.all_rights_reserved')}
|
||||
</p>
|
||||
<div className="flex items-center justify-center gap-4">
|
||||
© {year} {cfg.footerName}. {t('footer.all_rights_reserved')}{' '}
|
||||
<span className="text-neutral-300">·</span>{' '}
|
||||
<Link
|
||||
to="/editors"
|
||||
className="text-[var(--color-accent)] hover:text-[var(--color-accent-strong)] transition-colors"
|
||||
>
|
||||
{t('footer.editors')}
|
||||
</Link>
|
||||
<span className="text-neutral-300">|</span>
|
||||
</p>
|
||||
<div className="flex flex-wrap items-center justify-center gap-2 sm:gap-4">
|
||||
<span className="flex items-center gap-2">
|
||||
<span>{t('footer.powered_by')}</span>
|
||||
<a
|
||||
@@ -36,9 +36,8 @@ export default function Footer() {
|
||||
/>
|
||||
</a>
|
||||
</span>
|
||||
<span className="text-neutral-300">|</span>
|
||||
<span className="flex items-center gap-1.5">
|
||||
<span>{t('footer.with_help')}</span>
|
||||
<span>{t('footer.in_partnership')}</span>
|
||||
<a
|
||||
href="https://www.instagram.com/paws.iin.harmony"
|
||||
target="_blank"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
import type { Report } from '@/domain/schema/report'
|
||||
import Brand from '@/components/brand/Brand'
|
||||
import LanguageSwitcher from '@/components/brand/LanguageSwitcher'
|
||||
import AppHeader from '@/components/brand/AppHeader'
|
||||
import Button from '@/components/ui/Button'
|
||||
import { formatDate } from '@/lib/dates'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
|
||||
export interface ReportHeaderProps {
|
||||
@@ -15,34 +12,20 @@ export interface ReportHeaderProps {
|
||||
|
||||
export default function ReportHeader({ report, onEditInfos }: ReportHeaderProps) {
|
||||
const t = useT()
|
||||
const cfg = useConfig()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
return (
|
||||
<header className="flex items-center justify-between gap-4 px-6 py-3 border-b border-[var(--color-border)] bg-[var(--color-surface)]">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<Link
|
||||
to="/"
|
||||
aria-label={t('common.back_to_home')}
|
||||
className="rounded-md px-1 py-0.5 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]"
|
||||
>
|
||||
<Brand />
|
||||
</Link>
|
||||
<span className="text-sm text-[var(--color-ink-muted)]">{cfg.tagline}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="text-sm text-right text-[var(--color-ink-muted)]">
|
||||
<div className="text-[var(--color-ink)] font-medium">
|
||||
{report.animal.name} · {report.owner.name}
|
||||
</div>
|
||||
<div>{formatDate(report.date, locale)}</div>
|
||||
<AppHeader>
|
||||
<div className="text-xs sm:text-sm text-right text-[var(--color-ink-muted)]">
|
||||
<div className="text-[var(--color-ink)] font-medium truncate max-w-[10rem] sm:max-w-none">
|
||||
{report.animal.name} · {report.owner.name}
|
||||
</div>
|
||||
{onEditInfos && (
|
||||
<Button variant="secondary" size="sm" onClick={onEditInfos}>
|
||||
{t('editor.edit_infos')}
|
||||
</Button>
|
||||
)}
|
||||
<LanguageSwitcher />
|
||||
<div className="hidden sm:block">{formatDate(report.date, locale)}</div>
|
||||
</div>
|
||||
</header>
|
||||
{onEditInfos && (
|
||||
<Button variant="secondary" size="sm" onClick={onEditInfos}>
|
||||
{t('editor.edit_infos')}
|
||||
</Button>
|
||||
)}
|
||||
</AppHeader>
|
||||
)
|
||||
}
|
||||
+1
-1
@@ -24,7 +24,7 @@ const DEFAULTS: AppConfig = {
|
||||
siteName: 'Faunosteo',
|
||||
brandName: 'Faunosteo',
|
||||
footerName: 'Faunosteo',
|
||||
tagline: "Bilans d'ostéopathie animalière",
|
||||
tagline: 'Outils pour ostéopathes animaliers',
|
||||
}
|
||||
|
||||
function resolveConfig(): AppConfig {
|
||||
|
||||
Reference in new issue
Block a user