feat: rewrite to solidjs
This commit is contained in:
parent
74c6215c27
commit
afa2db26e7
21 changed files with 1074 additions and 1835 deletions
46
entrypoints/popup/App.tsx
Normal file
46
entrypoints/popup/App.tsx
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue