AnoPaper/src/App.jsx

36 lines
1.1 KiB
React
Raw Normal View History

2022-10-17 13:50:40 +03:00
import "./App.css";
import { Routes, Route } from "react-router-dom";
import Menu from "./components/menu";
import CreateNote from "./pages/create";
2022-10-20 17:55:09 +03:00
import Save from "./pages/save-local";
import Note from "./pages/note";
2022-10-20 21:37:09 +03:00
import Notes from "./pages/notes";
2022-10-17 13:50:40 +03:00
function App() {
2022-10-18 18:32:25 +03:00
Storage.prototype.setObj = function (key, obj) {
return this.setItem(key, JSON.stringify(obj));
};
Storage.prototype.getObj = function (key) {
2022-10-20 17:55:09 +03:00
return JSON.parse(this.getItem(key)) || {};
2022-10-18 18:32:25 +03:00
};
2022-10-17 13:50:40 +03:00
return (
<div className="grid grid-cols-4 lg:grid-cols-5 gap-10 text-black dark:text-white">
<Menu />
<div className="col-span-4 p-5 m-4 rounded-2xl">
<Routes>
<Route path="/" element={<CreateNote />} />
2022-10-20 17:55:09 +03:00
<Route path="/notes/save-local" element={<Save />} />
<Route path="/notes/:id" element={<Note />} />
2022-10-17 13:50:40 +03:00
<Route
path="/about"
element={<div className="col-span-4">О сервисе</div>}
/>
2022-10-20 21:37:09 +03:00
<Route path="/notes" element={<Notes />} />
2022-10-17 13:50:40 +03:00
</Routes>
</div>
</div>
);
}
export default App;