Skip to content

Commit

Permalink
Merge pull request #2348 from SadafKausar2025/dashbord
Browse files Browse the repository at this point in the history
Corrected the Home page and Dashboard page
  • Loading branch information
codervivek5 authored Oct 19, 2024
2 parents deac8c9 + 323f2d4 commit 91bca48
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
19 changes: 6 additions & 13 deletions src/User/components/Aside/Aside.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from "react-redux";
import Swal from "sweetalert2";
import { Link, useNavigate, useLocation } from "react-router-dom";
import { GoArrowRight } from "react-icons/go";
import { FaSignOutAlt } from "react-icons/fa";
import { FaSignOutAlt } from "react-icons/fa";

const iconStyles = { height: "20px", width: "20px" };
const lordIcons = {
Expand Down Expand Up @@ -38,8 +38,7 @@ const CartIcon = ({ collapsed }) => {
icon={lordIcons.cart}
label="Cart"
collapsed={collapsed}
isActive={window.location.pathname === "/dashboard-cart"}
>
isActive={window.location.pathname === "/dashboard-cart"}>
{!collapsed && (
<div className="absolute right-2 top-1 bg-red-500 text-xs text-white rounded-full w-5 h-5 flex items-center justify-center mt-1">
{noOfItems}
Expand All @@ -59,8 +58,7 @@ const WishlistIcon = ({ collapsed }) => {
icon={lordIcons.wishlist}
label="Wishlist"
collapsed={collapsed}
isActive={window.location.pathname === "/dashboard-wishlist"}
>
isActive={window.location.pathname === "/dashboard-wishlist"}>
{!collapsed && (
<div className="absolute right-2 top-1 bg-red-500 text-xs text-white rounded-full w-5 h-5 flex items-center justify-center mt-1">
{noOfItem}
Expand Down Expand Up @@ -127,7 +125,7 @@ const Aside = () => {

return (
<aside
className={`bg-[#2d4031] text-white flex flex-col fixed top-0 mt-20 ${
className={`bg-[#2d4031] text-white flex flex-col fixed top-0 mt-1 ${
collapsed ? "w-20" : "w-64"
} transition-width duration-300`}
style={{ position: "sticky" }}>
Expand Down Expand Up @@ -178,8 +176,7 @@ const Aside = () => {
icon={lordIcons.notifications}
label="Notifications"
collapsed={collapsed}
isActive={window.location.pathname === "/dashboard-notifications"}
>
isActive={window.location.pathname === "/dashboard-notifications"}>
{!collapsed && (
<span className="absolute right-2 top-1 bg-red-500 text-xs text-white rounded-full w-5 h-5 flex items-center justify-center mt-1">
2
Expand Down Expand Up @@ -213,11 +210,7 @@ const Aside = () => {
borderRadius: "8px",
border: "1px solid #98bf8cff",
}}>
{collapsed ? (
<FaSignOutAlt className="text-white" />
) : (
"Logout"
)}
{collapsed ? <FaSignOutAlt className="text-white" /> : "Logout"}
</button>
</div>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/User/pages/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Dashboard = () => {
<Aside />

{/* Main Content */}
<main className="flex-1 p-6 mt-20">
<main className="flex-1 p-6 mt-10">
{/* Header */}
<Header />

Expand Down
23 changes: 13 additions & 10 deletions src/User/pages/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ const Home = () => {

// Filter categories and products for suggestions
const filteredSuggestions = [
...popularCategories.filter(category => category.name.toLowerCase().includes(term.toLowerCase())),
...latestProducts.filter(product => product.name.toLowerCase().includes(term.toLowerCase()))
...popularCategories.filter((category) =>
category.name.toLowerCase().includes(term.toLowerCase())
),
...latestProducts.filter((product) =>
product.name.toLowerCase().includes(term.toLowerCase())
),
];
setSuggestions(filteredSuggestions);
};
Expand All @@ -157,14 +161,14 @@ const Home = () => {
};

return (
<div className="bg-[#fff0e3ff]" style={{ transform: "translateY(20px)" }}>
<main className="mt-1">
<div className="bg-[#fff0e3ff]">
<main className="">
<div className="sm:block md:hidden bg-[#eff0f1] pt-5">
<SearchBar
searchTerm={searchTerm}
handleSearch={handleSearch}
suggestions={suggestions}
handleSuggestionClick={handleSuggestionClick}
<SearchBar
searchTerm={searchTerm}
handleSearch={handleSearch}
suggestions={suggestions}
handleSuggestionClick={handleSuggestionClick}
/>
</div>
{/* Hero Section */}
Expand Down Expand Up @@ -323,4 +327,3 @@ const Home = () => {
};

export default Home;

0 comments on commit 91bca48

Please sign in to comment.