Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
[Issue #170] Remove inline styling from pagination wrapper component (#…
Browse files Browse the repository at this point in the history
…173)

## Summary
Fixes #170 

### Time to review: __2 mins__

## Changes proposed
> Removed inline styling on component

## Context for reviewers
> Ended up having to create a custom loading style for pagination due to
no support from USWDS on this. Honestly though IDK why we don't just
hide pagination during loading...

## Additional information
> Screenshots, GIF demos, code examples or output to help show the
changes working as expected.
![2024-08-08 13 59
02](https://github.com/user-attachments/assets/04994a3f-a48e-4511-839d-aa686a7f1414)
  • Loading branch information
btabaska authored Aug 23, 2024
1 parent 2e0666f commit 7245a9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 1 addition & 6 deletions frontend/src/components/search/SearchPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export default function SearchPagination({
};

return (
<div
style={{
pointerEvents: loading ? "none" : "fill",
opacity: loading ? 0.5 : 1,
}}
>
<div className={`grants-pagination ${loading ? "disabled" : ""}`}>
<Pagination
pathname="/search"
totalPages={pages}
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/styles/_loading.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ $spinner-size: units(4);
transform: rotate(360deg);
}
}

.grants-pagination.disabled {
opacity: 0.5;
cursor: not-allowed;
& > *,
& * {
user-select: none;
pointer-events: none;
}
}

0 comments on commit 7245a9a

Please sign in to comment.