Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit d16b631

Browse files
Update App.js
1 parent 17bba83 commit d16b631

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/App.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Main } from "./components/Main";
66
function preventTags(str) {
77
return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') ;
88
}
9+
var showID = true
910
class App extends Component {
1011
constructor(props) {
1112
super(props);
@@ -86,6 +87,9 @@ class App extends Component {
8687
onChange={(e) => this.setState({ nameSearch: e.target.value })}
8788
></input>
8889
</div>
90+
<div className="form-item">
91+
<label htmlFor="showID">Show Project ID</label>
92+
<input type="checkbox" name="showID"></input>
8993
</div>
9094

9195
<h3>Results</h3>
@@ -96,7 +100,7 @@ class App extends Component {
96100
<table class="table">
97101
<thead>
98102
<tr>
99-
<th>ID</th>
103+
<th>{showID ? "ID" : "-"}</th>
100104
<th>Name</th>
101105
<th>Created</th>
102106
<th>Modified</th>
@@ -120,8 +124,8 @@ class App extends Component {
120124

121125
return (
122126
<tr key={project.id}>
123-
<td>{project.id}</td>
124-
<td>{preventTags(project.title)}</td>
127+
<td>{showID ? project.id : "-"}</td>
128+
<td>{project.title}</td>
125129
<td>
126130
{created.toLocaleDateString()}{" "}
127131
{created.toLocaleTimeString()}

0 commit comments

Comments
 (0)