diff --git a/package.json b/package.json
index ee7acca..01c72bd 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
- "serve": "^12.0.0"
+ "serve": "^12.0.0",
+ "wouter": "^2.7.4"
}
}
diff --git a/src/App/index.tsx b/src/App/index.tsx
index 1c5b2c0..1218a8e 100644
--- a/src/App/index.tsx
+++ b/src/App/index.tsx
@@ -1,22 +1,19 @@
-import { Route } from "~/types/router";
import React from "react";
+import { Route, Switch } from "wouter";
import { Bookshelf } from "~/pages/Bookshelf";
+import { BookView } from "~/pages/BookView";
import { UploadForm } from "~/pages/UploadForm";
-import { Router } from "~/router";
-import { Err404 } from "~/router/404";
-
import styles from "./App.module.css";
-const routes: Route[] = [
- { Component: Bookshelf, path: "/list" },
- { Component: UploadForm, path: "/upload" },
-];
-
export const App = () => (
-
+
+
+
+
+
);
diff --git a/src/pages/BookView/index.tsx b/src/pages/BookView/index.tsx
new file mode 100644
index 0000000..4c1aa08
--- /dev/null
+++ b/src/pages/BookView/index.tsx
@@ -0,0 +1,8 @@
+import React from "react";
+import { useRoute } from "wouter";
+
+export const BookView = () => {
+ const [match, params] = useRoute("/:hash");
+
+ return ;
+};
diff --git a/src/pages/Bookshelf/AddBook/index.tsx b/src/pages/Bookshelf/AddBook/index.tsx
index 96f1ef2..dd4551f 100644
--- a/src/pages/Bookshelf/AddBook/index.tsx
+++ b/src/pages/Bookshelf/AddBook/index.tsx
@@ -1,15 +1,17 @@
import React from "react";
+import { useLocation } from "wouter";
import plusIcon from "~/assets/plus.svg";
import styles from "./AddBook.module.css";
import { BASE_URL } from "~/constants";
-import { goTo } from "~/router/goTo";
export const AddBook = () => {
+ const [_, setLocation] = useLocation();
+
return (