-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjects.jsx
More file actions
73 lines (69 loc) · 1.73 KB
/
Copy pathProjects.jsx
File metadata and controls
73 lines (69 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from "react";
function Projects(props) {
// TODO: fix Website link for repo which has gh-pages
let prolist = props.data.map((repo, i) => (
<tr className={i % 2 === 0 ? `` : `selected`} key={repo.id}>
<td>
<b>
<a href={repo.html_url}>{repo.name}</a>
</b>
</td>
<td className="hidden">
<i>
<a href={repo.html_url}> {repo.html_url} </a>
</i>
</td>
<td>
<code>
<b> {repo.language !== null ? repo.language : `Unknown`} </b>
</code>
</td>
</tr>
));
let noresult = (
<tr>
<td colSpan="3">
<b> No result found ! </b>
</td>
</tr>
);
return (
<div className="project-div">
<h2>All Projects</h2>
<br />
<div className="table-search">
<input
className="table-search-input"
type="text"
placeholder="Search by project name..."
name="searchBar"
value={props.value}
onChange={(e) => props.handleChange(e)}
onKeyUp={(e) => props.handleChange(e)}
/>
<button
className="table-search-button"
type="submit"
onClick={(e) => props.handleSearch(e)}
>
Search
</button>
</div>
<div>
<table className="project-list">
<thead>
<tr className="selected">
<th>Project Name</th>
<th className="hidden">Project Website</th>
<th>Technology</th>
</tr>
</thead>
<tbody>
{props.repo.length === 0 && props.value !== "" ? noresult : prolist}
</tbody>
</table>
</div>
</div>
);
}
export default Projects;