Skip to content

Commit

Permalink
displaying 'geek's-experience' in dashboard, by new Component-Experience
Browse files Browse the repository at this point in the history
  • Loading branch information
ganesh-deshmukh committed Oct 27, 2018
1 parent b291370 commit 9a36ad9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions frontend/src/components/dashboard/Experience.js
@@ -0,0 +1,39 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import PropTypes from "prop-types";

class Experience extends Component {
render() {
const experience = this.props.experience.map(exp => (
<tr key={exp._id}>
<td>{exp.company}</td>
<td>{exp.title}</td>
<td>
{exp.from} - {exp.to}
</td>
<td>
<button className="btn btn-danger"> Delete </button>
</td>
</tr>
));
return (
<div>
<h4 className="mb-4"> Your Experience Details</h4>

<table className="table">
<thead>
<tr>
<th>Company</th>
<th>Title</th>
<th>Years</th>
</tr>
{experience}
</thead>
</table>
</div>
);
}
}

export default connect(null)(withRouter(Experience));
4 changes: 2 additions & 2 deletions frontend/src/components/dashboard/dashboard.js
Expand Up @@ -5,6 +5,7 @@ import { Link } from "react-router-dom";
import { getCurrentProfile, deleteAccount } from "../../actions/profileActions";
import Spinner from "../common/Spinner";
import ProfileActions from "./ProfileActions";
import Experience from "./Experience";

class Dashboard extends Component {
componentDidMount() {
Expand Down Expand Up @@ -33,8 +34,7 @@ class Dashboard extends Component {
Welcome <Link to={`/profile/${profile.handle}`}>{user.name}</Link>
</p>
<ProfileActions />
{/* todo- exp and eductn */}

<Experience experience={profile.experience} />
<div style={{ marginBottom: "60px" }} />
<button
onClick={this.onDeleteClick.bind(this)}
Expand Down

0 comments on commit 9a36ad9

Please sign in to comment.