Skip to content

Commit

Permalink
Reduce size taken by grade chips in activity tables (#6668)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Sep 10, 2024
1 parent 29b783e commit 26ae6da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classnames from 'classnames';
import { useMemo } from 'preact/hooks';
import { useLocation, useParams, useSearch } from 'wouter-preact';

Expand Down Expand Up @@ -199,7 +200,17 @@ export default function AssignmentActivity() {
)
);
case 'auto_grading_grade':
return <GradeStatusChip grade={stats.auto_grading_grade ?? 0} />;
return (
<div
className={classnames(
// Add a bit of vertical negative margin to avoid the chip
// component to make rows too tall
'-my-0.5',
)}
>
<GradeStatusChip grade={stats.auto_grading_grade ?? 0} />
</div>
);
default:
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,9 @@ describe('AssignmentActivity', () => {
.find('OrderableActivityTable')
.props()
.renderItem({ auto_grading_grade }, 'auto_grading_grade');
const gradeChip = mount(item).find('GradeStatusChip');

assert.equal(mount(item).prop('grade'), auto_grading_grade ?? 0);
assert.equal(gradeChip.prop('grade'), auto_grading_grade ?? 0);
});
},
);
Expand Down

0 comments on commit 26ae6da

Please sign in to comment.