Skip to content

Commit

Permalink
added some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
b3njamint committed Oct 31, 2023
1 parent 2a8a1fc commit 857d53f
Showing 1 changed file with 74 additions and 19 deletions.
93 changes: 74 additions & 19 deletions src/components/pages/AnalyticsView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect } from 'react'
import { useHistory } from 'react-router'
import { Table } from 'semantic-ui-react';

import TopBar from '../includes/TopBar';

Expand Down Expand Up @@ -50,6 +51,18 @@ const AnalyticsView = () => {
return dateEntered >= startDate && dateEntered <= endDate;
});

const historical: { [key: string]: any } = {
"Courses": courses.length,
"Questions": questions.length,
"Users": users.length,
"Office Hours": sessions.length,
}
const current: { [key: string]: any } = {
"Courses": currCourses.length,
"Questions": currQuestions.length,
"Users": currUsers.length,
"Office Hours": currSessions.length,
}
return (
<>
<TopBar
Expand All @@ -59,25 +72,67 @@ const AnalyticsView = () => {
// This field is only necessary for professors, but we are always student/TA here.
courseId="DUMMY_COURSE_ID"
/>
<h2>Analytics</h2>
<h3>Historical</h3>
courses: {courses.length}
<br />
questions: {questions.length}
<br />
users: {users.length}
<br />
sessions: {sessions.length}
<br />
<h3>Current Semester</h3>
courses: {currCourses.length}
<br />
questions: {currQuestions.length}
<br />
users: {currUsers.length}
<br />
sessions: {currSessions.length}
<br />
<h1><br />Queue Me In Product Analytics</h1>
<div style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
margin: '0px 100px',
gap: '50px'
}}>

Check failure on line 83 in src/components/pages/AnalyticsView.tsx

View workflow job for this annotation

GitHub Actions / build

The closing bracket must be aligned with the line containing the opening tag (expected column 13 on the next line)
<div className="rolesTable">
{<Table sortable={true} celled={true} fixed={true} style={{ textAlign: 'center' }}>
<Table.Header>
<Table.Row>
<Table.HeaderCell colspan='2'>Historical</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Statistic
</Table.HeaderCell>
<Table.HeaderCell>
Count
</Table.HeaderCell>
</Table.Row>
</Table.Header>
{Object.keys(historical).map((stat) => (
<Table.Row key={stat}>
<Table.Cell>{stat}</Table.Cell>
<Table.Cell>{historical[stat]}</Table.Cell>
</Table.Row>
))}
</Table>}
</div>

<div className="rolesTable">
{<Table sortable={true} celled={true} fixed={true} style={{ textAlign: 'center' }}>
<Table.Header>
<Table.Row>
<Table.HeaderCell colspan='2'>Current Semester</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Statistic
</Table.HeaderCell>
<Table.HeaderCell>
Count
</Table.HeaderCell>
</Table.Row>
</Table.Header>
{Object.keys(current).map((stat) => (
<Table.Row key={stat}>
<Table.Cell>{stat}</Table.Cell>
<Table.Cell>{current[stat]}</Table.Cell>
</Table.Row>
))}
</Table>}
</div>
</div >
</>
)
}
Expand Down

0 comments on commit 857d53f

Please sign in to comment.