Skip to content

Commit

Permalink
perf(ui/pagination): replace the prev/next text on pagination buttons…
Browse files Browse the repository at this point in the history
… with icons (#743)
  • Loading branch information
qwqcode committed Jan 31, 2024
1 parent 2fcad53 commit 29bf499
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
12 changes: 9 additions & 3 deletions ui/artalk-sidebar/src/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ defineExpose({ prev, next, reset })
class="atk-btn atk-btn-prev"
:class="{ 'atk-disabled': disabled || prevDisabled }"
@click="prev()"
>Prev</div>
aria-label="Previous page"
>
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"></path></svg>
</div>
<input
type="text"
class="atk-input"
Expand All @@ -125,7 +128,10 @@ defineExpose({ prev, next, reset })
class="atk-btn atk-btn-next"
:class="{ 'atk-disabled': disabled || nextDisabled }"
@click="next()"
>Next</div>
aria-label="Next page"
>
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"></path></svg>
</div>
</div>
</div>
</template>
Expand All @@ -151,7 +157,7 @@ defineExpose({ prev, next, reset })
& > .atk-btn {
user-select: none;
width: 70px;
width: 60px;
cursor: pointer;
display: flex;
justify-content: center;
Expand Down
8 changes: 6 additions & 2 deletions ui/artalk/src/components/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ export default class Pagination {
this.$el = Utils.createElement(
`<div class="atk-pagination-wrap">
<div class="atk-pagination">
<div class="atk-btn atk-btn-prev">Prev</div>
<div class="atk-btn atk-btn-prev" aria-label="Previous page">
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"></path></svg>
</div>
<input type="text" class="atk-input" aria-label="Enter the number of page" />
<div class="atk-btn atk-btn-next">Next</div>
<div class="atk-btn atk-btn-next" aria-label="Next page">
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"></path></svg>
</div>
</div>
</div>`)
this.$input = this.$el.querySelector('.atk-input')!
Expand Down
3 changes: 1 addition & 2 deletions ui/artalk/src/style/pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

& > .atk-btn,
& > .atk-input {
font-size: 15px;
height: 30px;
border: 1px solid var(--at-color-border);
border-radius: 3px;
Expand All @@ -18,7 +17,7 @@

& > .atk-btn {
user-select: none;
width: 70px;
width: 60px;
cursor: pointer;
display: flex;
justify-content: center;
Expand Down

0 comments on commit 29bf499

Please sign in to comment.