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";
|
2022-10-31 18:31:16 +03:00
|
|
|
import Publish from "./pages/publish";
|
2022-10-20 17:55:09 +03:00
|
|
|
import Note from "./pages/note";
|
2022-10-20 21:37:09 +03:00
|
|
|
import Notes from "./pages/notes";
|
2022-11-01 20:29:32 +03:00
|
|
|
import PubNote from "./pages/pubNote";
|
|
|
|
import PubError from "./pages/pubError";
|
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-31 18:31:16 +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 />} />
|
2022-10-31 18:31:16 +03:00
|
|
|
<Route path="/notes/publish" element={<Publish />} />
|
2022-10-20 17:55:09 +03:00
|
|
|
<Route path="/notes/:id" element={<Note />} />
|
2022-11-01 20:29:32 +03:00
|
|
|
<Route path="/pubNotes/:id" element={<PubNote />} />
|
|
|
|
<Route path="/pubError" element={<PubError />} />
|
2022-10-17 13:50:40 +03:00
|
|
|
<Route
|
|
|
|
path="/about"
|
2022-11-01 21:08:39 +03:00
|
|
|
element={
|
|
|
|
<div className="col-span-4">
|
|
|
|
AnoPaper позволяет анонимно сохранять и опубликовывать заметки.
|
|
|
|
Заметки поддерживают формат markdown. Публичные заметки доступны
|
|
|
|
только по ссылке. Записки которые не публичны записываются
|
|
|
|
только локально и не отправляются на сервер.
|
|
|
|
</div>
|
|
|
|
}
|
2022-10-17 13:50:40 +03:00
|
|
|
/>
|
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;
|