-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boost: Remove global state from Pagination component (#33110)
* Remove global state from Pagination component * add changelog * Update next/previous pagination buttons behavior * Update next/previous buttons to use a separate component * Make it easier to change the contents of PaginationArrow
- Loading branch information
Showing
4 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...sets/src/js/modules/image-size-analysis/recommendations/components/PaginationArrow.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script lang="ts"> | ||
import { Link } from '../../../../utils/router'; | ||
export let group: string; | ||
export let direction: 'left' | 'right'; | ||
export let current: number; | ||
export let total: number; | ||
$: inactive = direction === 'left' ? current === 1 : current === total; | ||
$: page = direction === 'left' ? current - 1 : current + 1; | ||
</script> | ||
|
||
{#if inactive} | ||
<span class="jb-pagination__page jb-pagination__inactive"> | ||
<slot /> | ||
</span> | ||
{:else} | ||
<Link to="/image-size-analysis/{group}/{page}" class="jb-pagination__page"> | ||
<slot /> | ||
</Link> | ||
{/if} | ||
|
||
<style lang="scss"> | ||
.jb-pagination__page { | ||
background-color: transparent; | ||
border: 0; | ||
cursor: pointer; | ||
padding: 7px 12px; | ||
aspect-ratio: 1; | ||
line-height: 1; | ||
font-size: 13px; | ||
font-weight: 600; | ||
text-decoration: none; | ||
&.jb-pagination__inactive { | ||
opacity: 0.25; | ||
cursor: not-allowed; | ||
} | ||
} | ||
</style> |
5 changes: 5 additions & 0 deletions
5
projects/plugins/boost/changelog/remove-state-pagination-component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: removed | ||
Comment: Removed global state from pagination component. | ||
|
||
|