Webview: add welcome workflow

This commit is contained in:
Johannes Kirschbauer
2024-07-11 16:34:55 +02:00
parent ac413a4d13
commit af4e843131
17 changed files with 412 additions and 379 deletions

View File

@@ -1,4 +1,4 @@
import { currClanURI } from "../App";
import { activeURI, setRoute } from "../App";
export const Header = () => {
return (
@@ -14,12 +14,12 @@ export const Header = () => {
</span>
</div>
<div class="flex-1">
<a class="text-xl">{currClanURI() || "Clan"}</a>
<a class="text-xl">{activeURI()}</a>
</div>
<div class="flex-none">
<span class="tooltip tooltip-bottom" data-tip="Account">
<button class="btn btn-square btn-ghost">
<span class="material-icons">account_circle</span>
<span class="tooltip tooltip-bottom" data-tip="Settings">
<button class="link" onClick={() => setRoute("settings")}>
<span class="material-icons">settings</span>
</button>
</span>
</div>

View File

@@ -1,13 +1,17 @@
import { Component, JSXElement } from "solid-js";
import { Component, JSXElement, Show } from "solid-js";
import { Header } from "./header";
import { Sidebar } from "../Sidebar";
import { route, setRoute } from "../App";
import { effect } from "solid-js/web";
interface LayoutProps {
children: JSXElement;
}
export const Layout: Component<LayoutProps> = (props) => {
effect(() => {
console.log(route());
});
return (
<>
<div class="drawer bg-base-100 lg:drawer-open">
@@ -17,11 +21,16 @@ export const Layout: Component<LayoutProps> = (props) => {
class="drawer-toggle hidden"
/>
<div class="drawer-content">
<Header />
<Show when={route() !== "welcome"}>
<Header />
</Show>
{props.children}
</div>
<div class="drawer-side z-40">
<div
class="drawer-side z-40"
classList={{ "!hidden": route() === "welcome" }}
>
<label
for="toplevel-drawer"
aria-label="close sidebar"