Merge pull request #73 from rede5/codex/verificar-idioma-na-pagina-de-empregos

Codex-generated pull request
This commit is contained in:
Tiago Yamamoto 2026-02-18 08:41:39 -03:00 committed by GitHub
commit ae4dcb4b90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
"use client"; "use client";
import Image from "next/image"; import Image from "next/image";
import { useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { Search } from "lucide-react"; import { Search } from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";
@ -140,7 +140,7 @@ export default function PostJobPage() {
currency: "USD", currency: "USD",
salaryPeriod: "monthly", salaryPeriod: "monthly",
description: "", description: "",
descriptionLanguage: "", descriptionLanguage: locale,
applicationChannel: "email" as ApplicationChannel, applicationChannel: "email" as ApplicationChannel,
applicationEmail: "", applicationEmail: "",
applicationUrl: "", applicationUrl: "",
@ -175,6 +175,12 @@ export default function PostJobPage() {
}); });
const [paymentMethod, setPaymentMethod] = useState(""); const [paymentMethod, setPaymentMethod] = useState("");
const [descriptionLanguageTouched, setDescriptionLanguageTouched] = useState(false);
useEffect(() => {
if (descriptionLanguageTouched) return;
setJob((prev) => ({ ...prev, descriptionLanguage: locale }));
}, [descriptionLanguageTouched, locale]);
const currentPrice = useMemo(() => { const currentPrice = useMemo(() => {
const country = billing.billingCountry || job.country; const country = billing.billingCountry || job.country;
@ -736,7 +742,10 @@ export default function PostJobPage() {
<select <select
className="w-full px-3 py-2 border rounded-md bg-white" className="w-full px-3 py-2 border rounded-md bg-white"
value={job.descriptionLanguage} 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="">{pageCopy.selectPlaceholder}</option>
<option value="pt-BR">{pageCopy.languageOptions["pt-BR"]}</option> <option value="pt-BR">{pageCopy.languageOptions["pt-BR"]}</option>