melhorias de home 1

This commit is contained in:
2026-10-23 10:36:34 +02:00
parent f80d30f478
commit e2b0fb4b2d
13 changed files with 1135 additions and 114 deletions
+3 -111
View File
@@ -1,3 +1,4 @@
import PortalHero from '@/components/portal-hero';
import SearchState from '@/components/search-state';
import { useInterestDraft } from '@/hooks/use-interest-draft';
import { createContext, useContext, useRef, useState } from 'react';
@@ -30,14 +31,12 @@ import type {
Sector,
} from '@/lib/portal-api';
import {
Search,
Leaf,
Zap,
Hotel,
Truck,
Waves,
Banknote,
ArrowRight,
ArrowLeft,
MapPin,
CheckCircle2,
@@ -137,113 +136,6 @@ function TopBar({
);
}
function Hero({
query,
setQuery,
onSearch,
onNavigate,
stats,
}: {
query: string;
setQuery: (value: string) => void;
onSearch: (event: FormEvent<HTMLFormElement>) => void;
onNavigate: (view: View) => void;
stats?: HomeResponse['data']['stats'];
}) {
return (
<section className="border-b border-slate-200 bg-[#0B2038] text-white">
<div className="mx-auto grid max-w-6xl gap-10 px-5 py-16 md:py-24">
<div className="text-center">
<p className="text-4xl leading-tight font-black tracking-tight text-emerald-300 uppercase md:text-6xl">
INVISTA EM MOÇAMBIQUE
</p>
<h1 className="mx-auto mt-4 max-w-4xl text-4xl leading-[1.05] font-black tracking-tight md:text-5xl">
Transforme informação em decisões
<span className="text-amber-400">
{' '}
e ideias em negócios reais.
</span>
</h1>
<p className="mx-auto mt-6 max-w-3xl text-lg font-semibold text-slate-200">
Oportunidades reais de investimento em Moçambique,
organizadas por sector.
</p>
<p className="mx-auto mt-5 max-w-2xl text-slate-300">
Consulte projectos por província e estágio de
maturidade, compreenda os requisitos legais e fiscais, e
manifeste interesse directamente junto da entidade
promotora.
</p>
<div className="mt-8 flex flex-wrap justify-center gap-3">
<button
onClick={() => onNavigate('opportunities')}
className="inline-flex items-center gap-2 rounded-lg bg-amber-400 px-5 py-3 font-bold text-[#0B2038] hover:bg-amber-300"
>
Consultar oportunidades <ArrowRight size={16} />
</button>
<a
href="/simulador-fiscal"
className="rounded-lg border border-emerald-300 px-5 py-3 font-semibold text-emerald-100 hover:bg-emerald-900"
>
Planear finanças
</a>
</div>
</div>
<form
onSubmit={onSearch}
className="h-fit rounded-2xl border border-white/10 bg-white/10 p-5"
>
<label
htmlFor="portal-opportunity-search"
className="mb-2 block text-sm font-semibold text-slate-200"
>
Pesquisa rápida
</label>
<div className="flex gap-2">
<input
id="portal-opportunity-search"
type="search"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Ex.: agronegócio, Nampula, energia..."
className="w-full rounded-lg bg-white px-3 py-2.5 text-sm text-slate-900 ring-2 ring-transparent outline-none placeholder:text-slate-500 focus:ring-amber-400"
/>
<button
type="submit"
aria-label="Pesquisar oportunidades"
className="rounded-lg bg-amber-400 px-4 text-[#0B2038]"
>
<Search size={18} />
</button>
</div>
<div className="mt-4 flex flex-wrap gap-3 border-t border-white/10 pt-4 text-center text-xs text-slate-300">
<div>
<p className="text-xl font-black text-white">
{stats?.opportunities ?? '—'}
</p>
oportunidades
</div>
<div className="ml-auto">
<p className="text-xl font-black text-white">
{stats?.sectors ?? '—'}
</p>
sectores
</div>
<div className="ml-auto">
<p className="text-xl font-black text-white">
{stats?.provinces ?? '—'}
</p>
províncias
</div>
</div>
</form>
</div>
</section>
);
}
function SectorGrid({
onSelectSector,
}: {
@@ -1120,7 +1012,7 @@ export default function PortalInvestidorApp({
function handleHeroSearch(event: FormEvent<HTMLFormElement>) {
event.preventDefault();
router.get('/oportunidades', { q: heroQuery });
router.get('/oportunidades', { q: heroQuery.trim() });
}
function handleSelectSector(slug: string) {
@@ -1145,7 +1037,7 @@ export default function PortalInvestidorApp({
<main>
{view === 'home' && (
<>
<Hero
<PortalHero
query={heroQuery}
setQuery={setHeroQuery}
onSearch={handleHeroSearch}