feat: rewrite to solidjs

This commit is contained in:
Tholut A 2026-08-21 15:28:21 +07:00
parent 74c6215c27
commit afa2db26e7
21 changed files with 1074 additions and 1835 deletions

46
entrypoints/popup/App.tsx Normal file
View file

@ -0,0 +1,46 @@
import { createSignal } from "solid-js";
import "./style.css";
import { MainToggle } from "@/components/MainToggle";
import { BlockedSite } from "@/components/BlockedSite";
import { Todo } from "@/components/Todo";
function App() {
const menus = ["main", "completed", "blocked sites"];
const [menu, setMenu] = createSignal("main");
return (
<>
<div>
<MainToggle />
<h1>let me focus</h1>
<ul class="menu">
<For each={menus}>
{(menu) => (
<li>
<button onClick={() => setMenu(menu)}>[{menu}]</button>
</li>
)}
</For>
</ul>
<Suspense>
<Switch>
<Match when={menu() === "main"}>
<Todo showInput hoverShowDeleteButton />
</Match>
<Match when={menu() === "completed"}>
<Todo showOnlyCompleted showClearAllTodo />
</Match>
<Match when={menu() === "blocked sites"}>
<BlockedSite />
</Match>
</Switch>
</Suspense>
<br />[{browser.runtime.getManifest().version}]
</div>
</>
);
}
export default App;