Skip to content

Commit

Permalink
feat:add pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sanda0 committed Jun 6, 2024
1 parent 8f46e3f commit 139db55
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build/bin
node_modules
frontend/dist

*.txt
*.txt

Empty file added frontend/src/pages/Editor.jsx
Empty file.
Empty file.
13 changes: 10 additions & 3 deletions frontend/src/pages/layouts/MainLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@

import { BadgePlus, Import } from "lucide-react";
import { BadgePlus, Home, Import } from "lucide-react";
import Button from "../../components/Button";
import { Outlet } from "react-router-dom";
import { Outlet, useNavigate } from "react-router-dom";

export default function MainLayout() {
const navigate = useNavigate()



return (
<div className="flex w-full h-screen bg-slate-300">
<div className="h-screen w-[300px] bg-slate-700 text-white">
<ul className="p-4 ">
<li ><div className="text-4xl text-center">WebMatic</div></li>
<li className="mt-4">
<Button onClick={(e)=>{alert("hello")}}> <BadgePlus></BadgePlus> New Matic </Button>
<Button onClick={(e)=>{navigate("/")}}> <Home></Home> Home </Button>
</li>
<li className="mt-2">
<Button onClick={(e)=>{navigate("/new")}}> <BadgePlus></BadgePlus> New Matic </Button>
</li>
<li className="mt-2">
<Button> <Import></Import> Import Matic </Button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import NewMatic from "../pages/NewMatic";

const router = createBrowserRouter(createRoutesFromElements(
<Route path="/" element={<MainLayout></MainLayout>}>
<Route path="" element={<NewMatic></NewMatic>}></Route>
<Route path="new" element={<NewMatic></NewMatic>}></Route>
</Route>
));

Expand Down

0 comments on commit 139db55

Please sign in to comment.