xonecas.io
366
Hc

hirenimble-challenge / commit 510ba50

Add challenge work

xonecas2020-08-31 510ba50d3819d0f556fd66599f698d655093db17 parent ce9e05d

5 files changed

package.json+1−0
@@ -6,6 +6,7 @@
66 "@testing-library/jest-dom": "^4.2.4",
77 "@testing-library/react": "^9.3.2",
88 "@testing-library/user-event": "^7.1.2",
9+ "bootstrap": "^4.5.2",
910 "react": "^16.13.1",
1011 "react-dom": "^16.13.1",
1112 "react-scripts": "3.4.1"
src/App.js+4−8
@@ -1,13 +1,9 @@
1-import React from 'react';
1+import React from "react";
2+import data from "data/candidates.json";
3+import CandidatesList from "components/candidatesList";
24
35 function App() {
4- return (
5- <header>
6- <p>
7- Edit <code>App.js</code> and save to reload
8- </p>
9- </header>
10- );
6+ return <CandidatesList candidates={data} />;
117 }
128
139 export default App;
src/components/candidateListContent.js+34−0
@@ -0,0 +1,34 @@
1+import React from "react";
2+import moment from "moment";
3+
4+function CandidateListContent(props) {
5+ const candidates = props.candidates;
6+ return candidates.map((candidate) => {
7+ return (
8+ <React.Fragment>
9+ <tr key={candidate.id} id={candidate.id}>
10+ <td>{candidate.name}</td>
11+ <td>
12+ {candidate.applications[0].new_status.color}
13+ {candidate.applications[0].new_status.label}
14+ </td>
15+ <td>{candidate.applications.lengtd}</td>
16+ <td>{moment(candidate.profile.updated).fromNow()}</td>
17+ <td>{candidate.scorecard_count}</td>
18+ <td>{candidate.profile.nimble_score}</td>
19+ <td>{candidate.note_count}</td>
20+ </tr>
21+ {candidate.applications.map((application) => {
22+ return (
23+ <tr key={application.id}>
24+ <td>{application.role.title}</td>
25+ <td>{application.new_status.label}</td>
26+ </tr>
27+ );
28+ })}
29+ </React.Fragment>
30+ );
31+ });
32+}
33+
34+export default CandidateListContent;
src/components/candidatesList.js+29−0
@@ -0,0 +1,29 @@
1+import React from "react";
2+import CandidateListContent from "./candidateListContent";
3+
4+function CandidatesList(props) {
5+ console.log(props);
6+ const candidates = props.candidates.results;
7+
8+ return (
9+ <table>
10+ <thead>
11+ <tr>
12+ <th>Candidate name</th>
13+ <th>Canditate status</th>
14+ <th># Applications</th>
15+ <th>Last action</th>
16+ <th>Scorecard</th>
17+ <th>Nimble score</th>
18+ <th>notes</th>
19+ <th>actions</th>
20+ </tr>
21+ </thead>
22+ <tbody>
23+ <CandidateListContent candidates={candidates} />
24+ </tbody>
25+ </table>
26+ );
27+}
28+
29+export default CandidatesList;
yarn.lock+5−0
@@ -2557,6 +2557,11 @@ boolbase@^1.0.0, boolbase@~1.0.0:
25572557 resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
25582558 integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
25592559
2560+bootstrap@^4.5.2:
2561+ version "4.5.2"
2562+ resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.2.tgz#a85c4eda59155f0d71186b6e6ad9b875813779ab"
2563+ integrity sha512-vlGn0bcySYl/iV+BGA544JkkZP5LB3jsmkeKLFQakCOwCM3AOk7VkldBz4jrzSe+Z0Ezn99NVXa1o45cQY4R6A==
2564+
25602565 brace-expansion@^1.1.7:
25612566 version "1.1.11"
25622567 resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"