Skip to content

Commit

Permalink
Merge pull request #8 from MuhammadShakkeer2030/feature/productGallery
Browse files Browse the repository at this point in the history
style:updated darkmode in productsGroup & products displaying
  • Loading branch information
muhammadshakkeerp authored Feb 19, 2024
2 parents 4364419 + 5d21d83 commit 2efb9b1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/assets/globalUtlities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const rowProductsData = [
{
id: 1,
title: "title",
img: "/imgs/demo_row_products/1.png",
img: "./imgs/demo_row_products/1.png",
price: 20,
quantity: 0,
offerAvailable: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ProductCard = ({
}: {
product: ProductProps | undefined;
index: number;
refreshSite:boolean
refreshSite: boolean
}) => {
return (
<div className="w-[100px] md:w-[160px] h-[150px] md:h-[212px] border img-card-p flex-shrink-0 md:mx-2">
Expand Down
3 changes: 2 additions & 1 deletion src/components/ProductFilterSiderbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ProductFilterSiderbar = () => {
{ value: 5, label: '5 stars' },
];
return (
<div className="w-full xl:w-1/5 bg-white">
<div className="w-full xl:w-1/5 ">
{/* this style will be displayed untill screen size is 1270px */}
<div className='flex justify-evenly xl:hidden'>
<button className="flexCenter">Sort<PiSortAscending />
Expand All @@ -70,6 +70,7 @@ export const ProductFilterSiderbar = () => {
<div className="relative mb-6">
<h4 className="px-2 py-1 text-center">PRICE</h4>
<input
title='Set Your Price Range'
type="range"
min="0"
max="100"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductGroupsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { headerCategories } from "../assets/HeaderCatogoryData"

export const ProductGroupsTab = () => {
return (
<ul className="h-[40px] bg-white flex items-center justify-evenly">{headerCategories?.map((category, index) => <li key={index} className="text-[14px] font-semibold">{category.title}</li>)}
<ul className="h-[40px] flex items-center justify-evenly">{headerCategories?.map((category, index) => <li key={index} className="text-[14px] font-semibold">{category.title}</li>)}
</ul>
)
}
9 changes: 6 additions & 3 deletions src/pages/ProductsGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { useSelector } from "react-redux"
import { rowProductsData } from "../assets/globalUtlities"
import { ProductCard, ProductFilterSiderbar, ProductGroupsTab } from "../paths"
import { RootState } from "../redux/store"

const ProductsGroup = () => {
const darkMode = useSelector((state: RootState) => state?.dark)
return (
<div className="mt-1 md:mt-2">
<div className={`mt-1 md:mt-2 ${darkMode?.isEnabled ? "bg-darkModeBg" : "bg-white"} `}>
<ProductGroupsTab />
<section className="flex flex-col xl:flex-row mt-2">
<ProductFilterSiderbar />
<div className="flex flex-wrap justify-between gap-2 bg-black ml-2" >
{rowProductsData?.map((_item, index) => <ProductCard product={undefined} index={index} refreshSite={false} />)}
<div className="flex flex-wrap gap-2 ml-2" >
{rowProductsData?.map((item, index) => <ProductCard product={item} index={index} refreshSite={false} />)}
</div>
</section>
</div>
Expand Down

0 comments on commit 2efb9b1

Please sign in to comment.