fix: added docs link in sidebar

This commit is contained in:
Shariq Ansari 2024-03-31 23:34:15 +05:30
parent deac626596
commit 548b1d9489
2 changed files with 30 additions and 16 deletions

View File

@ -76,21 +76,29 @@
</Section> </Section>
</div> </div>
</div> </div>
<SidebarLink <div class="m-2 flex flex-col gap-1">
:label="isSidebarCollapsed ? 'Expand' : 'Collapse'" <SidebarLink
:isCollapsed="isSidebarCollapsed" label="Docs"
@click="isSidebarCollapsed = !isSidebarCollapsed" :isCollapsed="isSidebarCollapsed"
class="m-2" icon="book-open"
> @click="() => openDocs()"
<template #icon> />
<span class="grid h-5 w-6 flex-shrink-0 place-items-center"> <SidebarLink
<CollapseSidebar :label="isSidebarCollapsed ? 'Expand' : 'Collapse'"
class="h-4.5 w-4.5 text-gray-700 duration-300 ease-in-out" :isCollapsed="isSidebarCollapsed"
:class="{ '[transform:rotateY(180deg)]': isSidebarCollapsed }" @click="isSidebarCollapsed = !isSidebarCollapsed"
/> class=""
</span> >
</template> <template #icon>
</SidebarLink> <span class="grid h-5 w-6 flex-shrink-0 place-items-center">
<CollapseSidebar
class="h-4.5 w-4.5 text-gray-700 duration-300 ease-in-out"
:class="{ '[transform:rotateY(180deg)]': isSidebarCollapsed }"
/>
</span>
</template>
</SidebarLink>
</div>
<Notifications /> <Notifications />
</div> </div>
</template> </template>
@ -113,6 +121,7 @@ import SidebarLink from '@/components/SidebarLink.vue'
import Notifications from '@/components/Notifications.vue' import Notifications from '@/components/Notifications.vue'
import { viewsStore } from '@/stores/views' import { viewsStore } from '@/stores/views'
import { notificationsStore } from '@/stores/notifications' import { notificationsStore } from '@/stores/notifications'
import { FeatherIcon } from 'frappe-ui'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { computed } from 'vue' import { computed } from 'vue'
@ -222,4 +231,8 @@ function getIcon(routeName) {
return PinIcon return PinIcon
} }
} }
function openDocs() {
window.open('https://docs.frappe.io/crm', '_blank')
}
</script> </script>

View File

@ -12,7 +12,8 @@
<Tooltip :text="label" placement="right"> <Tooltip :text="label" placement="right">
<slot name="icon"> <slot name="icon">
<span class="grid h-5 w-6 flex-shrink-0 place-items-center"> <span class="grid h-5 w-6 flex-shrink-0 place-items-center">
<component :is="icon" class="h-4 w-4 text-gray-700" /> <FeatherIcon v-if="typeof icon == 'string'" :name="icon" class="h-4 w-4 text-gray-700" />
<component v-else :is="icon" class="h-4 w-4 text-gray-700" />
</span> </span>
</slot> </slot>
</Tooltip> </Tooltip>