mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
17 lines
367 B
TypeScript
17 lines
367 B
TypeScript
|
import { computed } from "@nuxtjs/composition-api";
|
||
|
import { useSidebar } from "./useSidebar";
|
||
|
|
||
|
export function useBackdrop() {
|
||
|
const { isOpen: isSidbarOpen, close: closeSidbar } = useSidebar();
|
||
|
|
||
|
const isShown = computed(() => isSidbarOpen.value);
|
||
|
|
||
|
function close() {
|
||
|
if (isSidbarOpen.value) {
|
||
|
closeSidbar();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return { isShown, close };
|
||
|
}
|