refactor: replace dice roller with menu button in home page
This commit is contained in:
committed by
Alexander Harding (aider)
parent
8ee55532f3
commit
275047fbfb
+5
-25
@@ -1,31 +1,11 @@
|
||||
"use client";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import type { DiceRollerHandle, RollResult } from "@/components/DiceRoller";
|
||||
import { Button } from "@/components/DiceSelector";
|
||||
|
||||
const DiceRoller = dynamic(() => import("@/components/DiceRoller"), {
|
||||
ssr: false,
|
||||
});
|
||||
import MenuButton from "@/components/MenuButton";
|
||||
|
||||
export default function Home() {
|
||||
const rollerRef = useRef<DiceRollerHandle>(null);
|
||||
|
||||
const [savedRolls, setSavedRolls] = useState([])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="relative bg-bg w-screen h-screen">
|
||||
<div className="absolute left-0 bottom-0">
|
||||
<Button rollerRef={rollerRef} />
|
||||
<div className="flex flex-col h-screen">
|
||||
<main className="flex-1 flex flex-col items-center justify-center gap-6">
|
||||
<MenuButton text="Characters" url="/characters" />
|
||||
</main>
|
||||
</div>
|
||||
<div className="absolute right-0 top-0">
|
||||
{savedRolls.map((roll, i) => (
|
||||
<div key={i}>test</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<DiceRoller ref={rollerRef} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user