Skip to content

Commit 1186659

Browse files
authored
Merge pull request #27 from atlp-rwanda/ft-header-nav-#187984455
#187984455 header navigation
2 parents a60a1e6 + ecd5111 commit 1186659

32 files changed

+540
-281
lines changed

Diff for: index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/phoenix.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Eagles Ecommerce</title>
88
</head>

Diff for: public/phoenix.png

36.9 KB
Loading

Diff for: src/App.css

+18-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ body {
7474
}
7575
.breadcrumbs .crumb a {
7676
color: #161616;
77-
font-size: 20px;
77+
font-size: 18px;
7878
font-weight: 500;
7979
}
8080

@@ -96,3 +96,20 @@ input[type="date"]::-webkit-datetime-edit-year-field:focus {
9696
color: white;
9797
outline: none;
9898
}
99+
100+
.categories-list {
101+
-ms-overflow-style: none;
102+
scrollbar-width: none;
103+
}
104+
.active-category {
105+
position: relative;
106+
font-weight: bold;
107+
}
108+
.active-category::after {
109+
content: "";
110+
display: block;
111+
width: 100%;
112+
height: 2px;
113+
background-color: white;
114+
margin-top: 1px;
115+
}

Diff for: src/__test__/chatWindow.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { render, screen, fireEvent } from "@testing-library/react";
22
import MockAdapter from "axios-mock-adapter";
33
import { configureStore } from "@reduxjs/toolkit";
44

5-
import ChatWindow from "../page-sections/chat/ChatWindow";
5+
import ChatWindow from "../page-sections/ChatWindow";
66
import api from "../redux/api/api";
77
import chatSlice from "../redux/reducers/chatSlice";
88

Diff for: src/__test__/hero-test.test.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@ describe("Testing HeroSection Component", () => {
2020

2121
expect(screen.getByTestId("hero-section")).toBeInTheDocument();
2222
expect(screen.getByText("Your One-Stop Online Market")).toBeInTheDocument();
23-
// expect(screen.getByText("Electronic Market")).toBeInTheDocument();
2423
expect(screen.getByText(/Welcome to eagles/i)).toBeInTheDocument();
2524
expect(screen.getByTestId("get-started-button")).toBeInTheDocument();
26-
expect(screen.getByText("Get Started")).toBeInTheDocument();
27-
28-
// const navLinks = screen.getAllByRole("link");
29-
// const productsLink = screen.getByText("Products");
30-
31-
// expect(productsLink).toBeInTheDocument();
32-
// expect(productsLink).toHaveAttribute("href", "/products");
25+
expect(screen.getByText("Shop Now")).toBeInTheDocument();
3326
});
3427
});

Diff for: src/__test__/userList.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Provider } from "react-redux";
33
import { configureStore } from "@reduxjs/toolkit";
44
import MockAdapter from "axios-mock-adapter";
55

6-
import UserList from "../page-sections/chat/UserList";
6+
import UserList from "../page-sections/UserList";
77
import chatSlice from "../redux/reducers/chatSlice";
88
import api from "../redux/api/api";
99

Diff for: src/assets/eagles.svg

+4
Loading

Diff for: src/assets/phoenix.png

36.9 KB
Loading

Diff for: src/components/common/ProfileDropdown.tsx

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import React from "react";
2+
import { Link } from "react-router-dom";
3+
4+
interface ProfileDropdownProps {
5+
userInfo: any;
6+
}
7+
8+
const ProfileDropdown: React.FC<ProfileDropdownProps> = ({ userInfo }) => (
9+
<div className="absolute right-1 md:right-8 lg:right-8 top-12 w-48 bg-white border-t border-[#DB4444] rounded-md shadow-lg z-50">
10+
<ul className="py-1">
11+
{userInfo ? (
12+
<>
13+
<li>
14+
<Link
15+
to="/profile"
16+
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
17+
>
18+
Profile
19+
</Link>
20+
</li>
21+
{userInfo.roleId === 1 && (
22+
<li>
23+
<Link
24+
to="/orders"
25+
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
26+
>
27+
My Orders
28+
</Link>
29+
</li>
30+
)}
31+
{(userInfo.roleId === 2 || userInfo.roleId === 3) && (
32+
<li>
33+
<Link
34+
to={userInfo.roleId === 2 ? "/dashboard" : "/admin"}
35+
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
36+
>
37+
My Dashboard
38+
</Link>
39+
</li>
40+
)}
41+
<li>
42+
<Link
43+
to="/"
44+
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
45+
>
46+
Logout
47+
</Link>
48+
</li>
49+
</>
50+
) : (
51+
<li>
52+
<Link
53+
to="/login"
54+
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
55+
>
56+
Login
57+
</Link>
58+
</li>
59+
)}
60+
</ul>
61+
</div>
62+
);
63+
64+
export default ProfileDropdown;

Diff for: src/components/common/breadcrum/BreadCrum.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const BreadCrums: React.FC<IBreadCrumbsProps> = ({
4444
);
4545
});
4646
return (
47-
<div className=" px-3 flex justify-between items-center">
48-
<div className="breadcrumbs flex-1">{crums}</div>
47+
<div className="w-full px-[5%] flex justify-between items-center">
48+
<div className="breadcrumbs flex-1 text-sm">{crums}</div>
4949
{location.pathname === "/products" && (
5050
<div className="flex items-center" onClick={handleClick}>
5151
<FaFilter

Diff for: src/components/common/featured-products/FeaturedProducts.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const FeaturedProducts = () => {
4343
return (
4444
<div className="my-5">
4545
<div className="flex items-center gap-2 p-3">
46-
<p className="w-5 h-9 bg-red-400 rounded-md" />
47-
<p className="text-red-400">Our Products</p>
46+
<p className="w-5 h-9 bg-[#DB4444] rounded-md" />
47+
<p className="text-[#DB4444] font-medium">Our Products</p>
4848
</div>
4949
<Typography className="p-3 font-bold" variant="h5">
5050
Featured Products
@@ -76,8 +76,8 @@ const FeaturedProducts = () => {
7676
return (
7777
<div className="my-5">
7878
<div className="flex items-center gap-2 p-3">
79-
<p className="w-5 h-9 bg-red-400 rounded-md" />
80-
<p className="text-red-400">Our Products</p>
79+
<p className="w-5 h-9 bg-[#DB4444] rounded-md" />
80+
<p className="text-[#DB4444] font-medium">Our Products</p>
8181
</div>
8282
<Typography className="p-3 font-bold" variant="h5">
8383
Featured Products

0 commit comments

Comments
 (0)