Code refactoring
> Utilisation d'une variable unique pour les experienceCard
This commit is contained in:
parent
8e2865cf19
commit
69284d3300
File diff suppressed because one or more lines are too long
@ -11,31 +11,32 @@ export default class ExperienceCard extends Component {
|
|||||||
// this.state = {};
|
// this.state = {};
|
||||||
// }
|
// }
|
||||||
render() {
|
render() {
|
||||||
var imgSrc = this.props.logo;
|
var data = this.props.data;
|
||||||
|
var imgSrc = data.logo;
|
||||||
return <div class="card-content">
|
return <div class="card-content">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<div class="media-left">
|
<div class="media-left">
|
||||||
<a href={this.props.lienLogo}>
|
<a href={data.url}>
|
||||||
<figure class="image is-48x48">
|
<figure class="image is-48x48">
|
||||||
<img src={imgSrc} alt="Logo Entreprise"/>
|
<img src={imgSrc} alt="Logo Entreprise"/>
|
||||||
</figure>
|
</figure>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="media-content">
|
<div class="media-content">
|
||||||
<p class="title is-4">{this.props.title}</p>
|
<p class="title is-4">{data.occupation}</p>
|
||||||
<p class="subtitle is-6">{this.props.nomEntreprise} - {this.props.lieuEntreprise} - {this.props.date}</p>
|
<p class="subtitle is-6">{data.entreprise} - {data.location} - {data.duration}</p>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
{this.props.tags.map(function(name, index){
|
{data.tags.map(function(name, index){
|
||||||
return <span key={ index } class="tag">{name}</span>;
|
return <span key={ index } class="tag">{name}</span>;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{this.props.descriptionEmploi}
|
{data.description}
|
||||||
</div>
|
</div>
|
||||||
{this.props.commentaire ? <div class="comment">
|
{data.commentaire ? <div class="comment">
|
||||||
{this.props.commentaire}
|
{data.commentaire}
|
||||||
</div> : ''}
|
</div> : ''}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,27 +67,12 @@ class MainCard extends Component {
|
|||||||
<span class="title">{experienceCardMessage.title}</span>
|
<span class="title">{experienceCardMessage.title}</span>
|
||||||
{experienceCardMessage.experiences.map(function(experience, index){
|
{experienceCardMessage.experiences.map(function(experience, index){
|
||||||
return <ExperienceCard
|
return <ExperienceCard
|
||||||
nomEntreprise={experienceCardMessage.experiences[index].entreprise}
|
data={experience}/>;
|
||||||
lieuEntreprise={experienceCardMessage.experiences[index].location}
|
|
||||||
descriptionEmploi={experienceCardMessage.experiences[index].description}
|
|
||||||
title={experienceCardMessage.experiences[index].ocupation}
|
|
||||||
date={experienceCardMessage.experiences[index].duration}
|
|
||||||
lienLogo={experienceCardMessage.experiences[index].url}
|
|
||||||
logo={experienceCardMessage.experiences[index].logo}
|
|
||||||
tags={experienceCardMessage.experiences[index].tags}/>;
|
|
||||||
})}
|
})}
|
||||||
<span class="title">Education</span>
|
<span class="title">Education</span>
|
||||||
{experienceCardMessage.education.map(function(experience, index){
|
{experienceCardMessage.education.map(function(education, index){
|
||||||
return <ExperienceCard
|
return <ExperienceCard
|
||||||
nomEntreprise={experienceCardMessage.education[index].entreprise}
|
data={education}/>;
|
||||||
lieuEntreprise={experienceCardMessage.education[index].location}
|
|
||||||
descriptionEmploi={experienceCardMessage.education[index].description}
|
|
||||||
title={experienceCardMessage.education[index].ocupation}
|
|
||||||
date={experienceCardMessage.education[index].duration}
|
|
||||||
lienLogo={experienceCardMessage.education[index].url}
|
|
||||||
logo={experienceCardMessage.education[index].logo}
|
|
||||||
tags={experienceCardMessage.education[index].tags}
|
|
||||||
commentaire={experienceCardMessage.education[index].commentaire}/>;
|
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"title" : "Experience",
|
"title" : "Experience",
|
||||||
"experiences" : [
|
"experiences" : [
|
||||||
{
|
{
|
||||||
"ocupation" : "Full Stack Developer",
|
"occupation" : "Full Stack Developer",
|
||||||
"logo" : "../../logos/harvest.fr.png",
|
"logo" : "../../logos/harvest.fr.png",
|
||||||
"url" : "https://www.harvest.fr",
|
"url" : "https://www.harvest.fr",
|
||||||
"duration" : "(since 2016)",
|
"duration" : "(since 2016)",
|
||||||
@ -21,7 +21,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ocupation" : "Internship as IOT Developer",
|
"occupation" : "Internship as IOT Developer",
|
||||||
"logo" : "../../logos/michelin.png",
|
"logo" : "../../logos/michelin.png",
|
||||||
"url" : "https://www.michelin.fr",
|
"url" : "https://www.michelin.fr",
|
||||||
"duration" : "2015",
|
"duration" : "2015",
|
||||||
@ -38,7 +38,7 @@
|
|||||||
],
|
],
|
||||||
"education" : [
|
"education" : [
|
||||||
{
|
{
|
||||||
"ocupation" : "Associate's Degree in Computer Science / Digital Imaging *",
|
"occupation" : "Associate's Degree in Computer Science / Digital Imaging *",
|
||||||
"logo" : "../../logos/www.iut-clermont.png",
|
"logo" : "../../logos/www.iut-clermont.png",
|
||||||
"url" : "https://www.iut-clermont.fr/",
|
"url" : "https://www.iut-clermont.fr/",
|
||||||
"duration" : "Class of 2015",
|
"duration" : "Class of 2015",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"title" : "Experience",
|
"title" : "Experience",
|
||||||
"experiences" : [
|
"experiences" : [
|
||||||
{
|
{
|
||||||
"ocupation" : "Développeur Full Stack",
|
"occupation" : "Développeur Full Stack",
|
||||||
"logo" : "../../logos/harvest.fr.png",
|
"logo" : "../../logos/harvest.fr.png",
|
||||||
"url" : "https://www.harvest.fr",
|
"url" : "https://www.harvest.fr",
|
||||||
"duration" : "(depuis 2016)",
|
"duration" : "(depuis 2016)",
|
||||||
@ -21,7 +21,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ocupation" : "Stagiaire Développeur Internet des Objets",
|
"occupation" : "Stagiaire Développeur Internet des Objets",
|
||||||
"logo" : "../../logos/michelin.png",
|
"logo" : "../../logos/michelin.png",
|
||||||
"url" : "https://www.michelin.fr",
|
"url" : "https://www.michelin.fr",
|
||||||
"duration" : "2015",
|
"duration" : "2015",
|
||||||
@ -38,7 +38,7 @@
|
|||||||
],
|
],
|
||||||
"education" : [
|
"education" : [
|
||||||
{
|
{
|
||||||
"ocupation" : "DUT Informatique - Imagerie Numérique",
|
"occupation" : "DUT Informatique - Imagerie Numérique",
|
||||||
"logo" : "../../logos/www.iut-clermont.png",
|
"logo" : "../../logos/www.iut-clermont.png",
|
||||||
"url" : "https://www.iut-clermont.fr/",
|
"url" : "https://www.iut-clermont.fr/",
|
||||||
"duration" : "Promotion 2015",
|
"duration" : "Promotion 2015",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user