fix: store isSidebarCollapsed in localStorage

This commit is contained in:
Shariq Ansari 2023-09-21 03:35:53 +05:30
parent 262f8fc362
commit c81f6ae61e
2 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ import NoteIcon from '@/components/Icons/NoteIcon.vue'
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
import CollapseSidebar from '@/components/Icons/CollapseSidebar.vue'
import SidebarLink from '@/components/SidebarLink.vue'
import { ref } from 'vue'
import { useStorage } from "@vueuse/core";
const links = [
{
@ -72,5 +72,5 @@ const links = [
},
]
const isSidebarCollapsed = ref(false)
const isSidebarCollapsed = useStorage("sidebar_is_collapsed", false);
</script>

View File

@ -27,16 +27,16 @@
{{ user.full_name }}
</div>
</div>
<FeatherIcon
name="chevron-down"
class="h-4 w-4 duration-300 ease-in-out"
<div
class="duration-300 ease-in-out"
:class="
isCollapsed
? 'opacity-0 ml-0 w-0 overflow-hidden'
: 'opacity-100 ml-2 w-auto'
"
aria-hidden="true"
/>
>
<FeatherIcon name="chevron-down" class="h-4 w-4" aria-hidden="true" />
</div>
</button>
</template>
</Dropdown>