Add mode toggle [Explore|Quote] left of search form in header
All checks were successful
Build Docker Image / build (push) Successful in 3m43s
All checks were successful
Build Docker Image / build (push) Successful in 3m43s
This commit is contained in:
@@ -9,6 +9,26 @@
|
|||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Mode toggle (between Logo and Search) -->
|
||||||
|
<div v-if="showModeToggle" class="flex items-center flex-shrink-0 py-2.5">
|
||||||
|
<div class="join">
|
||||||
|
<button
|
||||||
|
class="btn btn-sm join-item"
|
||||||
|
:class="catalogMode === 'explore' ? 'btn-primary' : 'btn-ghost'"
|
||||||
|
@click="$emit('set-catalog-mode', 'explore')"
|
||||||
|
>
|
||||||
|
{{ $t('catalog.modes.explore') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-sm join-item"
|
||||||
|
:class="catalogMode === 'quote' ? 'btn-primary' : 'btn-ghost'"
|
||||||
|
@click="$emit('set-catalog-mode', 'quote')"
|
||||||
|
>
|
||||||
|
{{ $t('catalog.modes.quote') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Center: Search input (transforms based on mode) -->
|
<!-- Center: Search input (transforms based on mode) -->
|
||||||
<div class="flex-1 flex flex-col items-center max-w-2xl mx-auto gap-2">
|
<div class="flex-1 flex flex-col items-center max-w-2xl mx-auto gap-2">
|
||||||
<!-- Quote mode: Segmented input like Airbnb -->
|
<!-- Quote mode: Segmented input like Airbnb -->
|
||||||
@@ -259,6 +279,7 @@ const props = defineProps<{
|
|||||||
hubLabel?: string
|
hubLabel?: string
|
||||||
quantity?: string
|
quantity?: string
|
||||||
canSearch?: boolean
|
canSearch?: boolean
|
||||||
|
showModeToggle?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
defineEmits([
|
defineEmits([
|
||||||
@@ -273,7 +294,8 @@ defineEmits([
|
|||||||
'remove-token',
|
'remove-token',
|
||||||
'update:search-query',
|
'update:search-query',
|
||||||
// Quote mode
|
// Quote mode
|
||||||
'search'
|
'search',
|
||||||
|
'set-catalog-mode'
|
||||||
])
|
])
|
||||||
|
|
||||||
const localePath = useLocalePath()
|
const localePath = useLocalePath()
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
:hub-label="hubLabel"
|
:hub-label="hubLabel"
|
||||||
:quantity="quantity"
|
:quantity="quantity"
|
||||||
:can-search="canSearch"
|
:can-search="canSearch"
|
||||||
|
:show-mode-toggle="isCatalogSection"
|
||||||
@toggle-theme="toggleTheme"
|
@toggle-theme="toggleTheme"
|
||||||
|
@set-catalog-mode="setCatalogMode"
|
||||||
@sign-out="onClickSignOut"
|
@sign-out="onClickSignOut"
|
||||||
@sign-in="signIn()"
|
@sign-in="signIn()"
|
||||||
@switch-team="switchToTeam"
|
@switch-team="switchToTeam"
|
||||||
@@ -64,6 +66,7 @@ const {
|
|||||||
removeFilter,
|
removeFilter,
|
||||||
editFilter,
|
editFilter,
|
||||||
catalogMode,
|
catalogMode,
|
||||||
|
setCatalogMode,
|
||||||
productLabel,
|
productLabel,
|
||||||
hubLabel,
|
hubLabel,
|
||||||
quantity,
|
quantity,
|
||||||
|
|||||||
Reference in New Issue
Block a user