mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 11:39:15 +00:00
docs: 📝 update docs
This commit is contained in:
38
packages/docs/src/components/core/ToggleMenu.tsx
Normal file
38
packages/docs/src/components/core/ToggleMenu.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { component$, useStore } from '@builder.io/qwik'
|
||||
|
||||
import { IconMenu } from '~/components/icons/IconMenu'
|
||||
|
||||
interface ItemProps {
|
||||
iconClass?: string
|
||||
}
|
||||
|
||||
export default component$((props: ItemProps) => {
|
||||
const { iconClass } = props
|
||||
|
||||
const store = useStore({
|
||||
isExpanded: false,
|
||||
})
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
class={`ml-1.5 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition ${
|
||||
store.isExpanded ? 'expanded' : ''
|
||||
}`}
|
||||
aria-label="Toggle Menu"
|
||||
data-aw-toggle-menu={true}
|
||||
onClick$={() => {
|
||||
store.isExpanded = store.isExpanded ? false : true
|
||||
|
||||
// TODO:
|
||||
document.body.classList.toggle('overflow-hidden')
|
||||
document.getElementById('header')?.classList.toggle('h-screen')
|
||||
document
|
||||
.querySelector('#header nav')
|
||||
?.classList.toggle('hidden')
|
||||
}}
|
||||
>
|
||||
<IconMenu class={iconClass} />
|
||||
</button>
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user