Skip to content

Commit

Permalink
Merge pull request #27 from atlp-rwanda/ft-header-nav-#187984455
Browse files Browse the repository at this point in the history
#187984455 header navigation
  • Loading branch information
teerenzo authored Jul 26, 2024
2 parents a60a1e6 + ecd5111 commit 1186659
Show file tree
Hide file tree
Showing 32 changed files with 540 additions and 281 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/phoenix.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Eagles Ecommerce</title>
</head>
Expand Down
Binary file added public/phoenix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ body {
}
.breadcrumbs .crumb a {
color: #161616;
font-size: 20px;
font-size: 18px;
font-weight: 500;
}

Expand All @@ -96,3 +96,20 @@ input[type="date"]::-webkit-datetime-edit-year-field:focus {
color: white;
outline: none;
}

.categories-list {
-ms-overflow-style: none;
scrollbar-width: none;
}
.active-category {
position: relative;
font-weight: bold;
}
.active-category::after {
content: "";
display: block;
width: 100%;
height: 2px;
background-color: white;
margin-top: 1px;
}
2 changes: 1 addition & 1 deletion src/__test__/chatWindow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen, fireEvent } from "@testing-library/react";
import MockAdapter from "axios-mock-adapter";
import { configureStore } from "@reduxjs/toolkit";

import ChatWindow from "../page-sections/chat/ChatWindow";
import ChatWindow from "../page-sections/ChatWindow";
import api from "../redux/api/api";
import chatSlice from "../redux/reducers/chatSlice";

Expand Down
9 changes: 1 addition & 8 deletions src/__test__/hero-test.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ describe("Testing HeroSection Component", () => {

expect(screen.getByTestId("hero-section")).toBeInTheDocument();
expect(screen.getByText("Your One-Stop Online Market")).toBeInTheDocument();
// expect(screen.getByText("Electronic Market")).toBeInTheDocument();
expect(screen.getByText(/Welcome to eagles/i)).toBeInTheDocument();
expect(screen.getByTestId("get-started-button")).toBeInTheDocument();
expect(screen.getByText("Get Started")).toBeInTheDocument();

// const navLinks = screen.getAllByRole("link");
// const productsLink = screen.getByText("Products");

// expect(productsLink).toBeInTheDocument();
// expect(productsLink).toHaveAttribute("href", "/products");
expect(screen.getByText("Shop Now")).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion src/__test__/userList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from "react-redux";
import { configureStore } from "@reduxjs/toolkit";
import MockAdapter from "axios-mock-adapter";

import UserList from "../page-sections/chat/UserList";
import UserList from "../page-sections/UserList";
import chatSlice from "../redux/reducers/chatSlice";
import api from "../redux/api/api";

Expand Down
4 changes: 4 additions & 0 deletions src/assets/eagles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/phoenix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions src/components/common/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from "react";
import { Link } from "react-router-dom";

interface ProfileDropdownProps {
userInfo: any;
}

const ProfileDropdown: React.FC<ProfileDropdownProps> = ({ userInfo }) => (
<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">
<ul className="py-1">
{userInfo ? (
<>
<li>
<Link
to="/profile"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
>
Profile
</Link>
</li>
{userInfo.roleId === 1 && (
<li>
<Link
to="/orders"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
>
My Orders
</Link>
</li>
)}
{(userInfo.roleId === 2 || userInfo.roleId === 3) && (
<li>
<Link
to={userInfo.roleId === 2 ? "/dashboard" : "/admin"}
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
>
My Dashboard
</Link>
</li>
)}
<li>
<Link
to="/"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
>
Logout
</Link>
</li>
</>
) : (
<li>
<Link
to="/login"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-slate-100"
>
Login
</Link>
</li>
)}
</ul>
</div>
);

export default ProfileDropdown;
4 changes: 2 additions & 2 deletions src/components/common/breadcrum/BreadCrum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const BreadCrums: React.FC<IBreadCrumbsProps> = ({
);
});
return (
<div className=" px-3 flex justify-between items-center">
<div className="breadcrumbs flex-1">{crums}</div>
<div className="w-full px-[5%] flex justify-between items-center">
<div className="breadcrumbs flex-1 text-sm">{crums}</div>
{location.pathname === "/products" && (
<div className="flex items-center" onClick={handleClick}>
<FaFilter
Expand Down
8 changes: 4 additions & 4 deletions src/components/common/featured-products/FeaturedProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const FeaturedProducts = () => {
return (
<div className="my-5">
<div className="flex items-center gap-2 p-3">
<p className="w-5 h-9 bg-red-400 rounded-md" />
<p className="text-red-400">Our Products</p>
<p className="w-5 h-9 bg-[#DB4444] rounded-md" />
<p className="text-[#DB4444] font-medium">Our Products</p>
</div>
<Typography className="p-3 font-bold" variant="h5">
Featured Products
Expand Down Expand Up @@ -76,8 +76,8 @@ const FeaturedProducts = () => {
return (
<div className="my-5">
<div className="flex items-center gap-2 p-3">
<p className="w-5 h-9 bg-red-400 rounded-md" />
<p className="text-red-400">Our Products</p>
<p className="w-5 h-9 bg-[#DB4444] rounded-md" />
<p className="text-[#DB4444] font-medium">Our Products</p>
</div>
<Typography className="p-3 font-bold" variant="h5">
Featured Products
Expand Down
Loading

0 comments on commit 1186659

Please sign in to comment.