ajuste em manifestacao de interesse organizacao
This commit is contained in:
@@ -9,6 +9,7 @@ export default function CountrySelect({
|
||||
label = 'País',
|
||||
required = false,
|
||||
error,
|
||||
className,
|
||||
}: {
|
||||
countries: Country[];
|
||||
value: string;
|
||||
@@ -19,6 +20,7 @@ export default function CountrySelect({
|
||||
required?: boolean;
|
||||
allowLegacyValue?: boolean;
|
||||
error?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<CatalogueChoiceSelect
|
||||
@@ -34,6 +36,7 @@ export default function CountrySelect({
|
||||
disabled={disabled}
|
||||
required={required}
|
||||
error={error}
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,23 +96,31 @@ function QueryStatus({
|
||||
function TopBar({
|
||||
onNavigate,
|
||||
requestCount,
|
||||
hideBrand = false,
|
||||
}: {
|
||||
onNavigate: (view: View) => void;
|
||||
requestCount: number;
|
||||
hideBrand?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<nav
|
||||
aria-label="Navegação das manifestações"
|
||||
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">
|
||||
<button
|
||||
onClick={() => onNavigate('home')}
|
||||
className="flex items-baseline gap-1 font-black tracking-tight text-slate-900"
|
||||
>
|
||||
<span className="text-lg">INVESTE</span>
|
||||
<span className="text-lg text-emerald-700">Moçambique</span>
|
||||
</button>
|
||||
<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
|
||||
onClick={() => onNavigate('home')}
|
||||
className="flex items-baseline gap-1 font-black tracking-tight text-slate-900"
|
||||
>
|
||||
<span className="text-lg">INVESTE</span>
|
||||
<span className="text-lg text-emerald-700">
|
||||
Moçambique
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-3 text-xs text-slate-500">
|
||||
<a href="/investidor/manifestacoes" className="underline">
|
||||
@@ -123,12 +131,14 @@ function TopBar({
|
||||
recebido
|
||||
{requestCount === 1 ? '' : 's'}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => onNavigate('interest')}
|
||||
className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700"
|
||||
>
|
||||
Manifestar interesse
|
||||
</button>
|
||||
{!hideBrand && (
|
||||
<button
|
||||
onClick={() => onNavigate('interest')}
|
||||
className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700"
|
||||
>
|
||||
Manifestar interesse
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</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({
|
||||
preselected,
|
||||
onSubmitted,
|
||||
@@ -660,217 +673,260 @@ function InterestForm({
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="mx-auto max-w-xl px-5 py-12">
|
||||
<h1 className="text-3xl font-black text-slate-900">
|
||||
Manifestar interesse
|
||||
</h1>
|
||||
<p className="mt-2 text-slate-600">
|
||||
Preencha os dados abaixo para que a equipa do portal possa
|
||||
analisar o seu interesse e entrar em contacto.
|
||||
</p>
|
||||
|
||||
{preselected && (
|
||||
<div className="mt-5 rounded-xl border border-emerald-200 bg-emerald-50 p-4 text-sm text-emerald-900">
|
||||
Oportunidade seleccionada:{' '}
|
||||
<strong>{preselected.title}</strong> (
|
||||
{preselected.reference})
|
||||
</div>
|
||||
)}
|
||||
|
||||
<form onSubmit={handleSubmit} className="mt-6">
|
||||
{submitError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="mb-5 rounded-lg bg-red-50 p-3 text-sm text-red-700"
|
||||
>
|
||||
{submitError}
|
||||
<section className="mx-auto max-w-4xl px-5 py-10 sm:py-14">
|
||||
<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
|
||||
</h1>
|
||||
<p className="mt-2 text-slate-600">
|
||||
Preencha os dados abaixo para que a equipa do portal
|
||||
possa analisar o seu interesse e entrar em contacto.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{preselected && (
|
||||
<div className="mt-5 rounded-xl border border-emerald-200 bg-emerald-50 p-4 text-sm text-emerald-900">
|
||||
Oportunidade seleccionada:{' '}
|
||||
<strong>{preselected.title}</strong> (
|
||||
{preselected.reference})
|
||||
</div>
|
||||
)}
|
||||
<fieldset disabled={submitting} className="space-y-5">
|
||||
<Field label="Nome completo" error={errors.name} required>
|
||||
<input
|
||||
className="input"
|
||||
value={form.name}
|
||||
onChange={(e) => update('name', e.target.value)}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Email" error={errors.email} required>
|
||||
<input
|
||||
type="email"
|
||||
className="input"
|
||||
value={form.email}
|
||||
onChange={(e) => update('email', e.target.value)}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Telefone" error={errors.phone}>
|
||||
<input
|
||||
className="input"
|
||||
value={form.phone}
|
||||
onChange={(e) => update('phone', e.target.value)}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Tipo de investidor"
|
||||
error={errors.investorType}
|
||||
required
|
||||
>
|
||||
<select
|
||||
className="input"
|
||||
value={form.investorType}
|
||||
onChange={(e) =>
|
||||
update('investorType', e.target.value)
|
||||
}
|
||||
<form onSubmit={handleSubmit} className="mt-6">
|
||||
{submitError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="mb-5 rounded-lg bg-red-50 p-3 text-sm text-red-700"
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
<option value="individual">
|
||||
Investidor individual
|
||||
</option>
|
||||
<option value="empresa">Empresa</option>
|
||||
<option value="fundo">Fundo de investimento</option>
|
||||
<option value="entidade_publica">
|
||||
Entidade pública
|
||||
</option>
|
||||
<option value="outro">Outro</option>
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field label="País" error={errors.country}>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
label="País do requerente"
|
||||
value={form.country}
|
||||
onChange={(value) => update('country', value)}
|
||||
required
|
||||
allowLegacyValue
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="País de origem do pedido (opcional)"
|
||||
error={errors.declared_origin_country_code}
|
||||
>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
label="País de origem do pedido (opcional)"
|
||||
value={form.declared_origin_country_code ?? ''}
|
||||
onChange={(value) =>
|
||||
update('declared_origin_country_code', value)
|
||||
}
|
||||
/>
|
||||
<p className="text-sm">
|
||||
País de onde apresenta este pedido. Pode ser
|
||||
diferente do país do requerente.
|
||||
</p>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Sector de interesse"
|
||||
error={errors.sectorInterest}
|
||||
required
|
||||
>
|
||||
<select
|
||||
className="input"
|
||||
value={form.sectorInterest}
|
||||
onChange={(e) =>
|
||||
update('sectorInterest', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
{form.sectorInterest &&
|
||||
!sectors.some(
|
||||
(sector) =>
|
||||
sector.name === form.sectorInterest,
|
||||
) && (
|
||||
<option value={form.sectorInterest}>
|
||||
{form.sectorInterest}
|
||||
</option>
|
||||
)}
|
||||
{sectors
|
||||
.flatMap((s) => [
|
||||
s,
|
||||
...(s.specializations ?? []).map(
|
||||
(child) => ({
|
||||
...s,
|
||||
slug: child.slug,
|
||||
name: child.name,
|
||||
specializations: [],
|
||||
}),
|
||||
),
|
||||
])
|
||||
.map((s) => (
|
||||
<option key={s.slug} value={s.name}>
|
||||
{s.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Faixa de investimento"
|
||||
error={errors.investmentRange}
|
||||
>
|
||||
<select
|
||||
className="input"
|
||||
value={form.investmentRange}
|
||||
onChange={(e) =>
|
||||
update('investmentRange', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
<option value="ate-100000">Até USD 100.000</option>
|
||||
<option value="100000-500000">
|
||||
USD 100.000 – 500.000
|
||||
</option>
|
||||
<option value="500000-1000000">
|
||||
USD 500.000 – 1.000.000
|
||||
</option>
|
||||
<option value="acima-1000000">
|
||||
Acima de USD 1.000.000
|
||||
</option>
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field label="Mensagem" error={errors.message} required>
|
||||
<textarea
|
||||
rows={4}
|
||||
className="input"
|
||||
value={form.message}
|
||||
onChange={(e) => update('message', e.target.value)}
|
||||
placeholder="Descreva o seu interesse ou a informação pretendida."
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<label className="flex items-start gap-3 text-sm text-slate-600">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={form.privacyConsent}
|
||||
onChange={(e) =>
|
||||
update('privacyConsent', e.target.checked)
|
||||
}
|
||||
className="mt-1"
|
||||
/>
|
||||
Aceito que os meus dados sejam usados para efeitos de
|
||||
contacto e análise da manifestação de interesse.
|
||||
</label>
|
||||
{errors.privacyConsent && (
|
||||
<p className="text-sm text-red-600">
|
||||
{errors.privacyConsent}
|
||||
{submitError}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full rounded-lg bg-slate-900 py-3 font-bold text-white hover:bg-slate-700"
|
||||
<fieldset
|
||||
disabled={submitting}
|
||||
className="grid gap-5 sm:grid-cols-2"
|
||||
>
|
||||
{submitting
|
||||
? 'A enviar...'
|
||||
: 'Enviar manifestação de interesse'}
|
||||
</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<Field
|
||||
label="Nome completo"
|
||||
error={errors.name}
|
||||
required
|
||||
>
|
||||
<input
|
||||
className={interestControlClass}
|
||||
value={form.name}
|
||||
onChange={(e) => update('name', e.target.value)}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Email" error={errors.email} required>
|
||||
<input
|
||||
type="email"
|
||||
className={interestControlClass}
|
||||
value={form.email}
|
||||
onChange={(e) =>
|
||||
update('email', e.target.value)
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Telefone" error={errors.phone}>
|
||||
<input
|
||||
className={interestControlClass}
|
||||
type="tel"
|
||||
value={form.phone}
|
||||
onChange={(e) =>
|
||||
update('phone', e.target.value)
|
||||
}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Tipo de investidor"
|
||||
error={errors.investorType}
|
||||
required
|
||||
>
|
||||
<select
|
||||
className={interestControlClass}
|
||||
value={form.investorType}
|
||||
onChange={(e) =>
|
||||
update('investorType', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
<option value="individual">
|
||||
Investidor individual
|
||||
</option>
|
||||
<option value="empresa">Empresa</option>
|
||||
<option value="fundo">
|
||||
Fundo de investimento
|
||||
</option>
|
||||
<option value="entidade_publica">
|
||||
Entidade pública
|
||||
</option>
|
||||
<option value="outro">Outro</option>
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="País"
|
||||
error={errors.country}
|
||||
required
|
||||
htmlFor="interest-country"
|
||||
>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
label="País do requerente"
|
||||
id="interest-country"
|
||||
className={interestControlClass}
|
||||
value={form.country}
|
||||
onChange={(value) => update('country', value)}
|
||||
required
|
||||
allowLegacyValue
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="País de origem do pedido (opcional)"
|
||||
htmlFor="interest-origin-country"
|
||||
error={errors.declared_origin_country_code}
|
||||
>
|
||||
<CountrySelect
|
||||
countries={countries}
|
||||
label="País de origem do pedido (opcional)"
|
||||
id="interest-origin-country"
|
||||
className={interestControlClass}
|
||||
value={form.declared_origin_country_code ?? ''}
|
||||
onChange={(value) =>
|
||||
update(
|
||||
'declared_origin_country_code',
|
||||
value,
|
||||
)
|
||||
}
|
||||
/>
|
||||
<p className="mt-2 text-sm font-normal text-slate-600">
|
||||
País de onde apresenta este pedido. Pode ser
|
||||
diferente do país do requerente.
|
||||
</p>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Sector de interesse"
|
||||
error={errors.sectorInterest}
|
||||
required
|
||||
>
|
||||
<select
|
||||
className={interestControlClass}
|
||||
value={form.sectorInterest}
|
||||
onChange={(e) =>
|
||||
update('sectorInterest', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
{form.sectorInterest &&
|
||||
!sectors.some(
|
||||
(sector) =>
|
||||
sector.name === form.sectorInterest,
|
||||
) && (
|
||||
<option value={form.sectorInterest}>
|
||||
{form.sectorInterest}
|
||||
</option>
|
||||
)}
|
||||
{sectors
|
||||
.flatMap((s) => [
|
||||
s,
|
||||
...(s.specializations ?? []).map(
|
||||
(child) => ({
|
||||
...s,
|
||||
slug: child.slug,
|
||||
name: child.name,
|
||||
specializations: [],
|
||||
}),
|
||||
),
|
||||
])
|
||||
.map((s) => (
|
||||
<option key={s.slug} value={s.name}>
|
||||
{s.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Faixa de investimento"
|
||||
error={errors.investmentRange}
|
||||
>
|
||||
<select
|
||||
className={interestControlClass}
|
||||
value={form.investmentRange}
|
||||
onChange={(e) =>
|
||||
update('investmentRange', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Seleccione</option>
|
||||
<option value="ate-100000">
|
||||
Até USD 100.000
|
||||
</option>
|
||||
<option value="100000-500000">
|
||||
USD 100.000 – 500.000
|
||||
</option>
|
||||
<option value="500000-1000000">
|
||||
USD 500.000 – 1.000.000
|
||||
</option>
|
||||
<option value="acima-1000000">
|
||||
Acima de USD 1.000.000
|
||||
</option>
|
||||
</select>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Mensagem"
|
||||
error={errors.message}
|
||||
required
|
||||
className="sm:col-span-2"
|
||||
>
|
||||
<textarea
|
||||
rows={4}
|
||||
className={interestControlClass}
|
||||
value={form.message}
|
||||
onChange={(e) =>
|
||||
update('message', e.target.value)
|
||||
}
|
||||
placeholder="Descreva o seu interesse ou a informação pretendida."
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<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
|
||||
type="checkbox"
|
||||
checked={form.privacyConsent}
|
||||
onChange={(e) =>
|
||||
update('privacyConsent', e.target.checked)
|
||||
}
|
||||
className="mt-1.5 accent-[#ed1c24]"
|
||||
/>
|
||||
Aceito que os meus dados sejam usados para efeitos
|
||||
de contacto e análise da manifestação de interesse.
|
||||
</label>
|
||||
{errors.privacyConsent && (
|
||||
<p
|
||||
role="alert"
|
||||
className="text-sm text-red-600 sm:col-span-2"
|
||||
>
|
||||
{errors.privacyConsent}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
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
|
||||
? 'A enviar...'
|
||||
: 'Enviar manifestação de interesse'}
|
||||
</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -880,22 +936,41 @@ function Field({
|
||||
required,
|
||||
error,
|
||||
children,
|
||||
htmlFor,
|
||||
className,
|
||||
}: {
|
||||
label: string;
|
||||
required?: boolean;
|
||||
error?: string;
|
||||
children: ReactNode;
|
||||
htmlFor?: string;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<label className="block text-sm font-semibold text-slate-700">
|
||||
<span className="mb-1 block">
|
||||
<div className={className}>
|
||||
{htmlFor ? (
|
||||
<label
|
||||
htmlFor={htmlFor}
|
||||
className="mb-1.5 block text-xs font-bold text-slate-800"
|
||||
>
|
||||
{label}{' '}
|
||||
{required && <span className="text-red-600">*</span>}
|
||||
</span>
|
||||
{children}
|
||||
</label>
|
||||
{error && <p className="mt-1 text-sm text-red-600">{error}</p>}
|
||||
</label>
|
||||
) : (
|
||||
<label className="block text-xs font-bold text-slate-800">
|
||||
<span className="mb-1.5 block">
|
||||
{label}{' '}
|
||||
{required && <span className="text-red-600">*</span>}
|
||||
</span>
|
||||
{children}
|
||||
</label>
|
||||
)}
|
||||
{htmlFor && children}
|
||||
{error && (
|
||||
<p role="alert" className="mt-1 text-sm text-red-600">
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -985,7 +1060,11 @@ export default function PortalInvestidorApp({
|
||||
<SectorContext.Provider value={sectors}>
|
||||
<div className="min-h-screen bg-slate-50 font-sans text-slate-900">
|
||||
{view !== 'home' && (
|
||||
<TopBar onNavigate={navigate} requestCount={requestCount} />
|
||||
<TopBar
|
||||
onNavigate={navigate}
|
||||
requestCount={requestCount}
|
||||
hideBrand={view === 'interest'}
|
||||
/>
|
||||
)}
|
||||
<PortalMenu />
|
||||
<main>
|
||||
@@ -1234,20 +1313,6 @@ export default function PortalInvestidorApp({
|
||||
)}
|
||||
</main>
|
||||
<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>
|
||||
</SectorContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user