Skip to content

Commit eadb3b9

Browse files
MANISHIMWESaltonAime-Patrick
authored andcommitted
resolving bugs
1 parent 49aaf3e commit eadb3b9

File tree

4 files changed

+144
-115
lines changed

4 files changed

+144
-115
lines changed

src/assets/styles/Search.scss

+86-78
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,91 @@
1-
.wrappers{
1+
.wrappers {
22
background-color: $container-color;
3+
34
.upper-side {
4-
display: flex;
5-
align-items: center;
6-
height: 10rem;
7-
font-size: 1.5rem;
8-
padding: 5rem;
9-
border-bottom: 2px solid rgba(119, 119, 119, 0.49);
5+
display: flex;
6+
align-items: center;
7+
font-size: 1.5rem;
8+
padding: 2rem 5rem;
9+
border-bottom: 2px solid rgba(119, 119, 119, 0.49);
10+
11+
.product-name {
12+
font-size: 2rem;
13+
font-weight: 700;
14+
color: $text-color;
15+
margin-right: 2rem;
16+
}
17+
18+
.filter-option {
19+
display: flex;
20+
gap: 10rem;
21+
22+
.selection-part {
23+
display: flex;
24+
align-items: center;
25+
gap: 2rem;
26+
font-size: 2rem;
27+
font-weight: 700;
28+
color: $text-color;
29+
30+
}
31+
32+
.search-Span-price {
33+
font-size: 2rem;
34+
font-weight: 700;
35+
color: $text-color;
36+
margin-right: 2rem;
37+
}
38+
39+
.dropdown-select {
40+
41+
gap: 2rem;
42+
font-size: 2rem;
43+
font-weight: 700;
44+
color: $text-color;
45+
border: 1px solid rgba(255, 109, 24, 0.49);
46+
border-radius: 4px;
47+
padding: 0.5rem 2rem;
48+
font-size: 15px;
49+
cursor: pointer;
50+
}
51+
}
52+
53+
.discount-display {
54+
font-size: 2rem;
55+
display: flex;
56+
align-items: center;
57+
}
58+
}
59+
60+
.product-main {
61+
display: flex;
62+
63+
.product-list {
64+
display: flex;
65+
flex-wrap: wrap;
66+
margin: 3rem 3rem;
67+
margin-left: 5rem;
68+
gap: 3rem;
69+
}
70+
71+
.loader-spinner {
72+
display: flex;
73+
justify-content: center;
74+
align-items: center;
75+
margin-left: 70rem;
76+
margin-top: 20rem;
77+
}
1078

11-
.product-name{
12-
font-size: 2rem;
13-
font-weight: 700;
14-
color: $text-color;
15-
margin-right: 2rem;
16-
}
79+
.noResult {
80+
margin: 0 auto;
81+
display: flex;
82+
flex-direction: column;
83+
margin-bottom: 1rem;
1784

18-
.filter-option{
19-
display: flex;
20-
gap: 10rem;
21-
22-
.selection-part{
23-
display: flex;
24-
align-items: center;
25-
gap: 2rem;
26-
font-size: 2rem;
27-
font-weight: 700;
28-
color: $text-color;
29-
30-
}
31-
.search-Span-price{
32-
font-size: 2rem;
33-
font-weight: 700;
34-
color: $text-color;
35-
margin-right: 2rem;
36-
}
37-
.dropdown-select{
38-
39-
gap: 2rem;
40-
font-size: 2rem;
41-
font-weight: 700;
42-
color: $text-color;
43-
border: 1px solid rgba(255, 109, 24, 0.49);
44-
border-radius: 4px;
45-
padding: 0.5rem 2rem ;
46-
font-size: 15px;
47-
cursor: pointer;
48-
}
49-
}
50-
.discount-display{
51-
font-size: 2rem;
52-
display: flex;
53-
align-items: center;
54-
}
55-
}
56-
.product-main{
57-
display: flex;
58-
.product-list{
59-
display: flex;
60-
flex-wrap: wrap;
61-
margin: 3rem 3rem;
62-
margin-left: 5rem;
63-
gap: 3rem;
64-
}
65-
.loader-spinner {
66-
display: flex;
67-
justify-content: center;
68-
align-items: center;
69-
margin-left: 70rem;
70-
margin-top: 20rem;
71-
}
72-
.noResult{
73-
margin: 0 auto;
74-
display: flex;
75-
flex-direction: column;
76-
margin-bottom: 1rem;
77-
img{
78-
width: auto;
79-
height: 400px;
80-
}
81-
}
82-
}
85+
img {
86+
width: auto;
87+
height: 400px;
88+
}
89+
}
90+
}
8391
}

src/router.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable*/
22
/* eslint-disable */
33
import React from "react";
4-
import { Navigate, Route, Routes } from "react-router-dom";
4+
import { Navigate, Route, Routes, } from "react-router-dom";
55
import LandingPage from "./pages/LandingPage";
66
import { SignUp } from "./pages/SignUp";
77
import NotFound from "./pages/NotFound";
@@ -17,6 +17,7 @@ import ViewProduct from "./pages/ViewProduct";
1717
import UserLogin from "./pages/UserLogin";
1818
import SellerLogin from "./pages/SellerLogin";
1919
import AdminLogin from "./pages/AdminLogin";
20+
import Search from "./pages/Search";
2021

2122
const AppRouter: React.FC = () => {
2223
return (

src/utils/types/product.d.ts

+47-35
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,56 @@
1+
export interface IProducts {
2+
nextPage:number;
3+
currentPage: number;
4+
previousPage:number;
5+
limit:number;
6+
data:[];
7+
error?:string
8+
}
9+
export interface IProductsState {
10+
searchProduct: searchProduct;
11+
}
12+
113
/* eslint-disable @typescript-eslint/indent */
214
export interface IProduct {
3-
id: string;
4-
shopId: string;
5-
name: string;
6-
description?: string;
7-
price: number;
8-
discount?: string;
9-
category: string;
10-
expiryDate?: Date;
11-
expired: boolean;
12-
bonus?: string;
13-
images: string[];
14-
quantity: number;
15-
status: string;
16-
createdAt: Date;
17-
updatedAt: Date;
18-
productReviews: IProductReview[];
19-
shops: IShop;
15+
id: string;
16+
shopId: string;
17+
name: string;
18+
description?: string;
19+
price: number;
20+
discount?: string;
21+
category: string;
22+
expiryDate?: Date;
23+
expired: boolean;
24+
bonus?: string;
25+
images: string[];
26+
quantity: number;
27+
status: string;
28+
createdAt: Date;
29+
updatedAt: Date;
30+
productReviews: IProductReview[];
31+
shops: IShop;
2032
}
2133

2234
export interface IProductReview {
23-
id: string;
24-
productId: string;
25-
userId: string;
26-
feedback: string;
27-
rating: number;
28-
status: boolean;
29-
createdAt: Date;
30-
updatedAt: Date;
31-
user?: {
32-
firstName?: string;
33-
lastName?: string;
34-
profilePicture?: string;
35-
}
35+
id: string;
36+
productId: string;
37+
userId: string;
38+
feedback: string;
39+
rating: number;
40+
status: boolean;
41+
createdAt: Date;
42+
updatedAt: Date;
43+
user?: {
44+
firstName?: string;
45+
lastName?: string;
46+
profilePicture?: string;
47+
}
3648
}
3749

3850
export interface IShop {
39-
id: string;
40-
userId: string;
41-
name: string;
42-
description?: string;
43-
image?: string;
51+
id: string;
52+
userId: string;
53+
name: string;
54+
description?: string;
55+
image?: string;
4456
}

src/utils/types/store.d.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,12 @@ export interface INotificationInitialResource {
9696
message: string | null,
9797
passwordExpiryMessage: string | null,
9898
isLoggedOut: boolean
99-
}
99+
}
100+
101+
export interface SearchCriteria {
102+
name?: string;
103+
category?: string;
104+
minPrice?: number;
105+
maxPrice?: number;
106+
discount?: number;
107+
}

0 commit comments

Comments
 (0)