Merge pull request #73 from rede5/codex/verificar-idioma-na-pagina-de-empregos
Codex-generated pull request
This commit is contained in:
commit
ae4dcb4b90
1 changed files with 12 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Search } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
|
|
@ -140,7 +140,7 @@ export default function PostJobPage() {
|
|||
currency: "USD",
|
||||
salaryPeriod: "monthly",
|
||||
description: "",
|
||||
descriptionLanguage: "",
|
||||
descriptionLanguage: locale,
|
||||
applicationChannel: "email" as ApplicationChannel,
|
||||
applicationEmail: "",
|
||||
applicationUrl: "",
|
||||
|
|
@ -175,6 +175,12 @@ export default function PostJobPage() {
|
|||
});
|
||||
|
||||
const [paymentMethod, setPaymentMethod] = useState("");
|
||||
const [descriptionLanguageTouched, setDescriptionLanguageTouched] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (descriptionLanguageTouched) return;
|
||||
setJob((prev) => ({ ...prev, descriptionLanguage: locale }));
|
||||
}, [descriptionLanguageTouched, locale]);
|
||||
|
||||
const currentPrice = useMemo(() => {
|
||||
const country = billing.billingCountry || job.country;
|
||||
|
|
@ -736,7 +742,10 @@ export default function PostJobPage() {
|
|||
<select
|
||||
className="w-full px-3 py-2 border rounded-md bg-white"
|
||||
value={job.descriptionLanguage}
|
||||
onChange={(e) => setJob({ ...job, descriptionLanguage: e.target.value })}
|
||||
onChange={(e) => {
|
||||
setDescriptionLanguageTouched(true);
|
||||
setJob({ ...job, descriptionLanguage: e.target.value });
|
||||
}}
|
||||
>
|
||||
<option value="">{pageCopy.selectPlaceholder}</option>
|
||||
<option value="pt-BR">{pageCopy.languageOptions["pt-BR"]}</option>
|
||||
|
|
|
|||
Loading…
Reference in a new issue