Skip to content

Commit

Permalink
Merge pull request #56 from fribyte-code/mathias/admin-sort-by-points
Browse files Browse the repository at this point in the history
🚀 Show points in admin task table + sort
  • Loading branch information
mathiash98 authored Feb 23, 2024
2 parents 1601649 + 40f1d79 commit 0bfc8cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions frontend/src/pages/Admin.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
}
}
}

[role="button"] {
cursor: pointer;
}
18 changes: 16 additions & 2 deletions frontend/src/pages/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,21 @@ export default function Admin() {
<table className={style.adminTable}>
<thead>
<tr>
<th onClick={(e) => handleClickSortProp("name")}>Name</th>
<th>Category</th>
<th role="button" onClick={(e) => handleClickSortProp("name")}>
Name
</th>
<th
role="button"
onClick={(e) => handleClickSortProp("category")}
>
Category
</th>
<th
role="button"
onClick={(e) => handleClickSortProp("points")}
>
Points
</th>
<th>Actions</th>
</tr>
</thead>
Expand All @@ -279,6 +292,7 @@ export default function Admin() {
<tr>
<td>{t.name}</td>
<td>{t.category ?? "Other"}</td>
<td>{t.points}</td>
<td>
<button
className="button solid"
Expand Down

0 comments on commit 0bfc8cc

Please sign in to comment.