Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Update Back to results button to use the new VButton variant and size (#1141)

Olga Bulat29a9516ef52f
diff --git a/frontend/src/components/VBackToSearchResultsLink.vue b/frontend/src/components/VBackToSearchResultsLink.vue
index 62d5318eb..8cb1946aa 100644
--- a/frontend/src/components/VBackToSearchResultsLink.vue
+++ b/frontend/src/components/VBackToSearchResultsLink.vue
@@ -1,13 +1,18 @@
<template>
<!-- @todo: Separate the absolute container from the link itself. -->
- <VLink
- class="time inline-flex flex-row items-center gap-2 rounded-sm p-2 pe-3 text-xs font-semibold text-dark-charcoal-70 hover:text-dark-charcoal"
+ <VButton
+ as="VLink"
+ :href="href"
+ has-icon-start
+ variant="transparent-gray"
+ size="medium"
+ class="label-bold inline-flex"
v-bind="$attrs"
@mousedown="handleClick"
>
<VIcon name="chevron-left" :rtl-flip="true" />
{{ $t("single-result.back") }}
- </VLink>
+ </VButton>
</template>
<script lang="ts">
@@ -17,7 +22,7 @@ import { useAnalytics } from "~/composables/use-analytics"
import { useSearchStore } from "~/stores/search"
import VIcon from "~/components/VIcon/VIcon.vue"
-import VLink from "~/components/VLink.vue"
+import VButton from "~/components/VButton.vue"
/**
* This link takes the user from a single result back to the list of all
@@ -26,9 +31,8 @@ import VLink from "~/components/VLink.vue"
export default defineComponent({
components: {
VIcon,
- VLink,
+ VButton,
},
- inheritAttrs: false,
props: {
/**
* The unique ID of the media
@@ -37,6 +41,10 @@ export default defineComponent({
type: String,
required: true,
},
+ href: {
+ type: String,
+ required: true,
+ },
},
setup(props) {
const { sendCustomEvent } = useAnalytics()
diff --git a/frontend/src/components/VErrorSection/VNoResults.vue b/frontend/src/components/VErrorSection/VNoResults.vue
index 4d5dbd8ed..d64a59ef4 100644
--- a/frontend/src/components/VErrorSection/VNoResults.vue
+++ b/frontend/src/components/VErrorSection/VNoResults.vue
@@ -7,7 +7,7 @@
{{ $t("no-results.alternatives") }}
</h2>
- <div class="mt-10 flex flex-col flex-wrap gap-2 gap-4 md:flex-row">
+ <div class="mt-10 flex flex-col flex-wrap gap-4 md:flex-row">
<VButton
v-for="source in externalSources"
:key="source.name"