Show list of verifications
This commit is contained in:
25
src/app.js
25
src/app.js
@ -1,4 +1,19 @@
|
||||
function Card(data) {
|
||||
return (
|
||||
<div class="card">
|
||||
<h4><b>{data.Username}</b></h4>
|
||||
<div class="container">
|
||||
<p>{data.Closed}</p>
|
||||
<p>{data.UserID}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
class Verification extends React.Component {
|
||||
state = {
|
||||
verifications: []
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
@ -6,11 +21,17 @@ class Verification extends React.Component {
|
||||
const apiUrl = 'https://thanos.nightmare.haus/api/verifications';
|
||||
fetch(apiUrl)
|
||||
.then((response) => response.json())
|
||||
.then((data) => console.log('The data from the call: ', data));
|
||||
.then((data) => this.setState({verifications: data}));
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div><h1>Verifications have loaded. See logs.</h1></div>
|
||||
<div>
|
||||
<ul>
|
||||
{this.state.verifications.map((data) => (
|
||||
<li key={data.UserID}> <Card {...data} /></li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user