Skip to content

Commit

Permalink
fix: update Elements Drawer usage; rename useMenu to useBodyLock and …
Browse files Browse the repository at this point in the history
…move it to Elements
bdrtsky committed Jun 12, 2023
1 parent 9682397 commit a3fedc5
Showing 4 changed files with 28 additions and 65 deletions.
36 changes: 27 additions & 9 deletions components/app/AppHeaderDrawer.vue
Original file line number Diff line number Diff line change
@@ -11,30 +11,48 @@ const links = computed(() => {
})
})
const { visible, open, close } = useMenu()
const { locked, lock, unlock } = useBodyLock()
watch(visible, v => (v ? open() : close()))
watch(locked, v => (v ? lock() : unlock()))
</script>

<template>
<button aria-label="Menu" @click="open">
<Icon name="heroicons-outline:menu" aria-hidden="”true”" />
<button
aria-label="Menu"
@click="lock"
>
<Icon
name="heroicons-outline:menu"
aria-hidden="”true”"
/>
</button>

<!-- eslint-disable-next-line vue/no-multiple-template-root -->
<Drawer v-model="visible">
<nav class="nav" @click.stop>
<Drawer v-model="locked">
<nav
class="nav"
@click.stop
>
<div class="drawer-header">
<button aria-label="Menu" @click="close">
<Icon name="heroicons-outline:x" aria-hidden="”true”" />
<button
aria-label="Menu"
@click="unlock"
>
<Icon
name="heroicons-outline:x"
aria-hidden="”true”"
/>
</button>

<div class="icons">
<AppSocialIcons />
</div>
</div>

<DocsNavigation :links="links" class="links" />
<DocsNavigation
:links="links"
class="links"
/>
</nav>
</Drawer>
</template>
5 changes: 0 additions & 5 deletions composables/useMenu.ts

This file was deleted.

48 changes: 0 additions & 48 deletions plugins/menu.ts

This file was deleted.

4 changes: 1 addition & 3 deletions tokens.config.ts
Original file line number Diff line number Diff line change
@@ -648,14 +648,12 @@ export default defineTheme({
dark: 'rgba({temp.color.gray.900}, 0.8)'
}
},
// border?
// surface?

codeGroup: {
margin: '{typography.verticalMargin.base} 0px'
},

drawer: {
modal: {
scrim: {
backgroundColor: {
initial: 'rgba({temp.color.gray.50}, 0.95)',

0 comments on commit a3fedc5

Please sign in to comment.