source: frontend/src/screens/AdminDashboardScreen.js

Last change on this file was a2e5735, checked in by Nace Gjorgjievski <nace.gorgievski123@…>, 19 months ago

Final Version

  • Property mode set to 100644
File size: 1.7 KB
Line 
1import React, { useContext, useEffect, useState } from "react";
2import Button from "react-bootstrap/Button";
3import "../styles/AdminDashboard.css";
4import AddProductForm from "../components/AddProductForm";
5import { Store } from "../Store";
6import { useNavigate, Link } from "react-router-dom";
7import ListProducts from "../components/ListProducts";
8import { Helmet } from "react-helmet-async";
9
10function AdminDashboardScreen() {
11 const navigate = useNavigate();
12 const { state } = useContext(Store);
13 const { userInfo } = state;
14 useEffect(() => {
15 if (!userInfo || !userInfo.isAdmin) {
16 return navigate("/");
17 }
18 }, [userInfo, navigate]);
19
20 return (
21 <div id="pgContainer">
22 <Helmet>
23 <title>Dashboard</title>
24 </Helmet>
25 <div id="sidebarMenu">
26 <Link
27 to={"/admin/addProduct"}
28 style={{ textDecoration: "none", width: "100%" }}
29 >
30 <div className="dashboard-btn" to="/admin/addProduct">
31 Додади нов производ
32 </div>
33 </Link>
34 <Link
35 to={"/admin/addCategory"}
36 style={{ textDecoration: "none", width: "100%" }}
37 >
38 <div className="dashboard-btn">Додади категорија</div>
39 </Link>
40 <Link
41 to={"/admin/products"}
42 style={{ textDecoration: "none", width: "100%" }}
43 >
44 <div className="dashboard-btn">Производи</div>
45 </Link>
46 <Link
47 to={"/admin/orders"}
48 style={{ textDecoration: "none", width: "100%" }}
49 >
50 <div className="dashboard-btn">Нарачки</div>
51 </Link>
52 </div>
53 </div>
54 );
55}
56
57export default AdminDashboardScreen;
Note: See TracBrowser for help on using the repository browser.