done
This commit is contained in:
parent
ad712108c0
commit
17fc533c25
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@
|
||||||
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
|
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
|
||||||
<!-- fonts -->
|
<!-- fonts -->
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;800&family=Sen:wght@400;700;800&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;800&family=Sen:wght@400;700;800&display=swap" rel="stylesheet">
|
||||||
<script type="module" crossorigin src="/assets/index-S1fS9cGv.js"></script>
|
<script type="module" crossorigin src="/assets/index-DW_yaEwf.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CyAHZLBw.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CyAHZLBw.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
import { useEffect } from "react";
|
|
||||||
import Footer from "./Footer";
|
import Footer from "./Footer";
|
||||||
import Navbar from "./Navbar";
|
import Navbar from "./Navbar";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { showUser } from "../redux/features/userSlice";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
|
|
||||||
const { user } = useSelector((state) => ({ ...state.auth }));
|
const { user } = useSelector((state) => ({ ...state.auth }));
|
||||||
const dispatch = useDispatch();
|
|
||||||
const userId = user?.result?._id;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (userId) {
|
|
||||||
dispatch(showUser(userId));
|
|
||||||
}
|
|
||||||
}, [userId, dispatch]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -25,14 +15,14 @@ const Dashboard = () => {
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<br /> <br /> <br /> <br />
|
<br /> <br /> <br /> <br />
|
||||||
|
|
||||||
|
|
||||||
<main style={{ flex: 1 }}>
|
<main style={{ flex: 1 }}>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
className="py-19 py-md-5 py-xl-8"
|
className="py-19 py-md-5 py-xl-8"
|
||||||
style={{ backgroundColor: "#FFFFFF" }}
|
style={{ backgroundColor: "#FFFFFF" }}
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="container-fluid px-0">
|
<div className="container-fluid px-0">
|
||||||
|
|
||||||
<div className="row gy-4 align-items-center justify-content-center ">
|
<div className="row gy-4 align-items-center justify-content-center ">
|
||||||
|
@ -47,6 +37,9 @@ const Dashboard = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="col-12 col-md-6 col-xl-5">
|
<div className="col-12 col-md-6 col-xl-5">
|
||||||
<div
|
<div
|
||||||
className="card border-0 rounded-4 shadow-lg"
|
className="card border-0 rounded-4 shadow-lg"
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
|
|
||||||
import { NavLink } from "react-router-dom";
|
|
||||||
|
|
||||||
const Header = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
|
|
||||||
<div className="container-fluid p-0 m-0">
|
|
||||||
<nav
|
|
||||||
className="navbar navbar-expand-lg w-100"
|
|
||||||
style={{
|
|
||||||
backgroundColor: "#000000",
|
|
||||||
position: "fixed", // Make the navbar fixed at the top
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
zIndex: 1000, // Ensure the navbar is above other elements
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="container-fluid d-flex align-items-center justify-content-between">
|
|
||||||
|
|
||||||
|
|
||||||
<div className="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
|
|
||||||
<form className="form-inline my-2 my-lg-0">
|
|
||||||
<div className="login_text">
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<NavLink to="/login" className="nav-link">
|
|
||||||
Login
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<i className="fa fa-user" aria-hidden="true" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div className="quote_btn">
|
|
||||||
<NavLink to="/register" className="nav-link">
|
|
||||||
Register
|
|
||||||
</NavLink>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Header
|
|
|
@ -1,13 +1,23 @@
|
||||||
import { NavLink } from "react-router-dom";
|
|
||||||
import logo from "../logo.png";
|
import logo from "../logo.png";
|
||||||
|
|
||||||
const Navbar = () => {
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
|
import { NavLink } from "react-router-dom";
|
||||||
|
import { setLogout } from "../redux/features/authSlice";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
const Navbar = () => {
|
||||||
|
const { user } = useSelector((state) => ({ ...state.auth }));
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleLogout = () => {
|
||||||
|
dispatch(setLogout());
|
||||||
|
navigate("/");
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="container-fluid p-0 m-0">
|
<div
|
||||||
<nav
|
|
||||||
className="navbar navbar-expand-lg w-100"
|
className="navbar navbar-expand-lg w-100"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#000000",
|
backgroundColor: "#000000",
|
||||||
|
@ -63,38 +73,34 @@ const Navbar = () => {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<NavLink to="/contact" className="nav-link">
|
<NavLink to="/contact" className="nav-link">
|
||||||
Contact Us
|
Contact Us
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form className="form-inline my-2 my-lg-0">
|
|
||||||
<div className="login_text">
|
{user?.result?._id ? (
|
||||||
<ul>
|
<NavLink to="/dashboard">Dashboard</NavLink>
|
||||||
<li>
|
) : (
|
||||||
<NavLink to="/login" className="nav-link">
|
|
||||||
Login
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<i className="fa fa-user" aria-hidden="true" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div className="quote_btn">
|
|
||||||
<NavLink to="/register" className="nav-link">
|
<NavLink to="/register" className="nav-link">
|
||||||
Register
|
Register
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
)}
|
||||||
|
|
||||||
</div>
|
{user?.result?._id ? (
|
||||||
</form>
|
<NavLink to="/login">
|
||||||
|
<p className="header-text" onClick={handleLogout}>
|
||||||
|
Logout
|
||||||
|
</p>
|
||||||
|
</NavLink>
|
||||||
|
) : (
|
||||||
|
<NavLink to="/login" className="nav-link">
|
||||||
|
Login
|
||||||
|
</NavLink>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue