diff --git a/app/learn/layout.tsx b/app/learn/layout.tsx index 194d45e..7d87b20 100644 --- a/app/learn/layout.tsx +++ b/app/learn/layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useLayoutEffect, useRef, useState } from "react"; import { Footer } from "../../components/Footer"; import Nav, { NavLink, NavLinks, NavSpace } from "../../components/Nav"; import TopBorder from "../../components/TopBorder"; @@ -40,8 +40,8 @@ interface LearnLayoutProps { } export default function LearnLayout({ children }: LearnLayoutProps) { - const width = useWindowWidth(); const xlWidth = Number(theme.screens.xl.replace("px", "")); + const width = useWindowWidth(xlWidth); const xl = width >= xlWidth; const scrollRef = useRef(null); @@ -61,18 +61,14 @@ export default function LearnLayout({ children }: LearnLayoutProps) { - {xl && ( - - )} +
- {!xl && ( - - )} +
{children}