From fff04844f9691fa8260cee1b470bbbcc65af1af3 Mon Sep 17 00:00:00 2001 From: upsiflu Date: Fri, 10 Jan 2025 01:14:54 +0100 Subject: [PATCH] fix(ui): use small buttons in pagination footer --- front/src/components/ui/Button.vue | 11 +++---- front/src/components/ui/Pagination.vue | 39 +++++++++++------------ front/src/components/ui/pagination.scss | 8 ----- front/ui-docs/components/ui/button.md | 13 ++++++-- front/ui-docs/components/ui/pagination.md | 4 +++ 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/front/src/components/ui/Button.vue b/front/src/components/ui/Button.vue index 3a8da2368..dc0089baa 100644 --- a/front/src/components/ui/Button.vue +++ b/front/src/components/ui/Button.vue @@ -16,7 +16,7 @@ const props = defineProps<{ shadow?: boolean round?: boolean - icon?: string + icon?: string | `right ${string}` onClick?: (...args: any[]) => void | Promise @@ -38,7 +38,6 @@ const fontWeight = props.thinFont ? 400 : 900 const button = ref() - const click = async (...args: any[]) => { internalLoader.value = true @@ -70,12 +69,14 @@ onMounted(() => { }" @click="click" > - + + + @@ -94,6 +95,7 @@ onMounted(() => { white-space: nowrap; justify-content: space-between; align-items: center; + gap: 10px; padding: calc(var(--padding) / 2 - var(--shift-by)) var(--padding) calc(var(--padding) / 2 + var(--shift-by)) var(--padding); &.is-icon-only { @@ -155,9 +157,6 @@ onMounted(() => { } } - i.bi + span:not(:empty) { - margin-left: 10px; - } &.is-icon-only i.bi { margin: -6px; diff --git a/front/src/components/ui/Pagination.vue b/front/src/components/ui/Pagination.vue index 3f040dadb..788fcfe56 100644 --- a/front/src/components/ui/Pagination.vue +++ b/front/src/components/ui/Pagination.vue @@ -57,28 +57,25 @@ const setPage = () => { class="funkwhale pagination" role="navigation">
  • -
  • - diff --git a/front/src/components/ui/pagination.scss b/front/src/components/ui/pagination.scss index e817fb871..65b69118a 100644 --- a/front/src/components/ui/pagination.scss +++ b/front/src/components/ui/pagination.scss @@ -54,14 +54,6 @@ min-width: 94px; text-align: center; } - - &:first-child > .funkwhale.button span > span { - padding-left: 0.5ch; - } - - &:last-child > .funkwhale.button span > span { - padding-right: 0.5ch; - } } } diff --git a/front/ui-docs/components/ui/button.md b/front/ui-docs/components/ui/button.md index 474b0fb15..b12624f87 100644 --- a/front/ui-docs/components/ui/button.md +++ b/front/ui-docs/components/ui/button.md @@ -386,10 +386,13 @@ You can override the promise state by passing a false `is-loading` prop. ## Add an icon -You can use [Bootstrap Icons](https://icons.getbootstrap.com/) in your button component +You can use [Bootstrap Icons](https://icons.getbootstrap.com/) in your button component. ::: info -Icon buttons shrink down to the icon size if you don't pass any content. If you want to keep the button at full width with just an icon, add `width=standard` + +- Icon buttons shrink down to the icon size if you don't pass any content. If you want to keep the button at full width with just an icon, add `button-width` as a prop. +- When combining icons with other content, prefix the icon prop with `right ` to place it after the content. + ::: ```vue-html @@ -399,6 +402,9 @@ Icon buttons shrink down to the icon size if you don't pass any content. If you + ``` @@ -408,6 +414,9 @@ Icon buttons shrink down to the icon size if you don't pass any content. If you + ## Set width and alignment diff --git a/front/ui-docs/components/ui/pagination.md b/front/ui-docs/components/ui/pagination.md index 9ad37208c..2b8ce0870 100644 --- a/front/ui-docs/components/ui/pagination.md +++ b/front/ui-docs/components/ui/pagination.md @@ -6,6 +6,10 @@ import Pagination from "~/components/ui/Pagination.vue" const page = ref(1) +```ts +import Pagination from "~/components/ui/Pagination.vue" +``` + # Pagination The pagination component helps users navigate through large lists of results by splitting them up into pages.