You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
3.1 KiB
124 lines
3.1 KiB
4 years ago
|
|
||
|
import React, { useState, useEffect } from "react";
|
||
4 years ago
|
import './App.css';
|
||
|
|
||
4 years ago
|
class Card extends React.Component{
|
||
|
state = {
|
||
4 years ago
|
data: {}
|
||
4 years ago
|
}
|
||
|
|
||
|
constructor(props) {
|
||
|
super(props);
|
||
4 years ago
|
this.state.data = props;
|
||
4 years ago
|
}
|
||
|
|
||
|
render() {
|
||
4 years ago
|
return (
|
||
4 years ago
|
<div className="card">
|
||
4 years ago
|
<h4><b>{this.state.data.Username}</b></h4>
|
||
4 years ago
|
<div className="container">
|
||
4 years ago
|
<p>{this.state.data.Closed}</p>
|
||
|
<p>{this.state.data.UserID}</p>
|
||
|
<p><a href={this.state.data.Photo}>Verification Photo</a></p>
|
||
4 years ago
|
</div>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
4 years ago
|
function CardImg(data) {
|
||
|
return (
|
||
|
<div className="card-img">
|
||
4 years ago
|
<h4><b>Pend: {data.Username}</b></h4>
|
||
4 years ago
|
<img src={data.Photo !== undefined ? data.Photo : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} />
|
||
|
<div className="container">
|
||
|
<p>{data.UserID}</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
4 years ago
|
/*
|
||
4 years ago
|
function UserDetail(userID, verification) {
|
||
|
const [data, setData] = useState([]);
|
||
|
useEffect(() => {
|
||
|
fetch(
|
||
|
`https://thanos.nightmare.haus/api/user?userID=${userID}`
|
||
|
)
|
||
|
.then(res => res.json())
|
||
|
.then(response => {
|
||
|
setData(response);
|
||
|
})
|
||
|
.catch(error => console.log(error));
|
||
|
});
|
||
|
|
||
|
return (
|
||
|
<div className="card">
|
||
|
<h4><b>{data.Nick}</b></h4>
|
||
|
<img src={verification !== undefined ? verification : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} />
|
||
|
<div className="container">
|
||
|
<img src={data.user.avatar !== undefined ? `https://cdn.discordapp.com/avatars/${userID}/${data.user.avatar}.png` : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} />
|
||
|
|
||
|
<p>{data.joined_at}</p>
|
||
|
<p>{data.user.id}</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
4 years ago
|
*/
|
||
4 years ago
|
class Pending extends React.Component {
|
||
|
state = {
|
||
|
pending: []
|
||
|
}
|
||
|
componentDidMount() {
|
||
|
const apiUrl = 'https://thanos.nightmare.haus/api/pending';
|
||
|
fetch(apiUrl)
|
||
|
.then((response) => response.json())
|
||
4 years ago
|
.then((data) => this.setState({pending: Object.values(data)}));
|
||
4 years ago
|
}
|
||
|
render() {
|
||
|
return (
|
||
|
<div className="App">
|
||
|
<ul>
|
||
4 years ago
|
{this.state.pending.map((data, i) => (
|
||
|
<li key={i}> <CardImg {...data} /></li>
|
||
4 years ago
|
))}
|
||
|
</ul>
|
||
4 years ago
|
<br></br>
|
||
4 years ago
|
</div>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
4 years ago
|
|
||
4 years ago
|
|
||
4 years ago
|
class Verification extends React.Component {
|
||
4 years ago
|
state = {
|
||
|
verifications: []
|
||
|
}
|
||
4 years ago
|
componentDidMount() {
|
||
|
const apiUrl = 'https://thanos.nightmare.haus/api/verifications';
|
||
|
fetch(apiUrl)
|
||
|
.then((response) => response.json())
|
||
4 years ago
|
.then((data) => this.setState({verifications: data}));
|
||
4 years ago
|
}
|
||
4 years ago
|
|
||
4 years ago
|
render() {
|
||
|
return (
|
||
4 years ago
|
<div className="App">
|
||
4 years ago
|
<Pending />
|
||
4 years ago
|
<ul>
|
||
4 years ago
|
{this.state.verifications.map((data, i) => (
|
||
|
<li key={i}> <Card {...data} /></li>
|
||
4 years ago
|
))}
|
||
|
</ul>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
4 years ago
|
export {
|
||
|
Pending,
|
||
|
Verification,
|
||
|
}
|
||
4 years ago
|
|
||
|
export default Verification;
|