-
+
+
{props.children}
diff --git a/packages/solid/src/components/shell/Navigation.tsx b/packages/solid/src/components/shell/Navigation.tsx
index cb47240..3eb1898 100644
--- a/packages/solid/src/components/shell/Navigation.tsx
+++ b/packages/solid/src/components/shell/Navigation.tsx
@@ -1,4 +1,4 @@
-import { createSignal, For } from "solid-js";
+import { Component, createSignal, For } from "solid-js";
import { HomeIcon } from "../icons/Home";
import { MusicIcon } from "../icons/Music";
import {
@@ -6,41 +6,148 @@ import {
NavigationRail,
NavigationRailAction,
NavigationRailActions,
- NavigationRailMenu
+ NavigationRailMenu,
+ AppBar,
+ AppBarLeadingElement,
+ AppBarSearchBox,
+ AppBarTrailingElementGroup,
+ AppBarTrailingElement,
+ IconButton
} from "@m3-components/solid";
import { A } from "@solidjs/router";
import { AlbumIcon } from "~/components/icons/Album";
import { SearchIcon } from "../icons/Search";
+import { Portal } from "solid-js/web";
export const [activeTab, setActiveTab] = createSignal(-1);
export const [navigationExpanded, setNavigationExpanded] = createSignal(false);
-export const actions = [
+
+interface Action {
+ icon: Component;
+ label: string;
+ href: string;
+}
+
+export const actions: Action[] = [
{
- icon:
,
+ icon: HomeIcon,
label: "主页",
href: "/"
},
{
- icon:
,
+ icon: MusicIcon,
label: "歌曲",
href: "/songs"
},
{
- icon:
,
+ icon: AlbumIcon,
label: "专辑",
href: "/albums"
}
];
-export const NavigationRegion = () => {
+export const actionsEn: Action[] = [
+ {
+ icon: HomeIcon,
+ label: "Home",
+ href: "/en/"
+ },
+ {
+ icon: MusicIcon,
+ label: "Songs",
+ href: "/en/songs"
+ },
+ {
+ icon: AlbumIcon,
+ label: "Albums",
+ href: "/en/albums"
+ }
+];
+
+export const tabMap = {
+ "/": 0,
+ "/song*": 1,
+ "/song/**/*": 1,
+ "/albums": 2,
+ "/album/**/*": 2,
+ "/en/": 0,
+ "/en/songs": 1,
+ "/en/song*": 1,
+ "/en/song/**/*": 1,
+ "/en/albums": 2,
+ "/en/album/**/*": 2
+};
+
+const searchT = {
+ zh: "搜索",
+ en: "Search"
+};
+
+export const NavigationMobile: Component<{ lang?: "zh" | "en" }> = (props) => {
+ let el: HTMLDivElement | undefined;
return (
-
- setNavigationExpanded(!navigationExpanded())} />
-
+ <>
+ setNavigationExpanded(!navigationExpanded())}
+ />
+
+
+ setNavigationExpanded(!navigationExpanded())}
+ />
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export const NavigationRegion: Component<{ lang?: "zh" | "en" }> = (props) => {
+ return (
+
+ setNavigationExpanded(!navigationExpanded())} />
+
-
+
{(action, index) => (
(
{children}
+
{scripts}