This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix back to search link for pages in other languages (#1350)
* Fix back to search link for pages in other languages * Replace inline svg component with VIcon * Add back to search link e2e test for localized pages (#1351) * Update src/pages/audio/_id.vue Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com> * Remove unnecessary showBackToSearch data property * Add POT file * Update POT file Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>
- Loading branch information
Showing
8 changed files
with
81 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,35 @@ | ||
<template> | ||
<!-- @todo: Separate the absolute container from the link itself. --> | ||
<VLink | ||
v-if="show" | ||
class="px-2 pt-1 md:px-6 md:pt-4 md:pb-2 flex flex-row items-center font-semibold text-dark-charcoal text-xs md:text-sr" | ||
:href="path" | ||
> | ||
<Chevron class="-ms-2" /> | ||
<VIcon :icon-path="chevronIcon" class="-ms-2" /> | ||
{{ $t('single-result.back') }} | ||
</VLink> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from '@vue/composition-api' | ||
<script lang="ts"> | ||
import { defineComponent } from '@nuxtjs/composition-api' | ||
import VIcon from '~/components/VIcon/VIcon.vue' | ||
import VLink from '~/components/VLink.vue' | ||
import Chevron from '~/assets/icons/chevron-left.svg?inline' | ||
import chevronIcon from '~/assets/icons/chevron-left.svg' | ||
export default defineComponent({ | ||
components: { | ||
Chevron, | ||
VIcon, | ||
VLink, | ||
}, | ||
data() { | ||
return { | ||
/** @type {undefined|string} */ | ||
path: undefined, | ||
show: false, | ||
} | ||
props: { | ||
path: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
created() { | ||
if (!this.$nuxt?.context?.from?.fullPath) { | ||
return | ||
} | ||
this.path = this.$nuxt.context.from.fullPath | ||
if (this.path.startsWith('/search')) { | ||
this.show = true | ||
} | ||
setup() { | ||
return { chevronIcon } | ||
}, | ||
}) | ||
</script> |
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
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
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
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