Skip to content

Commit 3dbd3ae

Browse files
authored
Merge pull request #1 from hibatillah/tim9-guest
Tim9 guest
2 parents dbc122a + 7d07c96 commit 3dbd3ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1536
-12
lines changed

tim9/frontend/src/App.jsx

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,77 @@
1-
import * as React from 'react';
2-
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
3-
1+
import * as React from "react";
2+
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
3+
import Footer from "./components/Footer";
4+
import { MenuCard, TestimoniCard } from "./components/Card";
5+
import Home from "./pages/customer/Home";
6+
import Product from "./pages/customer/Product";
7+
import Cart from "./pages/customer/Cart";
8+
import Payment from "./pages/customer/Payment";
9+
import HeaderAdmin from "./components/HeaderAdmin";
10+
import Sidebar from "./components/Sidebar";
11+
import Dashboard from "./pages/admin/Dashboard";
12+
import DashboardSupplier from "./pages/supplier/DashboardSupplier";
13+
import Pesanan from "./pages/admin/Pesanan";
14+
import Supplier from "./pages/admin/Supplier";
15+
import Calender from "./pages/admin/Calender";
16+
import { DataProduct } from "./pages/admin/DataProduct";
17+
import HeaderSupplier from "./components/HeaderSupplier";
18+
import SidebarSupplier from "./components/SidebarSupplier";
19+
import BahanBaku from "./pages/supplier/BahanBaku";
20+
import Permintaan from "./pages/supplier/Permintaan";
21+
import Form from "./pages/supplier/Form";
422
function App() {
523
// login state
6-
const [isLogin, setIsLogin] = React.useState(false);
24+
const [isLogin, setIsLogin] = React.useState(true);
725
const handleLogin = () => setIsLogin(!isLogin);
826

927
// user state
10-
const [user, setUser] = React.useState();
28+
const [user, setUser] = React.useState("supplier");
1129
const handleUser = (id) => setUser(id);
12-
30+
1331
return (
1432
<Router>
1533
{!isLogin ? (
1634
<>
17-
35+
<Routes>
36+
<Route path="/" element={<Home />} />
37+
<Route path="/product" element={<Product />} />
38+
<Route path="/cart" element={<Cart />} />
39+
<Route path="/payment" element={<Payment />} />
40+
</Routes>
1841
</>
1942
) : (
20-
<>
21-
22-
</>
43+
<div className="w-full h-screen flex">
44+
{user === "admin" ? (
45+
<Sidebar user={user} />
46+
):(<SidebarSupplier />)}
47+
<div className="flex-auto h-screen overflow-y-scroll bg-[#f5f5f5]">
48+
{user === "admin" ? (
49+
<HeaderAdmin />
50+
):(<HeaderSupplier />)}
51+
<Routes>
52+
{user === "admin" ? (
53+
<>
54+
<Route path="/dashboard" element={<Dashboard />} />
55+
<Route path="/pesanan" element={<Pesanan />} />
56+
<Route path="/supplier" element={<Supplier />} />
57+
<Route path="/calender" element={<Calender />} />
58+
<Route path="/product" element={<DataProduct />} />
59+
</>
60+
) :user === "supplier"? (
61+
<>
62+
<Route path="/dashboard-suplier" element={<DashboardSupplier />} />
63+
<Route path="/bahanbaku" element={<BahanBaku />} />
64+
<Route path="/permintaan" element={<Permintaan />} />
65+
<Route path="/form" element={<Form />} />
66+
</>
67+
): (
68+
<>
69+
70+
</>
71+
)}
72+
</Routes>
73+
</div>
74+
</div>
2375
)}
2476
</Router>
2577
);
292 KB
Loading
1.02 KB
Loading
1.33 KB
Loading
2.27 KB
Loading
3.45 KB
Loading
270 Bytes
Loading
221 KB
Loading

tim9/frontend/src/assets/img/index.js

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tim9/frontend/src/assets/img/logo-usr.svg

Lines changed: 10 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)