diff --git a/src/components/ui/layout/Default.tsx b/src/components/ui/layout/Default.tsx
index 7cddcca..a5b7d9a 100644
--- a/src/components/ui/layout/Default.tsx
+++ b/src/components/ui/layout/Default.tsx
@@ -1,6 +1,7 @@
import Header from '../Header';
import Footer from '../Footer';
-import { ReactNode } from 'react';
+import { ReactNode, useState } from 'react';
+import Drawer from './Drawer';
interface Props {
children?: ReactNode
@@ -9,12 +10,18 @@ interface Props {
}
export default function DefaultLayout({ children, onDarkThemeChanged, darkModeEnabled }: Props) {
+ const [open, setOpen] = useState(false);
+
return (
+ {/*
*/}
);
diff --git a/src/components/ui/layout/Drawer.tsx b/src/components/ui/layout/Drawer.tsx
new file mode 100644
index 0000000..338d258
--- /dev/null
+++ b/src/components/ui/layout/Drawer.tsx
@@ -0,0 +1,47 @@
+import { ReactElement } from 'react';
+
+type Props = {
+ open: boolean;
+ setOpen: (open: boolean) => void;
+ children: ReactElement
+}
+
+const Drawer = ({ open, setOpen, children }: Props) => {
+ const transitionVisible = open ? 'opacity-100 duration-500 ease-in-out visible': 'opacity-0 duration-500 ease-in-out invisible';
+ const transitionWidth = open ? 'translate-x-0': 'translate-x-full';
+ return (
+ setOpen(!open)}
+ >
+
+
+
+
+
{
+ event.preventDefault();
+ event.stopPropagation();
+ }}
+ >
+
+ {children}
+
+
+
+
+
+
+ );
+};
+
+export default Drawer;