fix(sf-fe): decode cad param (B5 400) + hide entry sidebar when drawer open #351
2 changed files with 25 additions and 18 deletions
|
|
@ -75,8 +75,13 @@ interface PageProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AnalysisPage({ params }: PageProps) {
|
export default function AnalysisPage({ params }: PageProps) {
|
||||||
// React 19: use() unwraps Promise params (app router pattern)
|
// React 19: use() unwraps Promise params (app router pattern).
|
||||||
const { cad } = use(params);
|
// Next.js delivers `cad` URL-encoded (":" -> "%3A"); decode once here so
|
||||||
|
// downstream hooks/components see the canonical "66:41:0204016:10" and can
|
||||||
|
// re-encode exactly once when building API URLs / hrefs (prevents double-
|
||||||
|
// encode that made backend regex reject the cad with HTTP 400).
|
||||||
|
const { cad: cadRaw } = use(params);
|
||||||
|
const cad = decodeURIComponent(cadRaw);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main
|
<main
|
||||||
|
|
|
||||||
|
|
@ -167,22 +167,24 @@ export default function SiteFinderPage() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right sidebar */}
|
{/* Right sidebar — hidden when ParcelDrawer is open to avoid overlap */}
|
||||||
<div
|
{selectedParcel == null && (
|
||||||
style={{
|
<div
|
||||||
width: 300,
|
style={{
|
||||||
flexShrink: 0,
|
width: 300,
|
||||||
padding: "16px 16px 16px 0",
|
flexShrink: 0,
|
||||||
display: "flex",
|
padding: "16px 16px 16px 0",
|
||||||
flexDirection: "column",
|
display: "flex",
|
||||||
gap: 12,
|
flexDirection: "column",
|
||||||
overflowY: "auto",
|
gap: 12,
|
||||||
}}
|
overflowY: "auto",
|
||||||
>
|
}}
|
||||||
<CadInput onSubmit={handleCadSubmit} loading={false} />
|
>
|
||||||
<RecentParcels />
|
<CadInput onSubmit={handleCadSubmit} loading={false} />
|
||||||
<ParcelLegend />
|
<RecentParcels />
|
||||||
</div>
|
<ParcelLegend />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Parcel drawer (slide-in from right) */}
|
{/* Parcel drawer (slide-in from right) */}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue