add webview threaded api

This commit is contained in:
Johannes Kirschbauer
2024-05-15 14:27:18 +02:00
committed by hsjobeki
parent fef16a84a9
commit 7980f13bed
27 changed files with 359 additions and 80 deletions

View File

@@ -0,0 +1,36 @@
import { Match, Switch, createSignal, type Component } from "solid-js";
import { CountProvider } from "./Config";
import { Nested } from "./nested";
type Route = "home" | "graph";
const App: Component = () => {
const [route, setRoute] = createSignal<Route>("home");
return (
<CountProvider>
<div class="w-full flex items-center flex-col gap-2 my-2">
<div>Clan</div>
<p>Current route: {route()}</p>
<div class="flex items-center">
<button
onClick={() => setRoute((o) => (o === "graph" ? "home" : "graph"))}
class="btn btn-link"
>
Navigate to {route() === "home" ? "graph" : "home"}
</button>
</div>
<Switch fallback={<p>{route()} not found</p>}>
<Match when={route() == "home"}>
<Nested />
</Match>
<Match when={route() == "graph"}>
<p></p>
</Match>
</Switch>
</div>
</CountProvider>
);
};
export default App;