From 6ab0298b1be4a364066ddf9e9eb3ddbd905fbd63 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sat, 12 Aug 2023 13:44:35 +0200 Subject: [PATCH] add: fix responsive layout transition --- pkgs/ui/pconf.cjs | 1 + pkgs/ui/src/app/layout.tsx | 15 +++++++++++---- pkgs/ui/src/components/sidebar/index.tsx | 14 +++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pkgs/ui/pconf.cjs b/pkgs/ui/pconf.cjs index fa7765f54..f72fee6f8 100644 --- a/pkgs/ui/pconf.cjs +++ b/pkgs/ui/pconf.cjs @@ -1,4 +1,5 @@ // prettier.config.js module.exports = { plugins: ["prettier-plugin-tailwindcss"], + tailwindFunctions: ["clsx", "tw"], }; diff --git a/pkgs/ui/src/app/layout.tsx b/pkgs/ui/src/app/layout.tsx index 9cc1ef4aa..82233b193 100644 --- a/pkgs/ui/src/app/layout.tsx +++ b/pkgs/ui/src/app/layout.tsx @@ -16,8 +16,8 @@ import { StyledEngineProvider } from "@mui/material/styles"; import { darkTheme, lightTheme } from "./theme/themes"; import { Sidebar } from "@/components/sidebar"; import MenuIcon from "@mui/icons-material/Menu"; -import { ChevronLeft } from "@mui/icons-material"; import Image from "next/image"; +import { tw } from "@/utils/tailwind"; const roboto = localFont({ src: [ @@ -29,6 +29,9 @@ const roboto = localFont({ ], }); +// add negative margin for smooth transition to fill the space of the sidebar +const translate = tw`lg:-ml-64 -ml-14`; + export default function RootLayout({ children, }: { @@ -65,8 +68,12 @@ export default function RootLayout({ show={showSidebar} onClose={() => setShowSidebar(false)} /> -
-
+
+
}
-
+
Clan Logo
@@ -91,15 +91,15 @@ export function Sidebar(props: SidebarProps) {
-
+
- + {menuEntries.map((menuEntry, idx) => { return ( - +

Clan.lol Admin