diff --git a/resources/js/components/country-select.tsx b/resources/js/components/country-select.tsx index 50732e4d..5b0c344b 100644 --- a/resources/js/components/country-select.tsx +++ b/resources/js/components/country-select.tsx @@ -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 ( ); } diff --git a/resources/js/pages/PortalInvestidor.tsx b/resources/js/pages/PortalInvestidor.tsx index 908a138a..f87677c6 100644 --- a/resources/js/pages/PortalInvestidor.tsx +++ b/resources/js/pages/PortalInvestidor.tsx @@ -96,23 +96,31 @@ function QueryStatus({ function TopBar({ onNavigate, requestCount, + hideBrand = false, }: { onNavigate: (view: View) => void; requestCount: number; + hideBrand?: boolean; }) { return ( - - onNavigate('home')} - className="flex items-baseline gap-1 font-black tracking-tight text-slate-900" - > - INVESTE - Moçambique - + + {!hideBrand && ( + onNavigate('home')} + className="flex items-baseline gap-1 font-black tracking-tight text-slate-900" + > + INVESTE + + Moçambique + + + )} @@ -123,12 +131,14 @@ function TopBar({ recebido {requestCount === 1 ? '' : 's'} - onNavigate('interest')} - className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700" - > - Manifestar interesse - + {!hideBrand && ( + onNavigate('interest')} + className="rounded-lg bg-slate-900 px-4 py-2 text-sm font-bold text-white hover:bg-slate-700" + > + Manifestar interesse + + )} @@ -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 ( - - - Manifestar interesse - - - Preencha os dados abaixo para que a equipa do portal possa - analisar o seu interesse e entrar em contacto. - - - {preselected && ( - - Oportunidade seleccionada:{' '} - {preselected.title} ( - {preselected.reference}) - - )} - - - {submitError && ( - - {submitError} + + + + + Manifestar interesse + + + Preencha os dados abaixo para que a equipa do portal + possa analisar o seu interesse e entrar em contacto. + + + {preselected && ( + + Oportunidade seleccionada:{' '} + {preselected.title} ( + {preselected.reference}) + )} - - - update('name', e.target.value)} - /> - - - update('email', e.target.value)} - /> - - - - update('phone', e.target.value)} - /> - - - - - update('investorType', e.target.value) - } + + {submitError && ( + - Seleccione - - Investidor individual - - Empresa - Fundo de investimento - - Entidade pública - - Outro - - - - - update('country', value)} - required - allowLegacyValue - /> - - - - - update('declared_origin_country_code', value) - } - /> - - País de onde apresenta este pedido. Pode ser - diferente do país do requerente. - - - - - - update('sectorInterest', e.target.value) - } - > - Seleccione - {form.sectorInterest && - !sectors.some( - (sector) => - sector.name === form.sectorInterest, - ) && ( - - {form.sectorInterest} - - )} - {sectors - .flatMap((s) => [ - s, - ...(s.specializations ?? []).map( - (child) => ({ - ...s, - slug: child.slug, - name: child.name, - specializations: [], - }), - ), - ]) - .map((s) => ( - - {s.name} - - ))} - - - - - - update('investmentRange', e.target.value) - } - > - Seleccione - Até USD 100.000 - - USD 100.000 – 500.000 - - - USD 500.000 – 1.000.000 - - - Acima de USD 1.000.000 - - - - - - update('message', e.target.value)} - placeholder="Descreva o seu interesse ou a informação pretendida." - /> - - - - - 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. - - {errors.privacyConsent && ( - - {errors.privacyConsent} + {submitError} )} - - - {submitting - ? 'A enviar...' - : 'Enviar manifestação de interesse'} - - - + + update('name', e.target.value)} + /> + + + + + update('email', e.target.value) + } + /> + + + + + update('phone', e.target.value) + } + /> + + + + + update('investorType', e.target.value) + } + > + Seleccione + + Investidor individual + + Empresa + + Fundo de investimento + + + Entidade pública + + Outro + + + + + update('country', value)} + required + allowLegacyValue + /> + + + + + update( + 'declared_origin_country_code', + value, + ) + } + /> + + País de onde apresenta este pedido. Pode ser + diferente do país do requerente. + + + + + + update('sectorInterest', e.target.value) + } + > + Seleccione + {form.sectorInterest && + !sectors.some( + (sector) => + sector.name === form.sectorInterest, + ) && ( + + {form.sectorInterest} + + )} + {sectors + .flatMap((s) => [ + s, + ...(s.specializations ?? []).map( + (child) => ({ + ...s, + slug: child.slug, + name: child.name, + specializations: [], + }), + ), + ]) + .map((s) => ( + + {s.name} + + ))} + + + + + + update('investmentRange', e.target.value) + } + > + Seleccione + + Até USD 100.000 + + + USD 100.000 – 500.000 + + + USD 500.000 – 1.000.000 + + + Acima de USD 1.000.000 + + + + + + + update('message', e.target.value) + } + placeholder="Descreva o seu interesse ou a informação pretendida." + /> + + + + + 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. + + {errors.privacyConsent && ( + + {errors.privacyConsent} + + )} + + + {submitting + ? 'A enviar...' + : 'Enviar manifestação de interesse'} + + + + ); } @@ -880,22 +936,41 @@ function Field({ required, error, children, + htmlFor, + className, }: { label: string; required?: boolean; error?: string; children: ReactNode; + htmlFor?: string; + className?: string; }) { return ( - - - + + {htmlFor ? ( + {label}{' '} {required && *} - - {children} - - {error && {error}} + + ) : ( + + + {label}{' '} + {required && *} + + {children} + + )} + {htmlFor && children} + {error && ( + + {error} + + )} ); } @@ -985,7 +1060,11 @@ export default function PortalInvestidorApp({ {view !== 'home' && ( - + )} @@ -1234,20 +1313,6 @@ export default function PortalInvestidorApp({ )} - - );
- Preencha os dados abaixo para que a equipa do portal possa - analisar o seu interesse e entrar em contacto. -
- {submitError} + + + + + Manifestar interesse + + + Preencha os dados abaixo para que a equipa do portal + possa analisar o seu interesse e entrar em contacto. + + + {preselected && ( + + Oportunidade seleccionada:{' '} + {preselected.title} ( + {preselected.reference}) + )} - - - update('name', e.target.value)} - /> - - - update('email', e.target.value)} - /> - - - - update('phone', e.target.value)} - /> - - - - - update('investorType', e.target.value) - } + + {submitError && ( + - Seleccione - - Investidor individual - - Empresa - Fundo de investimento - - Entidade pública - - Outro - - - - - update('country', value)} - required - allowLegacyValue - /> - - - - - update('declared_origin_country_code', value) - } - /> - - País de onde apresenta este pedido. Pode ser - diferente do país do requerente. - - - - - - update('sectorInterest', e.target.value) - } - > - Seleccione - {form.sectorInterest && - !sectors.some( - (sector) => - sector.name === form.sectorInterest, - ) && ( - - {form.sectorInterest} - - )} - {sectors - .flatMap((s) => [ - s, - ...(s.specializations ?? []).map( - (child) => ({ - ...s, - slug: child.slug, - name: child.name, - specializations: [], - }), - ), - ]) - .map((s) => ( - - {s.name} - - ))} - - - - - - update('investmentRange', e.target.value) - } - > - Seleccione - Até USD 100.000 - - USD 100.000 – 500.000 - - - USD 500.000 – 1.000.000 - - - Acima de USD 1.000.000 - - - - - - update('message', e.target.value)} - placeholder="Descreva o seu interesse ou a informação pretendida." - /> - - - - - 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. - - {errors.privacyConsent && ( - - {errors.privacyConsent} + {submitError} )} - - - {submitting - ? 'A enviar...' - : 'Enviar manifestação de interesse'} - - - + + update('name', e.target.value)} + /> + + + + + update('email', e.target.value) + } + /> + + + + + update('phone', e.target.value) + } + /> + + + + + update('investorType', e.target.value) + } + > + Seleccione + + Investidor individual + + Empresa + + Fundo de investimento + + + Entidade pública + + Outro + + + + + update('country', value)} + required + allowLegacyValue + /> + + + + + update( + 'declared_origin_country_code', + value, + ) + } + /> + + País de onde apresenta este pedido. Pode ser + diferente do país do requerente. + + + + + + update('sectorInterest', e.target.value) + } + > + Seleccione + {form.sectorInterest && + !sectors.some( + (sector) => + sector.name === form.sectorInterest, + ) && ( + + {form.sectorInterest} + + )} + {sectors + .flatMap((s) => [ + s, + ...(s.specializations ?? []).map( + (child) => ({ + ...s, + slug: child.slug, + name: child.name, + specializations: [], + }), + ), + ]) + .map((s) => ( + + {s.name} + + ))} + + + + + + update('investmentRange', e.target.value) + } + > + Seleccione + + Até USD 100.000 + + + USD 100.000 – 500.000 + + + USD 500.000 – 1.000.000 + + + Acima de USD 1.000.000 + + + + + + + update('message', e.target.value) + } + placeholder="Descreva o seu interesse ou a informação pretendida." + /> + + + + + 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. + + {errors.privacyConsent && ( + + {errors.privacyConsent} + + )} + + + {submitting + ? 'A enviar...' + : 'Enviar manifestação de interesse'} + + + + ); } @@ -880,22 +936,41 @@ function Field({ required, error, children, + htmlFor, + className, }: { label: string; required?: boolean; error?: string; children: ReactNode; + htmlFor?: string; + className?: string; }) { return ( -
+ Preencha os dados abaixo para que a equipa do portal + possa analisar o seu interesse e entrar em contacto.
- Seleccione - - Investidor individual - - Empresa - Fundo de investimento - - Entidade pública - - Outro -
- País de onde apresenta este pedido. Pode ser - diferente do país do requerente. -
- {errors.privacyConsent} + {submitError}
+ País de onde apresenta este pedido. Pode ser + diferente do país do requerente. +
+ {errors.privacyConsent} +
{error}
+ {error} +