Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rank column to All-Time view in both donor and team statistics #106

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/modules/Donor/AllTime/DonorAllTime.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ const DonorAllTime = () => {

const stats = useSelector((state) => state.stats);
const columns = [
{
title: 'Rank',
fixed: 'left',
width: 50,
render: (data) => (stats?.donor.indexOf(data) + 1),
sorter: (a, b) => a.credit - b.credit,
},
{
title: 'Donor Name',
dataIndex: 'name',
Expand Down
7 changes: 7 additions & 0 deletions src/modules/Team/AllTime/TeamAllTime.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const TeamAllTime = () => {

const stats = useSelector((state) => state.stats);
const columns = [
{
title: 'Rank',
fixed: 'left',
width: 50,
render: (data) => (stats?.team.indexOf(data) + 1),
sorter: (a, b) => a.credit - b.credit,
},
{
title: 'Team Name',
dataIndex: 'name',
Expand Down
9 changes: 8 additions & 1 deletion src/modules/Team/TeamMembers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ const teamMembers = () => {
const stats = useSelector((state) => state.stats);
const columns = [
{
title: 'Rank',
title: 'Rank (team)',
fixed: 'left',
width: 50,
render: (text, data) => (stats?.teamMembers.indexOf(data) + 1),
sorter: (a, b) => a.score - b.score,
},
{
title: 'Rank (project)',
dataIndex: 'rank',
key: 'rank',
fixed: 'left',
Expand Down