@functionalcms/svelte-components 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
<script>import { Header, HeaderNav, HeaderNavItem, MenuItem } from "agnostic-svelte";
|
|
2
2
|
import { Visiblity } from "./HeaderNavigationItem.js";
|
|
3
|
+
import { get } from "svelte/store";
|
|
3
4
|
export let companyName;
|
|
4
5
|
export let logoUrl;
|
|
5
6
|
export let pages;
|
|
6
7
|
export let authentication;
|
|
7
|
-
const selectVisible = (pages2, visiblity) =>
|
|
8
|
-
|
|
8
|
+
const selectVisible = (pages2, visiblity) => {
|
|
9
|
+
console.log(visiblity);
|
|
10
|
+
return pages2.filter((page) => page.visiblity === Visiblity.Always || page.visiblity === visiblity);
|
|
11
|
+
};
|
|
9
12
|
$:
|
|
10
|
-
|
|
13
|
+
visibility = authentication ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
|
|
14
|
+
$:
|
|
15
|
+
visibleNavItems = selectVisible(pages, visibility);
|
|
11
16
|
</script>
|
|
12
|
-
|
|
13
17
|
<div class="header">
|
|
14
18
|
<Header>
|
|
15
19
|
<div slot="logoleft">
|