diff --git a/src/App.css b/src/App.css index 4cf6cb2..e0ca5f7 100644 --- a/src/App.css +++ b/src/App.css @@ -4,7 +4,7 @@ html, body { - @apply h-screen w-screen bg-zinc-600 text-zinc-200; + @apply h-screen w-screen bg-zinc-600 text-zinc-200 overflow-x-hidden; } @layer base { diff --git a/src/App.tsx b/src/App.tsx index c112fac..fd311b4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,22 @@ +import { useState } from "preact/hooks"; import "./App.css"; import SaveSelector from "./views/SaveSelector"; +import Patcher from "./views/Patcher"; function App() { + const [currentSave, setCurrentSave] = useState(null); + return (
- + {currentSave === null ? ( + { + setCurrentSave(path); + }} + /> + ) : ( + + )}
); } diff --git a/src/views/Patcher.tsx b/src/views/Patcher.tsx new file mode 100644 index 0000000..3f51b8b --- /dev/null +++ b/src/views/Patcher.tsx @@ -0,0 +1,35 @@ +import { useEffect, useState } from "preact/hooks"; + +interface PatcherProps { + className?: string; + path: string; +} + +export default function Patcher({ path }: PatcherProps) { + const [filename, setFilename] = useState(null); + + async function setup() { + const filename = path.split("\\").pop(); + if (filename) setFilename(filename.split(".")[0]); + } + + async function teardown() {} + + useEffect(() => { + setup(); + return () => { + teardown(); + }; + }, []); + + return ( +
+
+

{filename}

+

+ {path} +

+
+
+ ); +}