Skip to content

Commit

Permalink
docs(AppDrawerAppend): add rail toggle for subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Oct 5, 2023
1 parent df2a373 commit f710ccf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/docs/src/components/app/drawer/Append.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
<template>
<v-divider />

<git-hub-login />
<v-hover>
<template #default="{ props: hoverProps, isHovering }">
<div v-bind="hoverProps">
<v-expand-transition v-if="auth.isSubscriber">
<drawer-toggle-rail v-if="isHovering" />
</v-expand-transition>

<git-hub-login />
</div>
</template>
</v-hover>
</template>

<script setup>
// Components
import DrawerToggleRail from '@/components/app/drawer/DrawerToggleRail.vue'
import GitHubLogin from '@/components/app/GitHubLogin.vue'
// Stores
import { useAuthStore } from '@/store/auth'
const auth = useAuthStore()
</script>
26 changes: 26 additions & 0 deletions packages/docs/src/components/app/drawer/DrawerToggleRail.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div>
<v-list-item
:prepend-icon="icon"
@click="onClick"
/>
</div>
</template>

<script setup>
// Stores
import { useUserStore } from '@/store/user'
// Utilities
import { computed } from 'vue'
const user = useUserStore()
const icon = computed(() => {
return user.railDrawer ? 'mdi-chevron-double-right' : 'mdi-chevron-double-left'
})
function onClick () {
user.railDrawer = !user.railDrawer
}
</script>
2 changes: 2 additions & 0 deletions packages/docs/src/plugins/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export {
mdiCheckboxBlankOutline,
mdiCheckboxMarked,
mdiCheckboxMarkedCircle,
mdiChevronDoubleLeft,
mdiChevronDoubleRight,
mdiChevronDown,
mdiChevronLeft,
mdiChevronRight,
Expand Down

0 comments on commit f710ccf

Please sign in to comment.