Skip to content
Snippets Groups Projects
Commit 02a76ea5 authored by Louis Guo's avatar Louis Guo
Browse files

[WIP][Frontend][Top]

Added a first version of the frontend that works
parent daa70641
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ class Top extends Component { ...@@ -15,7 +15,7 @@ class Top extends Component {
componentDidMount() { componentDidMount() {
axios axios
.get('https://localhost:44344/api/Top/top') .get('https://localhost:44344/api/Top/top/3/Top/true')
.then(response => { .then(response => {
console.log(response) console.log(response)
this.setState({ posts: response.data }) this.setState({ posts: response.data })
...@@ -35,12 +35,15 @@ class Top extends Component { ...@@ -35,12 +35,15 @@ class Top extends Component {
<td style={{ border: "1px solid rgb(0, 0, 0)", width: 300 }}>Grade</td> <td style={{ border: "1px solid rgb(0, 0, 0)", width: 300 }}>Grade</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", width: 300 }}>Assignment name</td> <td style={{ border: "1px solid rgb(0, 0, 0)", width: 300 }}>Assignment name</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", width: 200 }}>Assignment ID</td> <td style={{ border: "1px solid rgb(0, 0, 0)", width: 200 }}>Assignment ID</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", width: 200 }}>Reviewer ID</td>
</tr> </tr>
{posts.map(row => ( {posts.map(row => (
<tr key={row.id} style={{ display: 'flex', justifyContent: 'center' }}> <tr key={row.id} style={{ display: 'flex', justifyContent: 'center' }}>
<td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 300 }}>{row.grade}</td> <td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 300 }}>{row.grade}</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 300 }}>{row.assignmentName}</td> <td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 300 }}>{row.assignmentName}</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 200 }}>{row.assignmentID}</td> <td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 200 }}>{row.assignmentID}</td>
<td style={{ border: "1px solid rgb(0, 0, 0)", backgroundColor: (n % 2) === 1 ? '#aae' : '#dde', width: 200 }}>{row.reviewerID}</td>
</tr> </tr>
))} ))}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment