Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Implement the composite search bar in the mobile search header
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Oct 4, 2022
1 parent 908542f commit e76d32f
Show file tree
Hide file tree
Showing 11 changed files with 379 additions and 235 deletions.
217 changes: 0 additions & 217 deletions src/components/VHeader/VHeaderMobile.vue

This file was deleted.

40 changes: 40 additions & 0 deletions src/components/VHeader/VHeaderMobile/VBackButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<VButton
size="disabled"
class="icon-button flex h-12 w-12 flex-shrink-0 rotate-90 items-center justify-center bg-tx active:shadow-ring"
variant="plain--avoid"
aria-label="Go back"
@click="$emit('click')"
>
<span
class="flex h-8 w-8 items-center justify-center rounded-sm bg-dark-charcoal-10"
>
<VIcon
class="bg-red pointer-events-none rounded-sm bg-dark-charcoal-10"
:icon-path="caretDownIcon"
/>
</span>
</VButton>
</template>

<script lang="ts">
import { defineEvent } from '~/types/emits'
import VButton from '~/components/VButton.vue'
import VIcon from '~/components/VIcon/VIcon.vue'
import caretDownIcon from '~/assets/icons/caret-down.svg'
export default {
name: 'VBackButton',
components: { VButton, VIcon },
emits: {
click: defineEvent(),
},
setup() {
return {
caretDownIcon,
}
},
}
</script>
45 changes: 45 additions & 0 deletions src/components/VHeader/VHeaderMobile/VContentSettingsModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>
<VModal
:label="$t('header.aria.menu').toString()"
variant="search"
:hide-on-esc="true"
>
<template #trigger="{ visible, a11Props }">
<VContentSettingsButton
ref="contentSettingsButtonRef"
:is-pressed="visible"
v-bind="a11Props"
class="me-2"
/>
</template>
<template #default>
<nav
id="content-switcher-modal"
class="p-6"
aria-labelledby="content-switcher-heading"
>
<VSearchTypes
ref="searchTypesRef"
active-item="image"
size="small"
:use-links="true"
/>
</nav>
</template>
</VModal>
</template>
<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import VContentSettingsButton from '~/components/VHeader/VHeaderMobile/VContentSettingsButton.vue'
import VModal from '~/components/VModal/VModal.vue'
import VSearchTypes from '~/components/VContentSwitcher/VSearchTypes.vue'
/**
* This is a temporary stub component that needs to be replaced with the actual ContentSettingsModal
*/
export default defineComponent({
name: 'VContentSettingsModal',
components: { VContentSettingsButton, VModal, VSearchTypes },
})
</script>
Loading

0 comments on commit e76d32f

Please sign in to comment.