summaryrefslogtreecommitdiffstats
path: root/src/pages/index.tsx
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2025-04-28 18:03:28 +0200
committerMaksymilian Jopek <maks@jopek.eu>2025-04-28 18:03:28 +0200
commit0539d6963ebedd554cd3cd36b6c94df9659d6a6b (patch)
tree9408c7928d0725b114d0adfa811ba2bb3859f495 /src/pages/index.tsx
downloadrustberry-frontend-master.tar.gz
rustberry-frontend-master.tar.zst
rustberry-frontend-master.zip
Initial commitHEADmaster
Simple frontend version with mock API
Diffstat (limited to 'src/pages/index.tsx')
-rw-r--r--src/pages/index.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
new file mode 100644
index 0000000..d64f9e1
--- /dev/null
+++ b/src/pages/index.tsx
@@ -0,0 +1,33 @@
+import { For } from "solid-js";
+import { createAsync } from "@solidjs/router";
+
+import Button from "@/components/Button";
+import Timer from "@/components/Timer";
+import { getButtons, getTimers } from "@/helpers/api";
+import styles from "./index.module.css";
+
+export default function Home() {
+ const btns = createAsync(getButtons);
+ const timers = createAsync(getTimers);
+
+ return (
+ <>
+ <div
+ class={styles.btnsCont}
+ style={{ "--rows-count": Math.floor(btns()?.length / 2) }}
+ >
+ <For each={btns()}>{(btn) => <Button {...btn} />}</For>
+ </div>
+ <div class={styles.timersCont}>
+ <For each={timers()}>
+ {(timer) => (
+ <>
+ <hr />
+ <Timer {...timer} />
+ </>
+ )}
+ </For>
+ </div>
+ </>
+ );
+}