Transform search bar in Quote mode to Airbnb-style segmented input
All checks were successful
Build Docker Image / build (push) Successful in 3m21s
All checks were successful
Build Docker Image / build (push) Successful in 3m21s
- Remove mode toggle [Explore/Quote] tabs from header - In Quote mode: show segmented input (Product | Hub | Quantity) + Search button - In Explore mode: keep regular pill input with chips - Add productLabel, hubLabel, supplierLabel computed values to useCatalogSearch - Pass Quote mode props to MainNavigation
This commit is contained in:
@@ -16,8 +16,11 @@
|
||||
:available-chips="availableChips"
|
||||
:select-mode="selectMode"
|
||||
:search-query="searchQuery"
|
||||
:show-catalog-mode-toggle="isCatalogSection"
|
||||
:catalog-mode="catalogMode"
|
||||
:product-label="productLabel"
|
||||
:hub-label="hubLabel"
|
||||
:quantity="quantity"
|
||||
:can-search="canSearch"
|
||||
@toggle-theme="toggleTheme"
|
||||
@sign-out="onClickSignOut"
|
||||
@sign-in="signIn()"
|
||||
@@ -27,7 +30,7 @@
|
||||
@edit-token="editFilter"
|
||||
@remove-token="removeFilter"
|
||||
@update:search-query="searchQuery = $event"
|
||||
@set-catalog-mode="setCatalogMode"
|
||||
@search="onSearch"
|
||||
/>
|
||||
|
||||
<!-- Sub Navigation (section-specific tabs) - only for non-catalog sections -->
|
||||
@@ -61,7 +64,10 @@ const {
|
||||
removeFilter,
|
||||
editFilter,
|
||||
catalogMode,
|
||||
setCatalogMode
|
||||
productLabel,
|
||||
hubLabel,
|
||||
quantity,
|
||||
canSearch
|
||||
} = useCatalogSearch()
|
||||
|
||||
// Collapsible header for catalog pages
|
||||
@@ -234,4 +240,15 @@ watch(theme, (value) => applyTheme(value))
|
||||
const toggleTheme = () => {
|
||||
theme.value = theme.value === 'night' ? 'cupcake' : 'night'
|
||||
}
|
||||
|
||||
// Search handler for Quote mode - emits event that page can handle
|
||||
const localePath = useLocalePath()
|
||||
const router = useRouter()
|
||||
const onSearch = () => {
|
||||
// Navigate to catalog page which will handle the search
|
||||
if (!route.path.includes('/catalog')) {
|
||||
router.push({ path: localePath('/catalog'), query: { ...route.query, mode: 'quote' } })
|
||||
}
|
||||
// The page component will react to canSearch becoming true and perform the search
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user