Skip to content

Commit

Permalink
Props and Project Component
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Oct 19, 2022
1 parent 60b3665 commit 15aa9bf
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions portfolio/src/Projects.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import React, { Component } from 'react';
import PROJECTS from './data/projects';

class Project extends Component {
render() {
const { title, image, description, link } = this.props.project;

return (
<div style={{ display: 'inline-block', width: 300, margin: 10 }}>
<h3>{title}</h3>
<img src={image} alt='profile' style={{ width: 200, height: 120 }} />
<p>{description}</p>
<a href={link}>{link}</a>
</div>
);
}
}

class Projects extends Component {
render() {
return (
Expand All @@ -10,7 +25,7 @@ class Projects extends Component {
{
PROJECTS.map(PROJECT => {
return (
<div key={PROJECT.id}>{PROJECT.title}</div>
<Project key={PROJECT.id} project={PROJECT} />
);
})
}
Expand All @@ -20,4 +35,4 @@ class Projects extends Component {
}
}

export default Projects;
export default Projects;

0 comments on commit 15aa9bf

Please sign in to comment.