aboutsummaryrefslogtreecommitdiffstats
path: root/panel/src
diff options
context:
space:
mode:
Diffstat (limited to 'panel/src')
-rw-r--r--panel/src/components/Navbar.css43
-rw-r--r--panel/src/components/Navbar.jsx54
-rw-r--r--panel/src/pages/Dashboard.css15
3 files changed, 99 insertions, 13 deletions
diff --git a/panel/src/components/Navbar.css b/panel/src/components/Navbar.css
index 76713fb..e28724f 100644
--- a/panel/src/components/Navbar.css
+++ b/panel/src/components/Navbar.css
@@ -3,7 +3,28 @@
padding: 10px 20px;
display: flex;
justify-content: center;
+ align-items: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+ position: relative;
+}
+
+.navbar-container {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ max-width: 1200px;
+}
+
+.menu-icon {
+ color: white;
+ font-size: 2rem;
+ cursor: pointer;
+ width: 35px; /* Adjust the width */
+ height: 35px; /* Make it equal to width for a square */
+ display: none; /* Hidden by default */
+ justify-content: center;
+ align-items: center;
}
.navbar-list {
@@ -28,14 +49,30 @@
color: #FFEB3B;
}
+.mfp-hide {
+ display: none;
+}
+
@media (max-width: 768px) {
- .navbar {
- flex-direction: column;
- align-items: center;
+ .menu-icon {
+ display: flex; /* Show menu icon on mobile screens */
}
.navbar-list {
+ display: none; /* Hide regular menu list on mobile screens */
+ }
+
+ .navbar-list-popup {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ background: #2196F3;
+ width: 100%;
+ height: 100vh;
}
.navbar-item {
diff --git a/panel/src/components/Navbar.jsx b/panel/src/components/Navbar.jsx
index b287e97..d9632e3 100644
--- a/panel/src/components/Navbar.jsx
+++ b/panel/src/components/Navbar.jsx
@@ -1,16 +1,56 @@
-import React from 'react';
+import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
+import MenuIcon from '@mui/icons-material/Menu';
+import CloseIcon from '@mui/icons-material/Close';
+import $ from 'jquery';
+import 'magnific-popup';
+import 'magnific-popup/dist/magnific-popup.css';
import './Navbar.css';
const Navbar = () => {
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
+
+ const toggleMenu = () => {
+ if (!isMenuOpen) {
+ $.magnificPopup.open({
+ items: {
+ src: '#navbar-popup',
+ type: 'inline'
+ },
+ midClick: true,
+ closeOnBgClick: true,
+ callbacks: {
+ open: () => setIsMenuOpen(true),
+ close: () => setIsMenuOpen(false),
+ },
+ });
+ } else {
+ $.magnificPopup.close();
+ }
+ setIsMenuOpen(!isMenuOpen);
+ };
+
return (
<nav className="navbar">
- <ul className="navbar-list">
- <li className="navbar-item"><Link to="/dashboard">Dashboard</Link></li>
- <li className="navbar-item"><Link to="/manage-ads">Manage Ads</Link></li>
- <li className="navbar-item"><Link to="/roles">Roles</Link></li>
- <li className="navbar-item"><Link to="/logout">Logout</Link></li>
- </ul>
+ <div className="navbar-container">
+ <div className="menu-icon" onClick={toggleMenu}>
+ {isMenuOpen ? <CloseIcon /> : <MenuIcon />}
+ </div>
+ <ul className="navbar-list">
+ <li className="navbar-item"><Link to="/dashboard">Dashboard</Link></li>
+ <li className="navbar-item"><Link to="/manage-ads">Manage Ads</Link></li>
+ <li className="navbar-item"><Link to="/roles">Roles</Link></li>
+ <li className="navbar-item"><Link to="/logout">Logout</Link></li>
+ </ul>
+ <div id="navbar-popup" className="mfp-hide">
+ <ul className="navbar-list-popup">
+ <li className="navbar-item"><Link to="/dashboard">Dashboard</Link></li>
+ <li className="navbar-item"><Link to="/manage-ads">Manage Ads</Link></li>
+ <li className="navbar-item"><Link to="/roles">Roles</Link></li>
+ <li className="navbar-item"><Link to="/logout">Logout</Link></li>
+ </ul>
+ </div>
+ </div>
</nav>
);
};
diff --git a/panel/src/pages/Dashboard.css b/panel/src/pages/Dashboard.css
index 024df9b..49a11ed 100644
--- a/panel/src/pages/Dashboard.css
+++ b/panel/src/pages/Dashboard.css
@@ -19,7 +19,7 @@
.dashboard-header {
text-align: center;
- margin-bottom: 30px;
+ margin-bottom: 10px;
}
.dashboard-header h4 {
@@ -43,6 +43,7 @@
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
+
.stat-card h6 {
font-size: 16px;
color: #666;
@@ -55,10 +56,18 @@
}
.chart-container {
- margin-top: 30px;
+ margin-top: 20px;
}
.chart-container canvas {
width: 100% !important;
- height: 400px !important;
+ height: 100% !important;
+}
+
+@media (max-width: 768px) {
+ .stat-card {
+ margin: 0px 4px;
+ padding: 10px;
+ text-align: center;
+ }
}