fix: dont show collapse button in mobile view

This commit is contained in:
Shariq Ansari 2024-05-27 12:04:25 +05:30
parent 9655cbe5b5
commit 4531dbd99f
3 changed files with 8 additions and 11 deletions

View File

@ -74,7 +74,7 @@
</Section> </Section>
</div> </div>
</div> </div>
<div class="m-2 flex flex-col gap-1"> <div v-if="!isMobileView" class="m-2 flex flex-col gap-1">
<SidebarLink <SidebarLink
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')" :label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
:isCollapsed="isSidebarCollapsed" :isCollapsed="isSidebarCollapsed"
@ -116,6 +116,7 @@ import { notificationsStore } from '@/stores/notifications'
import { FeatherIcon } from 'frappe-ui' import { FeatherIcon } from 'frappe-ui'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { computed, h } from 'vue' import { computed, h } from 'vue'
import { isMobileView } from '@/stores/settings'
const { getPinnedViews, getPublicViews } = viewsStore() const { getPinnedViews, getPublicViews } = viewsStore()
const { toggle: toggleNotificationPanel } = notificationsStore() const { toggle: toggleNotificationPanel } = notificationsStore()

View File

@ -1,9 +1,6 @@
<template> <template>
<div class="flex border-b pr-5"> <div class="flex border-b pr-5">
<div <div class="z-20 -mr-4 ml-2 flex items-center justify-center">
v-if="isMobileView"
class="z-20 -mr-4 ml-2 flex items-center justify-center"
>
<Button variant="ghosted" @click="sidebarOpened = !sidebarOpened"> <Button variant="ghosted" @click="sidebarOpened = !sidebarOpened">
<FeatherIcon name="menu" class="size-4" /> <FeatherIcon name="menu" class="size-4" />
</Button> </Button>
@ -17,11 +14,6 @@
<script setup> <script setup>
import CallUI from '@/components/CallUI.vue' import CallUI from '@/components/CallUI.vue'
import { useScreenSize } from '@/composables'
import { Button, FeatherIcon } from 'frappe-ui' import { Button, FeatherIcon } from 'frappe-ui'
import { computed } from 'vue'
import { mobileSidebarOpened as sidebarOpened } from '@/stores/settings' import { mobileSidebarOpened as sidebarOpened } from '@/stores/settings'
const screenSize = useScreenSize()
const isMobileView = computed(() => screenSize.width < 640)
</script> </script>

View File

@ -1,5 +1,6 @@
import { createResource } from 'frappe-ui' import { createResource } from 'frappe-ui'
import { ref } from 'vue' import { useScreenSize } from '@/composables'
import { computed, ref } from 'vue'
export const whatsappEnabled = ref(false) export const whatsappEnabled = ref(false)
createResource({ createResource({
@ -21,3 +22,6 @@ createResource({
}) })
export const mobileSidebarOpened = ref(false) export const mobileSidebarOpened = ref(false)
const screenSize = useScreenSize()
export const isMobileView = computed(() => screenSize.width < 768)