From 2b304d1dc1d02778c8de95de6f02ac36f2cf1e27 Mon Sep 17 00:00:00 2001 From: bryantgillespie Date: Fri, 2 Aug 2024 09:01:24 -0400 Subject: [PATCH] mobile filters --- components/Block/Directory.vue | 61 +++++++++++++++++++++++++++++++--- composables/useDirectory.ts | 5 +++ 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/components/Block/Directory.vue b/components/Block/Directory.vue index 5352c9d..5a450c8 100644 --- a/components/Block/Directory.vue +++ b/components/Block/Directory.vue @@ -76,12 +76,19 @@ const dirConfig = computed(() => { }); // Search Capability -const { searchQuery, selectedFacets, facets, filteredItems, clearFilters } = useDirectory({ +const { searchQuery, selectedFacets, facets, filteredItems, isFilterActive, clearFilters } = useDirectory({ items: cards.value ?? [], searchFields: unref(dirConfig)?.searchFields ?? [], facetFields: unref(dirConfig)?.facetFields ?? [], fieldMapping: unref(dirConfig)?.fieldMapping ?? undefined, }); + +// Mobile filter state +const isFilterOpen = ref(false); + +const toggleFilter = () => { + isFilterOpen.value = !isFilterOpen.value; +};