fix for agent page translations

This commit is contained in:
soyed 2021-04-07 22:12:24 -04:00
parent 0d85b601be
commit 9dc877da14
4 changed files with 161 additions and 29 deletions

View file

@ -52,8 +52,49 @@
"Contact-Submit": "Submit",
"Contact-Error1": "Please select an item in the list.",
"Contact-Error2": "Please fill out this field.",
"Contact-Error3": "Invalid email address."
"Contact-Error3": "Invalid email address.",
"agents": [
{
"title": "head sales assistant",
"name": "Michael",
"src": "{{ img1 }}",
"word": "Michael has a genuine passion for helping others and for giving back to the community.",
"id": 1
},
{
"title": "sales assistant",
"name": "Jin",
"src": "{{ img2 }}",
"word": "I have a passion for assisting clients with various real estate needs.",
"id": 2
},
{
"title": "sales assistant",
"name": "Anita",
"src": "{{ img3 }}",
"word": "Anita looks forward to servicing you to her fullest potential, building long-lasting relationships and making your real estate experience a smooth and memorable one.",
"id": 3
},
{
"title": "sales assistant",
"name": "Alex",
"src": "{{ img4 }}",
"word": "Since getting licensed in 2010 Alex has consistently been a top producing agent in the GTA",
"id": 4
},
{
"title": "sales assistant",
"name": "Xuan",
"src": "{{ img5 }}",
"word": "Xuan grew up in the GTA, and he explored many different neighborhoods in and surrounding Toronto.",
"id": 5
},
{
"title": "sales assistant",
"name": "Walter",
"src": "{{ img6 }}",
"word": "Walter Henry has always been one to follow his passion. At 13 years old, he started his career as a competitive gymnast.Walter will be certain that you feel informed and at ease throughout the entire process.",
"id": 6
}
]
}

View file

@ -52,5 +52,49 @@
"Contact-Submit": "Soumettre",
"Contact-Error1": "Veuillez sélectionner un élément dans la liste.",
"Contact-Error2": "Veuillez remplir ce champ.",
"Contact-Error3": "Adresse e-mail invalide."
"Contact-Error3": "Adresse e-mail invalide.",
"agents": [
{
"title": "chef assistant commercial",
"name": "Michael",
"src": "{{ img1 }}",
"word": "Michael a une véritable passion pour aider les autres et pour redonner à la communauté.",
"id": 1
},
{
"title": "assistant des ventes",
"name": "Jin",
"src": "{{ img2 }}",
"word": "J'ai une passion pour aider les clients avec divers besoins immobiliers.",
"id": 2
},
{
"title": "assistant des ventes",
"name": "Anita",
"src": "{{ img3 }}",
"word": "Anita a hâte de vous servir à son plein potentiel, de bâtir des relations durables et de faire de votre expérience immobilière une expérience agréable et mémorable.",
"id": 3
},
{
"title": "assistant des ventes",
"name": "Alex",
"src": "{{ img4 }}",
"word": "Depuis l'obtention de sa licence en 2010, Alex a toujours été l'un des meilleurs agents de production dans la région du Grand Toronto.",
"id": 4
},
{
"title": "assistant des ventes",
"name": "Xuan",
"src": "{{ img5 }}",
"word": "Xuan a grandi dans la région du Grand Toronto et a exploré de nombreux quartiers différents de Toronto et des environs.",
"id": 5
},
{
"title": "assistant des ventes",
"name": "Walter",
"src": "{{ img6 }}",
"word": "Walter Henry a toujours été du genre à suivre sa passion. À 13 ans, il a commencé sa carrière en tant que gymnaste de compétition. Walter sera certain que vous vous sentirez informé et à l'aise tout au long du processus.",
"id": 6
}
]
}

View file

@ -1,27 +1,69 @@
import React, { Component } from "react";
import Agents from './Agents'
import './agent-page.css';
import Agents from "./Agents";
import "./agent-page.css";
import Agent1 from "../images/Agent1.jpg";
import Agent2 from "../images/Agent2.jpg";
import Agent3 from "../images/Agent3.jpg";
import Agent4 from "../images/Agent4.jpg";
import Agent5 from "../images/Agent5.jpg";
import Agent6 from "../images/Agent6.jpg";
import { withTranslation } from "react-i18next";
import i18next from "i18next";
class AgentPage extends Component {
state = {
agents: [
{ title: 'head sales assistant', name: 'Michael', src: Agent1, word: 'Michael has a genuine passion for helping others and for giving back to the community.', id: 1 },
{ title: 'sales assistant', name: 'Jin', src: Agent2, word: 'I have a passion for assisting clients with various real estate needs.', id: 2 },
{ title: 'sales assistant', name: 'Anita', src: Agent3, word: 'Anita looks forward to servicing you to her fullest potential, building long-lasting relationships and making your real estate experience a smooth and memorable one.', id: 3 },
{ title: 'sales assistant', name: 'Alex', src: Agent4, word: 'Since getting licensed in 2010 Alex has consistently been a top producing agent in the GTA', id: 4 },
{ title: 'sales assistant', name: 'Xuan', src: Agent5, word: 'Xuan grew up in the GTA, and he explored many different neighborhoods in and surrounding Toronto.', id: 5 },
{ title: 'sales assistant', name: 'Walter', src: Agent6, word: 'Walter Henry has always been one to follow his passion. At 13 years old, he started his career as a competitive gymnast.Walter will be certain that you feel informed and at ease throughout the entire process.', id: 6 },
]
}
{
title: "head sales assistant",
name: "Michael",
src: Agent1,
word:
"Michael has a genuine passion for helping others and for giving back to the community.",
id: 1,
},
{
title: "sales assistant",
name: "Jin",
src: Agent2,
word:
"I have a passion for assisting clients with various real estate needs.",
id: 2,
},
{
title: "sales assistant",
name: "Anita",
src: Agent3,
word:
"Anita looks forward to servicing you to her fullest potential, building long-lasting relationships and making your real estate experience a smooth and memorable one.",
id: 3,
},
{
title: "sales assistant",
name: "Alex",
src: Agent4,
word:
"Since getting licensed in 2010 Alex has consistently been a top producing agent in the GTA",
id: 4,
},
{
title: "sales assistant",
name: "Xuan",
src: Agent5,
word:
"Xuan grew up in the GTA, and he explored many different neighborhoods in and surrounding Toronto.",
id: 5,
},
{
title: "sales assistant",
name: "Walter",
src: Agent6,
word:
"Walter Henry has always been one to follow his passion. At 13 years old, he started his career as a competitive gymnast.Walter will be certain that you feel informed and at ease throughout the entire process.",
id: 6,
},
],
};
render() {
const { t } = this.props;
return (
<div>
<div className="center blue-text text-darken-4">
@ -29,16 +71,23 @@ class AgentPage extends Component {
</div>
<div className="container">
<Agents agents={this.state.agents} />
<Agents
agents={i18next.t("agents", {
img1: { Agent1 },
img2: { Agent2 },
img3: { Agent3 },
img4: { Agent4 },
img5: { Agent5 },
img6: { Agent6 },
returnObjects: true,
})}
/>
</div>
</div>
)
);
}
displayAgents = (agent) => {
console.log(agent);
};
}
}
export default AgentPage;
export default withTranslation()(AgentPage);

View file

@ -13,9 +13,7 @@ const Agents = ({ agents }) => {
<Card.Body>
<Card.Title>{agent.title}</Card.Title>
<Card.Text>{agent.name}</Card.Text>
<Card.Text style={{ height: "7rem" }}>
{agent.word}
</Card.Text>
<Card.Text style={{ height: "7rem" }}>{agent.word}</Card.Text>
<div className="buttonfriend">
<Button variant="primary">VIEW</Button>
</div>