Skip to content

Commit 8a7e9c0

Browse files
authored
Grading: Overview filterable buttons onHover Effects (#2782)
* hover effects for filter buttons under grading * Edited onHover effect background contrast values * yarn prettier checks * change from border to text-decoration underline and cleanup code
1 parent 60eb5e2 commit 8a7e9c0

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/pages/academy/grading/subcomponents/GradingBadges.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ const FilterBadge: React.FC<FilterBadgeProps> = ({ filter, onRemove }) => {
8181
let filterValue = filter.value as string;
8282
filterValue = filterValue.charAt(0).toUpperCase() + filterValue.slice(1);
8383
return (
84-
<button type="button" onClick={() => onRemove(filter)} style={{ padding: 0 }}>
84+
<button
85+
type="button"
86+
className="grading-overview-filterable-btns"
87+
onClick={() => onRemove(filter)}
88+
>
8589
<Badge
8690
text={filterValue}
8791
icon={() => <Icon icon={IconNames.CROSS} style={{ marginRight: '0.25rem' }} />}

src/pages/academy/grading/subcomponents/GradingSubmissionsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const Filterable: React.FC<FilterableProps> = ({ column, value, children }) => {
234234
};
235235

236236
return (
237-
<button type="button" onClick={handleFilterChange} style={{ padding: 0 }}>
237+
<button type="button" className="grading-overview-filterable-btns" onClick={handleFilterChange}>
238238
{children || value}
239239
</button>
240240
);

src/styles/_academy.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,25 @@
518518
margin-left: 3px;
519519
}
520520
}
521+
522+
.grading-overview-filterable-btns {
523+
padding: 0;
524+
525+
// Invisible border for backgroundless buttons
526+
&:not(:has(> div)) {
527+
text-decoration: none;
528+
}
529+
530+
&:hover {
531+
// Buttons with bg
532+
> div > span {
533+
// Use of contrast due to unknown background color
534+
filter: contrast(0.9);
535+
}
536+
537+
// Backgroundless buttons
538+
&:not(:has(> div)) {
539+
text-decoration: underline;
540+
}
541+
}
542+
}

0 commit comments

Comments
 (0)