Skip to content

Commit

Permalink
Merge branch 'fix/netlify'
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadshakkeerp committed Jul 24, 2024
2 parents 45350b7 + 378a384 commit 6be2aaa
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- feature/Account
- fix/netlify

jobs:
deploy:
Expand Down
5 changes: 2 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Account, Cart, ChatBot, Checkout, Home, NestedHoverNavlink, PaymentSucc
import { ProductProps } from "./types/productTypes";


const App: FC<ProductProps> = () => {
const App: FC = () => {
const [showPopUp, setShowPopUp] = useState(false);
const DarkMode = useSelector((state: { dark: DarkState }) => state?.dark)
// after 4 sec of initial loading
Expand Down Expand Up @@ -47,8 +47,7 @@ const App: FC<ProductProps> = () => {
path="/productDetails/:id"
element={
<ProductDetails
{...productDetails}
/>
{...productDetails} />
}
/>
<Route path="/productDetails/:id/checkout" element={<Checkout />}></Route>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BiChevronDown } from "react-icons/bi";
import { FC, useState } from "react";
import { headerCategories } from "../assets/headerCatogoryData";
import { HeaderCategory, SubCategory } from "../types/layoutTypes";
import { Link } from "react-router-dom";
import { RootState } from "../redux/store";
import { useSelector } from "react-redux";
import { headerCategories } from "../assets/headerCategoryData";

interface headerCategoriesProps {
headerCategories: HeaderCategory[]
Expand All @@ -30,7 +30,7 @@ export const HeaderCatogory: FC<headerCategoriesProps> = () => {
let foundSubCategory: SubCategory[] | undefined;
if (categoryName) {
const foundCategory = headerCategories.find(
(item) => item.title === categoryName
(item: HeaderCategory) => item.title === categoryName
);
if (foundCategory && foundCategory.subCategories) {
foundSubCategory = foundCategory.subCategories;
Expand Down
6 changes: 3 additions & 3 deletions src/components/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { BsHeart } from "react-icons/bs";
import { RiEditBoxLine } from "react-icons/ri";
import { addToCart } from "../redux/actions/cartActions";

const ProductDetails: FC<ProductProps> = () => {
const { id } = useParams();
const ProductDatails: FC<ProductProps> = () => {
const { id } = useParams();
const dispatch = useDispatch();
const darkMode = useSelector((state: RootState) => state?.dark)

Expand Down Expand Up @@ -236,4 +236,4 @@ const ProductDetails: FC<ProductProps> = () => {
);
};

export default ProductDetails
export default ProductDatails
2 changes: 1 addition & 1 deletion src/components/ProductGroupsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { headerCategories } from "../assets/headerCatogoryData"
import { headerCategories } from "../assets/headerCategoryData"

export const ProductGroupsTab = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/paths.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CustomProductsRows } from "./components/CustomProductsRows";
import { Header } from "./components/Header";
import { HeaderCatogory } from "./components/HeaderCatogory";
import { HeaderCatogory } from "./components/HeaderCategory";
import { HomeBanner } from "./components/HomeBanner";
import { HomeSlider } from "./components/HomeSlider";
import { Offer } from "./components/Offer";
Expand Down
2 changes: 1 addition & 1 deletion src/redux/reducers/axiosFetchData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const fetchProductData = createAsyncThunk("product/fetchData", async () =
[axios.get<{ products: Product[] }>('https://dummyjson.com/products'),
axios.get<string[]>('https://dummyjson.com/products')
])

const _products = productsResponse.data.products
console.log(_products)

const categories = categoriesResponse.data

const newCategoryMap: CategoryMap = {};
Expand Down
3 changes: 2 additions & 1 deletion src/types/productTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ interface RatingProps {
interface ProductProps {
id: number;
title: string | undefined;
thumbImg:string;
thumbImg: string;
img: string | undefined;
quantity?: number;
price: number;
quantity?:number;
offerAvailable: boolean;
Expand Down

0 comments on commit 6be2aaa

Please sign in to comment.