Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login en es #250

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions uniEmpleos/src/components/LanguageButton/LanguageButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import i18n from "../../i18n"
import style from "./LanguageButton.module.css"

const LanguageButton = () => {
const [language, setLanguage] = useState("es")
const [language, setLanguage] = useState("en")

const changeLanguage = () => {
if (language === "es") {
setLanguage("en")
console.log("en")
i18n.changeLanguage("en")
} else {
setLanguage("es")
console.log("es")
i18n.changeLanguage("es")
}
}
Expand All @@ -24,7 +26,7 @@ const LanguageButton = () => {
onClick={changeLanguage}
>
<img
src={language === "es" ? "/images/en.svg" : "/images/es.svg"}
src={language === "en" ? "/images/es.svg" : "/images/en.svg"}
alt="English"
className={style.imgButton}
/>
Expand Down
8 changes: 6 additions & 2 deletions uniEmpleos/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"title2": "How does it work?",
"desc2": "Companies publish their job offers and students can apply to them. The companies can view the profiles of the students and contact them."
},
"intro": {
"description": "Guatemalan lawyer with experience in strategic analysis, political analysis and advisory to boards. Currently, I am the Executive President of the National Civic Movement. I participated in the 2022-2023 cohort of the Millennium Leadership Program at the Atlantic Council. On this website, I share reflections and resources to understand the sociopolitical environment in which we live."
"login": {
"email": "Enter your email",
"password": "Enter your password",
"new":"New to UniEmpleos?",
"register": "Register",
"login": "Login"
},
"podcast": {
"title": "Podcast",
Expand Down
8 changes: 6 additions & 2 deletions uniEmpleos/src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"title2": "¿Cómo funciona?",
"desc2": "Las empresas publican sus ofertas de trabajo y los estudiantes pueden postular a ellas. Las empresas pueden ver los perfiles de los estudiantes y contactarlos."
},
"intro": {
"description": "Abogado guatemalteco con experiencia en análisis estratégico, análisis político y asesorías a directivas. Actualmente soy Presidente Ejecutivo del Movimiento Cívico Nacional. Participé en el cohorte 2022-2023 del Millenium Leadership Program del Atlantic Council. En este website comparto reflexiones y recursos para comprender el entorno sociopolítico en el que vivimos."
"login": {
"email": "Ingrese su correo",
"password": "Ingrese su contraseña",
"new":"¿Eres nuevo?",
"register": "Regístrate",
"login": "Iniciar Sesión"
},
"podcast": {
"title": "Podcast",
Expand Down
16 changes: 11 additions & 5 deletions uniEmpleos/src/pages/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import styles from "./Login.module.css"
import Popup from "../../components/Popup/Popup"
import API_URL from "../../api"
import { useStoreon } from "storeon/react"
import { useTranslation } from "react-i18next"
import LanguageButton from "../../components/LanguageButton/LanguageButton"

const LogIn = () => {
const { t } = useTranslation()
const { dispatch } = useStoreon("user")

const [emailInput, setEmailInput] = useState("")
Expand Down Expand Up @@ -82,7 +85,7 @@ const LogIn = () => {
<h1>UniEmpleos</h1>
<div className={styles.inputsContainer}>
<div className={styles.usuarioContainer}>
<span>Ingrese su correo</span>
<span>{t("login.email")}</span>
<ComponentInput
name="correo"
type="text"
Expand All @@ -91,26 +94,26 @@ const LogIn = () => {
/>
</div>
<div className={styles.usuarioContainer}>
<span>Ingrese su contraseña</span>
<span>{t("login.password")}</span>
<ComponentInput
name="password"
type="password"
placeholder="micontraseña123"
onChange={handlePass}
eye = {true}
eye
onClickButton = {handlePassword}
isOpen={showPassword}
/>
</div>
<Button
label="Iniciar sesión"
label={t("login.login")}
onClick={(event) => {
event.preventDefault()
logIn()
}}
/>
<a href="/signup">
¿Eres nuevo? <span> Únete al equipo </span>
{t("login.new")} <span> {t("login.register")}</span>
</a>
</div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320">
Expand All @@ -122,6 +125,9 @@ const LogIn = () => {
320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z"
/>
</svg>
<div className={styles.footer}>
<LanguageButton />
</div>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion uniEmpleos/src/pages/Login/Login.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
color: #a08ae5;
}

.logInCointainer>div {
.inputsContainer {
z-index: 1;
border-radius: 5px;
width: 300px;
Expand Down
Loading