Sha256: 73944ecee87a75e7ebaa6cd74aed46773835eaefdbcd72a703b210f74352161d

Contents?: true

Size: 794 Bytes

Versions: 24

Compression:

Stored size: 794 Bytes

Contents

<template>
  <router-link
    :to="{
      name: 'editPage',
      params: { locale: locale.prefix, pageId: pageId },
    }"
    :key="locale.prefix"
    class="flex items-center px-4 py-4 hover:bg-gray-100 transition-colors duration-200 focus:outline-none cursor-pointer text-md"
    :class="{ 'font-bold': isActive }"
  >
    {{ locale.label }}
  </router-link>
</template>

<script>
export default {
  name: 'LocaleTogglerLink',
  props: {
    locale: { type: Object, required: true },
    defaultLocale: { type: Object, required: true },
  },
  computed: {
    isActive() {
      return this.locale.prefix === this.currentLocale
    },
    pageId() {
      const map = this.currentPage.pathHash
      return map[this.locale.prefix] || map[this.defaultLocale.prefix]
    },
  },
}
</script>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
maglevcms-1.7.3 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.7.2 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.7.1 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.7.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.6.1 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.6.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.5.1 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.4.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.3.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.2.2 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.2.1 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.2.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.7 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.6 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.5 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.4 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.3 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.2 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.1 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue
maglevcms-1.1.0 app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue