Skip to content

Commit

Permalink
fixed fresh component
Browse files Browse the repository at this point in the history
  • Loading branch information
baufaker committed Apr 24, 2024
1 parent 4c092b8 commit d60f684
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions components/header/Drawers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ComponentChildren } from "preact";
import { lazy, Suspense } from "preact/compat";
import type { Logo } from "./Header.tsx";
import Image from "apps/website/components/Image.tsx";
import { IS_BROWSER } from "$fresh/runtime.ts";

const Menu = lazy(() => import("../../components/header/Menu.tsx"));
const Searchbar = lazy(() => import("../../components/search/Searchbar.tsx"));
Expand Down Expand Up @@ -68,15 +69,17 @@ function Drawers({ menu, searchbar, children, platform }: Props) {
const { displayCart, displayMenu, displaySearchDrawer, user } = useUI();

//if user is not loggedin, use the public navitems in the menu
if (localStorage.getItem("AccessToken") == "") {
menu.items = menu.publicItems || [];
} else if (localStorage.getItem("AssociationAdmin")) {
if (!menu.items.find((i) => i.name === "Admin Associação")) {
menu.items[menu.items.length] = {
"@type": "SiteNavigationElement",
name: "Admin Associação",
url: "/admin/associacao",
};
if (IS_BROWSER) {
if (localStorage.getItem("AccessToken") == "") {
menu.items = menu.publicItems || [];
} else if (localStorage.getItem("AssociationAdmin")) {
if (!menu.items.find((i) => i.name === "Admin Associação")) {
menu.items[menu.items.length] = {
"@type": "SiteNavigationElement",
name: "Admin Associação",
url: "/admin/associacao",
};
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion sections/Layout/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clx } from "../../sdk/clx.ts";
import { Section } from "deco/blocks/section.ts";
import type { Section } from "deco/blocks/section.ts";
import type { ComponentChildren } from "preact";
import { flex } from "../../constants.tsx";

Expand Down

0 comments on commit d60f684

Please sign in to comment.