From 391de0edde8c52e5399778140881abd71be295f3 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 20 Aug 2023 23:37:11 +0200 Subject: [PATCH] Add mobile version for member filter --- resources/img/svg/filter.svg | 1 + resources/js/components/page/Filter.vue | 29 ++++++++++++++++++++++ resources/js/composables/useBreakpoints.js | 26 +++++++++++++++++++ resources/js/views/member/VIndex.vue | 16 ++++++------ 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100755 resources/img/svg/filter.svg create mode 100644 resources/js/components/page/Filter.vue create mode 100644 resources/js/composables/useBreakpoints.js diff --git a/resources/img/svg/filter.svg b/resources/img/svg/filter.svg new file mode 100755 index 00000000..eeca4580 --- /dev/null +++ b/resources/img/svg/filter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/js/components/page/Filter.vue b/resources/js/components/page/Filter.vue new file mode 100644 index 00000000..94d07477 --- /dev/null +++ b/resources/js/components/page/Filter.vue @@ -0,0 +1,29 @@ + + + diff --git a/resources/js/composables/useBreakpoints.js b/resources/js/composables/useBreakpoints.js new file mode 100644 index 00000000..c54bd5fa --- /dev/null +++ b/resources/js/composables/useBreakpoints.js @@ -0,0 +1,26 @@ +import {computed} from 'vue'; + +export default function (props) { + const visibleMobile = computed(() => { + return { + sm: 'flex sm:hidden', + md: 'flex md:hidden', + lg: 'flex lg:hidden', + xl: 'flex xl:hidden', + }[props.breakpoint]; + }); + + const visibleDesktop = computed(() => { + return { + sm: 'hidden sm:flex', + md: 'hidden md:flex', + lg: 'hidden lg:flex', + xl: 'hidden xl:flex', + }[props.breakpoint]; + }); + + return { + visibleMobile, + visibleDesktop, + }; +} diff --git a/resources/js/views/member/VIndex.vue b/resources/js/views/member/VIndex.vue index 6a4c8db1..2cd4c5d4 100644 --- a/resources/js/views/member/VIndex.vue +++ b/resources/js/views/member/VIndex.vue @@ -19,7 +19,7 @@ -
+ -
+ - + - - + + @@ -82,12 +82,12 @@ - + - - +