ajuste em manifestacao de interesse organizacao

This commit is contained in:
2026-11-20 11:44:28 +02:00
parent f1db53fdbf
commit 40002db40f
2 changed files with 308 additions and 240 deletions
@@ -9,6 +9,7 @@ export default function CountrySelect({
label = 'País', label = 'País',
required = false, required = false,
error, error,
className,
}: { }: {
countries: Country[]; countries: Country[];
value: string; value: string;
@@ -19,6 +20,7 @@ export default function CountrySelect({
required?: boolean; required?: boolean;
allowLegacyValue?: boolean; allowLegacyValue?: boolean;
error?: string; error?: string;
className?: string;
}) { }) {
return ( return (
<CatalogueChoiceSelect <CatalogueChoiceSelect
@@ -34,6 +36,7 @@ export default function CountrySelect({
disabled={disabled} disabled={disabled}
required={required} required={required}
error={error} error={error}
className={className}
/> />
); );
} }
+114 -49
View File
@@ -96,23 +96,31 @@ function QueryStatus({
function TopBar({ function TopBar({
onNavigate, onNavigate,
requestCount, requestCount,
hideBrand = false,
}: { }: {
onNavigate: (view: View) => void; onNavigate: (view: View) => void;
requestCount: number; requestCount: number;
hideBrand?: boolean;
}) { }) {
return ( return (
<nav <nav
aria-label="Navegação das manifestações" aria-label="Navegação das manifestações"
className="sticky top-0 z-30 border-b border-slate-200 bg-white/95 backdrop-blur" className="sticky top-0 z-30 border-b border-slate-200 bg-white/95 backdrop-blur"
> >
<div className="mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-3 px-5 py-4"> <div
className={`mx-auto flex max-w-6xl flex-wrap items-center gap-3 px-5 py-4 ${hideBrand ? 'justify-end' : 'justify-between'}`}
>
{!hideBrand && (
<button <button
onClick={() => onNavigate('home')} onClick={() => onNavigate('home')}
className="flex items-baseline gap-1 font-black tracking-tight text-slate-900" className="flex items-baseline gap-1 font-black tracking-tight text-slate-900"
> >
<span className="text-lg">INVESTE</span> <span className="text-lg">INVESTE</span>
<span className="text-lg text-emerald-700">Moçambique</span> <span className="text-lg text-emerald-700">
Moçambique
</span>
</button> </button>
)}
<div className="flex items-center gap-3 text-xs text-slate-500"> <div className="flex items-center gap-3 text-xs text-slate-500">
<a href="/investidor/manifestacoes" className="underline"> <a href="/investidor/manifestacoes" className="underline">
@@ -123,12 +131,14 @@ function TopBar({
recebido recebido
{requestCount === 1 ? '' : 's'} {requestCount === 1 ? '' : 's'}
</span> </span>
{!hideBrand && (
<button <button
onClick={() => onNavigate('interest')} onClick={() => onNavigate('interest')}
className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700" className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700"
> >
Manifestar interesse Manifestar interesse
</button> </button>
)}
</div> </div>
</div> </div>
</nav> </nav>
@@ -528,6 +538,9 @@ function OpportunityDetail({
); );
} }
const interestControlClass =
'w-full rounded-xl border border-slate-300 bg-white px-3.5 py-3 text-sm text-slate-900 shadow-sm placeholder:text-slate-400 hover:border-slate-400 focus:border-[#ed1c24] focus:outline-none focus:ring-4 focus:ring-[#ed1c24]/10';
function InterestForm({ function InterestForm({
preselected, preselected,
onSubmitted, onSubmitted,
@@ -660,14 +673,17 @@ function InterestForm({
} }
return ( return (
<section className="mx-auto max-w-xl px-5 py-12"> <section className="mx-auto max-w-4xl px-5 py-10 sm:py-14">
<h1 className="text-3xl font-black text-slate-900"> <div className="overflow-hidden rounded-3xl bg-slate-50 p-5 shadow-xl ring-1 ring-black/5 sm:p-8 lg:p-10">
<div className="text-center">
<h1 className="text-2xl font-bold text-slate-950 sm:text-3xl">
Manifestar interesse Manifestar interesse
</h1> </h1>
<p className="mt-2 text-slate-600"> <p className="mt-2 text-slate-600">
Preencha os dados abaixo para que a equipa do portal possa Preencha os dados abaixo para que a equipa do portal
analisar o seu interesse e entrar em contacto. possa analisar o seu interesse e entrar em contacto.
</p> </p>
</div>
{preselected && ( {preselected && (
<div className="mt-5 rounded-xl border border-emerald-200 bg-emerald-50 p-4 text-sm text-emerald-900"> <div className="mt-5 rounded-xl border border-emerald-200 bg-emerald-50 p-4 text-sm text-emerald-900">
@@ -686,10 +702,17 @@ function InterestForm({
{submitError} {submitError}
</p> </p>
)} )}
<fieldset disabled={submitting} className="space-y-5"> <fieldset
<Field label="Nome completo" error={errors.name} required> disabled={submitting}
className="grid gap-5 sm:grid-cols-2"
>
<Field
label="Nome completo"
error={errors.name}
required
>
<input <input
className="input" className={interestControlClass}
value={form.name} value={form.name}
onChange={(e) => update('name', e.target.value)} onChange={(e) => update('name', e.target.value)}
/> />
@@ -698,17 +721,22 @@ function InterestForm({
<Field label="Email" error={errors.email} required> <Field label="Email" error={errors.email} required>
<input <input
type="email" type="email"
className="input" className={interestControlClass}
value={form.email} value={form.email}
onChange={(e) => update('email', e.target.value)} onChange={(e) =>
update('email', e.target.value)
}
/> />
</Field> </Field>
<Field label="Telefone" error={errors.phone}> <Field label="Telefone" error={errors.phone}>
<input <input
className="input" className={interestControlClass}
type="tel"
value={form.phone} value={form.phone}
onChange={(e) => update('phone', e.target.value)} onChange={(e) =>
update('phone', e.target.value)
}
/> />
</Field> </Field>
@@ -718,7 +746,7 @@ function InterestForm({
required required
> >
<select <select
className="input" className={interestControlClass}
value={form.investorType} value={form.investorType}
onChange={(e) => onChange={(e) =>
update('investorType', e.target.value) update('investorType', e.target.value)
@@ -729,7 +757,9 @@ function InterestForm({
Investidor individual Investidor individual
</option> </option>
<option value="empresa">Empresa</option> <option value="empresa">Empresa</option>
<option value="fundo">Fundo de investimento</option> <option value="fundo">
Fundo de investimento
</option>
<option value="entidade_publica"> <option value="entidade_publica">
Entidade pública Entidade pública
</option> </option>
@@ -737,10 +767,17 @@ function InterestForm({
</select> </select>
</Field> </Field>
<Field label="País" error={errors.country}> <Field
label="País"
error={errors.country}
required
htmlFor="interest-country"
>
<CountrySelect <CountrySelect
countries={countries} countries={countries}
label="País do requerente" label="País do requerente"
id="interest-country"
className={interestControlClass}
value={form.country} value={form.country}
onChange={(value) => update('country', value)} onChange={(value) => update('country', value)}
required required
@@ -750,17 +787,23 @@ function InterestForm({
<Field <Field
label="País de origem do pedido (opcional)" label="País de origem do pedido (opcional)"
htmlFor="interest-origin-country"
error={errors.declared_origin_country_code} error={errors.declared_origin_country_code}
> >
<CountrySelect <CountrySelect
countries={countries} countries={countries}
label="País de origem do pedido (opcional)" label="País de origem do pedido (opcional)"
id="interest-origin-country"
className={interestControlClass}
value={form.declared_origin_country_code ?? ''} value={form.declared_origin_country_code ?? ''}
onChange={(value) => onChange={(value) =>
update('declared_origin_country_code', value) update(
'declared_origin_country_code',
value,
)
} }
/> />
<p className="text-sm"> <p className="mt-2 text-sm font-normal text-slate-600">
País de onde apresenta este pedido. Pode ser País de onde apresenta este pedido. Pode ser
diferente do país do requerente. diferente do país do requerente.
</p> </p>
@@ -772,7 +815,7 @@ function InterestForm({
required required
> >
<select <select
className="input" className={interestControlClass}
value={form.sectorInterest} value={form.sectorInterest}
onChange={(e) => onChange={(e) =>
update('sectorInterest', e.target.value) update('sectorInterest', e.target.value)
@@ -813,14 +856,16 @@ function InterestForm({
error={errors.investmentRange} error={errors.investmentRange}
> >
<select <select
className="input" className={interestControlClass}
value={form.investmentRange} value={form.investmentRange}
onChange={(e) => onChange={(e) =>
update('investmentRange', e.target.value) update('investmentRange', e.target.value)
} }
> >
<option value="">Seleccione</option> <option value="">Seleccione</option>
<option value="ate-100000">Até USD 100.000</option> <option value="ate-100000">
Até USD 100.000
</option>
<option value="100000-500000"> <option value="100000-500000">
USD 100.000 – 500.000 USD 100.000 – 500.000
</option> </option>
@@ -833,37 +878,47 @@ function InterestForm({
</select> </select>
</Field> </Field>
<Field label="Mensagem" error={errors.message} required> <Field
label="Mensagem"
error={errors.message}
required
className="sm:col-span-2"
>
<textarea <textarea
rows={4} rows={4}
className="input" className={interestControlClass}
value={form.message} value={form.message}
onChange={(e) => update('message', e.target.value)} onChange={(e) =>
update('message', e.target.value)
}
placeholder="Descreva o seu interesse ou a informação pretendida." placeholder="Descreva o seu interesse ou a informação pretendida."
/> />
</Field> </Field>
<label className="flex items-start gap-3 text-sm text-slate-600"> <label className="flex items-start gap-3 rounded-xl border border-slate-200 bg-white p-4 text-sm leading-6 text-slate-700 sm:col-span-2">
<input <input
type="checkbox" type="checkbox"
checked={form.privacyConsent} checked={form.privacyConsent}
onChange={(e) => onChange={(e) =>
update('privacyConsent', e.target.checked) update('privacyConsent', e.target.checked)
} }
className="mt-1" className="mt-1.5 accent-[#ed1c24]"
/> />
Aceito que os meus dados sejam usados para efeitos de Aceito que os meus dados sejam usados para efeitos
contacto e análise da manifestação de interesse. de contacto e análise da manifestação de interesse.
</label> </label>
{errors.privacyConsent && ( {errors.privacyConsent && (
<p className="text-sm text-red-600"> <p
role="alert"
className="text-sm text-red-600 sm:col-span-2"
>
{errors.privacyConsent} {errors.privacyConsent}
</p> </p>
)} )}
<button <button
type="submit" type="submit"
className="w-full rounded-lg bg-slate-900 py-3 font-bold text-white hover:bg-slate-700" className="w-full rounded-xl bg-[#ed1c24] px-5 py-3 font-bold text-white transition-colors hover:bg-[#c8171e] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24] disabled:opacity-60 sm:col-span-2"
> >
{submitting {submitting
? 'A enviar...' ? 'A enviar...'
@@ -871,6 +926,7 @@ function InterestForm({
</button> </button>
</fieldset> </fieldset>
</form> </form>
</div>
</section> </section>
); );
} }
@@ -880,22 +936,41 @@ function Field({
required, required,
error, error,
children, children,
htmlFor,
className,
}: { }: {
label: string; label: string;
required?: boolean; required?: boolean;
error?: string; error?: string;
children: ReactNode; children: ReactNode;
htmlFor?: string;
className?: string;
}) { }) {
return ( return (
<div> <div className={className}>
<label className="block text-sm font-semibold text-slate-700"> {htmlFor ? (
<span className="mb-1 block"> <label
htmlFor={htmlFor}
className="mb-1.5 block text-xs font-bold text-slate-800"
>
{label}{' '}
{required && <span className="text-red-600">*</span>}
</label>
) : (
<label className="block text-xs font-bold text-slate-800">
<span className="mb-1.5 block">
{label}{' '} {label}{' '}
{required && <span className="text-red-600">*</span>} {required && <span className="text-red-600">*</span>}
</span> </span>
{children} {children}
</label> </label>
{error && <p className="mt-1 text-sm text-red-600">{error}</p>} )}
{htmlFor && children}
{error && (
<p role="alert" className="mt-1 text-sm text-red-600">
{error}
</p>
)}
</div> </div>
); );
} }
@@ -985,7 +1060,11 @@ export default function PortalInvestidorApp({
<SectorContext.Provider value={sectors}> <SectorContext.Provider value={sectors}>
<div className="min-h-screen bg-slate-50 font-sans text-slate-900"> <div className="min-h-screen bg-slate-50 font-sans text-slate-900">
{view !== 'home' && ( {view !== 'home' && (
<TopBar onNavigate={navigate} requestCount={requestCount} /> <TopBar
onNavigate={navigate}
requestCount={requestCount}
hideBrand={view === 'interest'}
/>
)} )}
<PortalMenu /> <PortalMenu />
<main> <main>
@@ -1234,20 +1313,6 @@ export default function PortalInvestidorApp({
)} )}
</main> </main>
<Footer /> <Footer />
<style>{`
.input {
width: 100%;
border: 1px solid #e2e8f0;
border-radius: 0.5rem;
padding: 0.6rem 0.75rem;
font-size: 0.9rem;
}
.input:focus {
outline: none;
box-shadow: 0 0 0 2px #10b981;
}
`}</style>
</div> </div>
</SectorContext.Provider> </SectorContext.Provider>
); );