Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Feb 29, 2024
1 parent f86704e commit 6bb7628
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function Header({
);
}

export const loader = (props: Props, req: Request, ctx: AppContext) => {
export const loader = (props: Props, _req: Request, ctx: AppContext) => {
return { ...props, device: ctx.device };
};

Expand Down
5 changes: 4 additions & 1 deletion components/header/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import NavItem from "./NavItem.tsx";
import { navbarHeight } from "./constants.ts";
import { Buttons, Logo } from "$store/components/header/Header.tsx";

// Make it sure to render it on the server only. DO NOT render it on an island
function Navbar(
{ items, searchbar, logo, buttons, logoPosition = "left", device }: {
items: SiteNavigationElement[];
Expand All @@ -27,6 +28,7 @@ function Navbar(
) {
const platform = usePlatform();

// Mobile header
if (device === "mobile") {
return (
<div
Expand Down Expand Up @@ -63,8 +65,9 @@ function Navbar(
);
}

// Desktop header
return (
<div class="hidden lg:grid lg:grid-cols-3 items-center border-b border-base-200 w-full px-6">
<div class="hidden sm:grid sm:grid-cols-3 items-center border-b border-base-200 w-full px-6">
<ul
class={`flex gap-6 col-span-1 ${
logoPosition === "left" ? "justify-center" : "justify-start"
Expand Down
2 changes: 1 addition & 1 deletion sections/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from "$store/components/header/Header.tsx";
export { default, loader } from "$store/components/header/Header.tsx";

0 comments on commit 6bb7628

Please sign in to comment.