@@ -1,6 +1,8 @@
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
import { createContext, useContext } from 'react';
|
||||
import { PortalGroupedMenu } from '@/components/portal-grouped-menu';
|
||||
import { TempoUiProvider } from '@/components/tempo-brand';
|
||||
import { TempoFooter } from '@/components/tempo-footer';
|
||||
import type { ReactNode } from 'react';
|
||||
import {
|
||||
NavigationContextProvider,
|
||||
@@ -99,80 +101,85 @@ export default function PortalNavigation({
|
||||
? 'Definições da conta'
|
||||
: 'Detalhes');
|
||||
return (
|
||||
<NavigationContextProvider>
|
||||
<MenuPlacement.Provider value={true}>
|
||||
<div
|
||||
className={`pb-8 lg:pb-24 [&_button]:scroll-mb-24 [&_input]:scroll-mb-24 [&_select]:scroll-mb-24 [&_textarea]:scroll-mb-24 ${printable ? 'print:pb-0' : ''}`}
|
||||
>
|
||||
<nav
|
||||
aria-label="Atalho para o conteúdo"
|
||||
className={printable ? 'print:hidden' : undefined}
|
||||
>
|
||||
<a
|
||||
href="#portal-content"
|
||||
className="sr-only focus:not-sr-only focus:block focus:bg-white focus:p-4 focus:text-emerald-900"
|
||||
<TempoUiProvider>
|
||||
<NavigationContextProvider>
|
||||
<MenuPlacement.Provider value={true}>
|
||||
<div className="min-h-screen [&_button]:scroll-mb-24 [&_input]:scroll-mb-24 [&_select]:scroll-mb-24 [&_textarea]:scroll-mb-24">
|
||||
<nav
|
||||
aria-label="Atalho para o conteúdo"
|
||||
className={printable ? 'print:hidden' : undefined}
|
||||
>
|
||||
Saltar para o conteúdo
|
||||
</a>
|
||||
</nav>
|
||||
{portalShell && (
|
||||
<div className={printable ? 'print:hidden' : undefined}>
|
||||
<PortalMenu primary />
|
||||
</div>
|
||||
)}
|
||||
<nav
|
||||
aria-label="Caminho de navegação"
|
||||
className={`bg-background text-foreground flex flex-wrap items-center gap-2 border-b px-5 py-3 text-sm ${printable ? 'print:hidden' : ''}`}
|
||||
>
|
||||
{path === '/' ? (
|
||||
<span aria-current="page">Início</span>
|
||||
) : (
|
||||
<>
|
||||
<Link href="/" className="underline">
|
||||
Início
|
||||
</Link>
|
||||
<span aria-hidden="true">/</span>
|
||||
{parent && (
|
||||
<>
|
||||
<Link
|
||||
href={parent}
|
||||
className="underline"
|
||||
>
|
||||
{names[parent]}
|
||||
</Link>
|
||||
<span aria-hidden="true">/</span>
|
||||
</>
|
||||
)}
|
||||
<span aria-current="page">{title}</span>
|
||||
</>
|
||||
)}
|
||||
</nav>
|
||||
<div id="portal-content" tabIndex={-1}>
|
||||
<a
|
||||
href="#portal-content"
|
||||
className="sr-only focus:not-sr-only focus:block focus:bg-white focus:p-4 focus:text-emerald-900"
|
||||
>
|
||||
Saltar para o conteúdo
|
||||
</a>
|
||||
</nav>
|
||||
{portalShell && (
|
||||
<div
|
||||
className={
|
||||
printable ? 'print:hidden' : undefined
|
||||
}
|
||||
>
|
||||
<NavigationContextSummary />
|
||||
<PortalMenu primary />
|
||||
</div>
|
||||
)}
|
||||
{children}
|
||||
</div>
|
||||
<aside
|
||||
aria-label="Contacto de apoio ao investidor"
|
||||
className={printable ? 'print:hidden' : undefined}
|
||||
>
|
||||
<a
|
||||
href="/apoio"
|
||||
className="mx-3 mt-4 block max-w-[calc(100%-1.5rem)] rounded-xl bg-emerald-800 px-5 py-3 text-center text-sm font-semibold text-white shadow-xl focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-emerald-600"
|
||||
{path !== '/' && (
|
||||
<nav
|
||||
aria-label="Caminho de navegação"
|
||||
className={`bg-background text-foreground flex flex-wrap items-center gap-2 border-b px-5 py-3 text-sm ${printable ? 'print:hidden' : ''}`}
|
||||
>
|
||||
<>
|
||||
<Link href="/" className="underline">
|
||||
Início
|
||||
</Link>
|
||||
<span aria-hidden="true">/</span>
|
||||
{parent && (
|
||||
<>
|
||||
<Link
|
||||
href={parent}
|
||||
className="underline"
|
||||
>
|
||||
{names[parent]}
|
||||
</Link>
|
||||
<span aria-hidden="true">/</span>
|
||||
</>
|
||||
)}
|
||||
<span aria-current="page">{title}</span>
|
||||
</>
|
||||
</nav>
|
||||
)}
|
||||
<div id="portal-content" tabIndex={-1}>
|
||||
{portalShell && (
|
||||
<div
|
||||
className={
|
||||
printable ? 'print:hidden' : undefined
|
||||
}
|
||||
>
|
||||
<NavigationContextSummary />
|
||||
</div>
|
||||
)}
|
||||
{children}
|
||||
</div>
|
||||
<aside
|
||||
aria-label="Contacto de apoio ao investidor"
|
||||
className={printable ? 'print:hidden' : undefined}
|
||||
>
|
||||
Contactar Apoio ao Investidor
|
||||
</a>
|
||||
</aside>
|
||||
</div>
|
||||
</MenuPlacement.Provider>
|
||||
</NavigationContextProvider>
|
||||
<a
|
||||
href="/apoio"
|
||||
className="mx-3 mt-4 block max-w-[calc(100%-1.5rem)] rounded-xl bg-emerald-800 px-5 py-3 text-center text-sm font-semibold text-white shadow-xl focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-emerald-600"
|
||||
>
|
||||
Contactar Apoio ao Investidor
|
||||
</a>
|
||||
</aside>
|
||||
<div className={printable ? 'print:hidden' : undefined}>
|
||||
<TempoFooter />
|
||||
</div>
|
||||
</div>
|
||||
</MenuPlacement.Provider>
|
||||
</NavigationContextProvider>
|
||||
</TempoUiProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user