Preservar a oportunidade durante o registo e preparacao do perfil
This commit is contained in:
@@ -32,6 +32,7 @@ export default function Entry({
|
||||
password_confirmation: '',
|
||||
portal_version: portal.version,
|
||||
notice_acknowledged: false,
|
||||
opportunity_id: null as number | null,
|
||||
});
|
||||
const credentials = (form: typeof login, prefix: string) => (
|
||||
<>
|
||||
@@ -114,9 +115,10 @@ export default function Entry({
|
||||
<a
|
||||
className="inline-block underline"
|
||||
href="#candidate-login"
|
||||
onClick={() =>
|
||||
login.setData('opportunity_id', item.id)
|
||||
}
|
||||
onClick={() => {
|
||||
login.setData('opportunity_id', item.id);
|
||||
register.setData('opportunity_id', item.id);
|
||||
}}
|
||||
>
|
||||
Entrar para preparar a candidatura
|
||||
</a>
|
||||
|
||||
@@ -18,6 +18,7 @@ export default function Profile({
|
||||
accessStatus,
|
||||
opportunities = [],
|
||||
opportunityPagination,
|
||||
selectedOpportunity,
|
||||
submissions = [],
|
||||
}: {
|
||||
companyId: number;
|
||||
@@ -28,6 +29,7 @@ export default function Profile({
|
||||
accessStatus?: string | null;
|
||||
opportunities?: { id: number; title: string; closes_on: string }[];
|
||||
opportunityPagination?: { prev: string | null; next: string | null };
|
||||
selectedOpportunity?: { id: number; title: string } | null;
|
||||
submissions?: { id: number; reference: string; created_at: string }[];
|
||||
}) {
|
||||
const form = useForm({
|
||||
@@ -41,6 +43,24 @@ export default function Profile({
|
||||
<>
|
||||
<Head title="O meu perfil" />
|
||||
<section className="mx-auto max-w-3xl space-y-3 p-6">
|
||||
{selectedOpportunity && (
|
||||
<aside className="space-y-2 rounded-lg border p-4">
|
||||
<h2 className="font-semibold">
|
||||
Oportunidade escolhida: {selectedOpportunity.title}
|
||||
</h2>
|
||||
<p>
|
||||
Prepare o perfil e confirme o email. A candidatura
|
||||
só será enviada quando confirmar a submissão no
|
||||
formulário.
|
||||
</p>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/candidaturas/${companyId}/oportunidades/${selectedOpportunity.id}`}
|
||||
>
|
||||
Continuar a preparar esta candidatura
|
||||
</Link>
|
||||
</aside>
|
||||
)}
|
||||
<h2 className="text-xl font-semibold">
|
||||
Oportunidades publicadas
|
||||
</h2>
|
||||
|
||||
Reference in New Issue
Block a user