fix(editor): hide footer on SVG editor, contain SVG to viewport

Extract AppShell with useLocation to conditionally hide Footer on
/svg-editor. Add max-height: 100% + width: auto to SVG canvas CSS
so loaded SVGs fill available space without overflowing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastien ChanotandClaude Opus 4.6 committed 2026-05-22 03:10:51 +02:00
1 parent ce84caea04
commit 9e60131de7
2 files changed
+22 -13

No files matched your search

+20 -13
View File
@@ -1,4 +1,4 @@
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom'
import { ConfigProvider } from './providers/ConfigProvider'
import Footer from '@/components/brand/Footer'
import HomeRoute from './routes/HomeRoute'
@@ -7,22 +7,29 @@ import EditorRoute from './routes/EditorRoute'
import SvgEditorRoute from './routes/SvgEditorRoute'
import NotFoundRoute from './routes/NotFoundRoute'
function AppShell() {
const hideFooter = useLocation().pathname === '/svg-editor'
return (
<div className="flex min-h-screen flex-col">
<main className="flex-1">
<Routes>
<Route path="/" element={<HomeRoute />} />
<Route path="/new" element={<NewReportRoute />} />
<Route path="/editor" element={<EditorRoute />} />
<Route path="/svg-editor" element={<SvgEditorRoute />} />
<Route path="*" element={<NotFoundRoute />} />
</Routes>
</main>
{!hideFooter && <Footer />}
</div>
)
}
export default function App() {
return (
<ConfigProvider>
<BrowserRouter>
<div className="flex min-h-screen flex-col">
<main className="flex-1">
<Routes>
<Route path="/" element={<HomeRoute />} />
<Route path="/new" element={<NewReportRoute />} />
<Route path="/editor" element={<EditorRoute />} />
<Route path="/svg-editor" element={<SvgEditorRoute />} />
<Route path="*" element={<NotFoundRoute />} />
</Routes>
</main>
<Footer />
</div>
<AppShell />
</BrowserRouter>
</ConfigProvider>
)
+2
View File
@@ -25,6 +25,8 @@
.svg-editor-canvas-inner svg {
display: block;
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}