@@ -0,0 +1,16 @@
|
||||
import AppLayoutTemplate from '@/layouts/app/app-sidebar-layout';
|
||||
import type { BreadcrumbItem } from '@/types';
|
||||
|
||||
export default function AppLayout({
|
||||
breadcrumbs = [],
|
||||
children,
|
||||
}: {
|
||||
breadcrumbs?: BreadcrumbItem[];
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<AppLayoutTemplate breadcrumbs={breadcrumbs}>
|
||||
{children}
|
||||
</AppLayoutTemplate>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { AppContent } from '@/components/app-content';
|
||||
import { AppHeader } from '@/components/app-header';
|
||||
import { AppShell } from '@/components/app-shell';
|
||||
import type { AppLayoutProps } from '@/types';
|
||||
|
||||
export default function AppHeaderLayout({
|
||||
children,
|
||||
breadcrumbs,
|
||||
}: AppLayoutProps) {
|
||||
return (
|
||||
<AppShell variant="header">
|
||||
<AppHeader breadcrumbs={breadcrumbs} />
|
||||
<AppContent variant="header">{children}</AppContent>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { AppContent } from '@/components/app-content';
|
||||
import { AppShell } from '@/components/app-shell';
|
||||
import { AppSidebar } from '@/components/app-sidebar';
|
||||
import { AppSidebarHeader } from '@/components/app-sidebar-header';
|
||||
import type { AppLayoutProps } from '@/types';
|
||||
|
||||
export default function AppSidebarLayout({
|
||||
children,
|
||||
breadcrumbs = [],
|
||||
}: AppLayoutProps) {
|
||||
return (
|
||||
<AppShell variant="sidebar">
|
||||
<AppSidebar />
|
||||
<AppContent variant="sidebar" className="min-w-0 overflow-x-clip">
|
||||
<AppSidebarHeader breadcrumbs={breadcrumbs} />
|
||||
{children}
|
||||
</AppContent>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import AuthLayoutTemplate from '@/layouts/auth/auth-simple-layout';
|
||||
|
||||
export default function AuthLayout({
|
||||
title = '',
|
||||
description = '',
|
||||
children,
|
||||
}: {
|
||||
title?: string;
|
||||
description?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<AuthLayoutTemplate title={title} description={description}>
|
||||
{children}
|
||||
</AuthLayoutTemplate>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import AppLogoIcon from '@/components/app-logo-icon';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { home } from '@/routes';
|
||||
|
||||
export default function AuthCardLayout({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
}: PropsWithChildren<{
|
||||
name?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}>) {
|
||||
return (
|
||||
<div className="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
||||
<div className="flex w-full max-w-md flex-col gap-6">
|
||||
<Link
|
||||
href={home()}
|
||||
className="flex items-center gap-2 self-center font-medium"
|
||||
>
|
||||
<div className="flex h-9 w-9 items-center justify-center">
|
||||
<AppLogoIcon className="size-9 fill-current text-black dark:text-white" />
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<div className="flex flex-col gap-6">
|
||||
<Card className="rounded-xl">
|
||||
<CardHeader className="px-10 pt-8 pb-0 text-center">
|
||||
<CardTitle className="text-xl">{title}</CardTitle>
|
||||
<CardDescription>{description}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="px-10 py-8">
|
||||
{children}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import AppLogoIcon from '@/components/app-logo-icon';
|
||||
import { home } from '@/routes';
|
||||
import type { AuthLayoutProps } from '@/types';
|
||||
|
||||
export default function AuthSimpleLayout({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
}: AuthLayoutProps) {
|
||||
return (
|
||||
<div className="bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
||||
<div className="w-full max-w-sm">
|
||||
<div className="flex flex-col gap-8">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<Link
|
||||
href={home()}
|
||||
className="flex flex-col items-center gap-2 font-medium"
|
||||
>
|
||||
<div className="mb-1 flex h-9 w-9 items-center justify-center rounded-md">
|
||||
<AppLogoIcon className="size-9 fill-current text-[var(--foreground)] dark:text-white" />
|
||||
</div>
|
||||
<span className="sr-only">{title}</span>
|
||||
</Link>
|
||||
|
||||
<div className="space-y-2 text-center">
|
||||
<h1 className="text-xl font-medium">{title}</h1>
|
||||
<p className="text-muted-foreground text-center text-sm">
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
import AppLogoIcon from '@/components/app-logo-icon';
|
||||
import { home } from '@/routes';
|
||||
import type { AuthLayoutProps } from '@/types';
|
||||
|
||||
export default function AuthSplitLayout({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
}: AuthLayoutProps) {
|
||||
const { name } = usePage().props;
|
||||
|
||||
return (
|
||||
<div className="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
|
||||
<div className="bg-muted relative hidden h-full flex-col p-10 text-white lg:flex dark:border-r">
|
||||
<div className="absolute inset-0 bg-zinc-900" />
|
||||
<Link
|
||||
href={home()}
|
||||
className="relative z-20 flex items-center text-lg font-medium"
|
||||
>
|
||||
<AppLogoIcon className="mr-2 size-8 fill-current text-white" />
|
||||
{name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="w-full lg:p-8">
|
||||
<div className="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]">
|
||||
<Link
|
||||
href={home()}
|
||||
className="relative z-20 flex items-center justify-center lg:hidden"
|
||||
>
|
||||
<AppLogoIcon className="h-10 fill-current text-black sm:h-12" />
|
||||
</Link>
|
||||
<div className="flex flex-col items-start gap-2 text-left sm:items-center sm:text-center">
|
||||
<h1 className="text-xl font-medium">{title}</h1>
|
||||
<p className="text-muted-foreground text-sm text-balance">
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
import { Link, usePage } from "@inertiajs/react";
|
||||
import { useId, useState } from "react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const portalLinks = [
|
||||
["/", "Início"],
|
||||
["/oportunidades", "Oportunidades de Investimento"],
|
||||
["/clusters", "Clusters"],
|
||||
["/corredores", "Corredores"],
|
||||
["/zonas", "ZEE, ZFI e parques"],
|
||||
["/projectos-ancora", "Projectos âncora"],
|
||||
["/educacao", "Educação"],
|
||||
["/sectores", "Sectores Prioritários"],
|
||||
["/como-investir", "Como Investir"],
|
||||
["/legislacao", "Legislação e Incentivos"],
|
||||
["/documentos", "Documentos e Formulários"],
|
||||
["/apoio", "Apoio ao Investidor"],
|
||||
] as const;
|
||||
const names: Record<string, string> = {
|
||||
...Object.fromEntries(portalLinks),
|
||||
"/parcerias": "Bolsa de Parcerias",
|
||||
"/simulador-fiscal": "Simulador Fiscal",
|
||||
"/balcao-virtual": "Balcão Virtual",
|
||||
"/investidor/manifestacoes": "Manifestações e favoritos",
|
||||
"/investidor/profile": "Perfil e empresas",
|
||||
"/investidor/notifications": "Notificações",
|
||||
"/management/investment/references": "Referências e formulários",
|
||||
"/management/investment/zones": "Gestão de ZEE, ZFI e parques",
|
||||
"/formularios/investidor": "Formulário de investidor",
|
||||
"/formularios/empresa": "Formulário de empresa",
|
||||
"/manifestar-interesse": "Manifestar interesse",
|
||||
"/carteira": "Corredores, clusters e projectos",
|
||||
"/investidor": "O meu painel",
|
||||
"/login": "Entrar",
|
||||
"/register": "Criar conta",
|
||||
"/dashboard": "Painel",
|
||||
"/acesso-gestao": "Acesso à gestão",
|
||||
"/management/portfolio": "Carteira de investimento",
|
||||
"/management/ai": "Assistência",
|
||||
"/management/interests": "Pedidos de interesse",
|
||||
"/management/portal-services": "Documentos e parcerias",
|
||||
};
|
||||
export default function PortalNavigation({ children }: { children: ReactNode }) {
|
||||
const { url, props } = usePage();
|
||||
const path = url.split("?")[0];
|
||||
const parent = Object.keys(names)
|
||||
.filter((p) => p !== "/" && path.startsWith(`${p}/`))
|
||||
.sort((a, b) => b.length - a.length)[0];
|
||||
const pageProps = props as {
|
||||
record?: { title?: string };
|
||||
sector?: { name?: string };
|
||||
initialOpportunity?: { title?: string };
|
||||
};
|
||||
const title =
|
||||
names[path] ??
|
||||
pageProps.record?.title ??
|
||||
pageProps.sector?.name ??
|
||||
pageProps.initialOpportunity?.title ??
|
||||
(path.includes("/edit")
|
||||
? "Editar registo"
|
||||
: path.startsWith("/management")
|
||||
? "Gestão do portal"
|
||||
: path.startsWith("/settings")
|
||||
? "Definições da conta"
|
||||
: "Detalhes");
|
||||
return (
|
||||
<div className="pb-24 [&_input]:scroll-mb-24 [&_select]:scroll-mb-24 [&_textarea]:scroll-mb-24 [&_button]:scroll-mb-24">
|
||||
<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
|
||||
aria-label="Caminho de navegação"
|
||||
className="flex flex-wrap items-center gap-2 border-b bg-background px-5 py-3 text-sm text-foreground"
|
||||
>
|
||||
{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}>
|
||||
{children}
|
||||
</div>
|
||||
<a
|
||||
href="/apoio"
|
||||
className="fixed right-3 bottom-3 z-50 max-w-[calc(100vw-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>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function PortalMenu() {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const menuId = useId();
|
||||
return (
|
||||
<nav
|
||||
aria-label="Áreas do portal"
|
||||
className="border-b bg-white px-5 py-4 text-sm text-slate-800"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-4 md:hidden">
|
||||
<Link href="/" className="font-bold">
|
||||
Portal do Investidor
|
||||
</Link>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-lg border px-3 py-2 font-semibold focus-visible:outline-2 focus-visible:outline-emerald-700"
|
||||
aria-expanded={expanded}
|
||||
aria-controls={menuId}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
>
|
||||
{expanded ? "Fechar menu" : "Abrir menu"}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id={menuId}
|
||||
className={`${expanded ? "flex" : "hidden"} mt-4 flex-wrap gap-x-5 gap-y-3 md:mt-0 md:flex`}
|
||||
>
|
||||
{portalLinks.map(([href, label]) => (
|
||||
<Link key={href} href={href} className="underline underline-offset-4">
|
||||
{label}
|
||||
</Link>
|
||||
))}
|
||||
<Link href="/parcerias" className="underline">
|
||||
Bolsa de Parcerias
|
||||
</Link>
|
||||
<Link href="/simulador-fiscal" className="underline">
|
||||
Simulador Fiscal
|
||||
</Link>
|
||||
<Link href="/balcao-virtual" className="underline">
|
||||
Balcão Virtual
|
||||
</Link>
|
||||
<Link href="/investidor/manifestacoes" className="underline">
|
||||
Área do investidor
|
||||
</Link>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import Heading from '@/components/heading';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { useCurrentUrl } from '@/hooks/use-current-url';
|
||||
import { cn, toUrl } from '@/lib/utils';
|
||||
import { edit as editAppearance } from '@/routes/appearance';
|
||||
import { edit } from '@/routes/profile';
|
||||
import { edit as editSecurity } from '@/routes/security';
|
||||
import type { NavItem } from '@/types';
|
||||
|
||||
const sidebarNavItems: NavItem[] = [
|
||||
{
|
||||
title: 'Profile',
|
||||
href: edit(),
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
title: 'Security',
|
||||
href: editSecurity(),
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
title: 'Appearance',
|
||||
href: editAppearance(),
|
||||
icon: null,
|
||||
},
|
||||
];
|
||||
|
||||
export default function SettingsLayout({ children }: PropsWithChildren) {
|
||||
const { isCurrentOrParentUrl } = useCurrentUrl();
|
||||
|
||||
return (
|
||||
<div className="px-4 py-6">
|
||||
<Heading
|
||||
title="Settings"
|
||||
description="Manage your profile and account settings"
|
||||
/>
|
||||
|
||||
<div className="flex flex-col lg:flex-row lg:space-x-12">
|
||||
<aside className="w-full max-w-xl lg:w-48">
|
||||
<nav
|
||||
className="flex flex-col space-y-1 space-x-0"
|
||||
aria-label="Settings"
|
||||
>
|
||||
{sidebarNavItems.map((item, index) => (
|
||||
<Button
|
||||
key={`${toUrl(item.href)}-${index}`}
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
asChild
|
||||
className={cn('w-full justify-start', {
|
||||
'bg-muted': isCurrentOrParentUrl(item.href),
|
||||
})}
|
||||
>
|
||||
<Link href={item.href}>
|
||||
{item.icon && (
|
||||
<item.icon className="h-4 w-4" />
|
||||
)}
|
||||
{item.title}
|
||||
</Link>
|
||||
</Button>
|
||||
))}
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<Separator className="my-6 lg:hidden" />
|
||||
|
||||
<div className="flex-1 md:max-w-2xl">
|
||||
<section className="max-w-xl space-y-12">
|
||||
{children}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user