Skip to content

Commit

Permalink
persist reducer added
Browse files Browse the repository at this point in the history
  • Loading branch information
Noor Mohammad authored and Noor Mohammad committed Feb 13, 2023
1 parent d546406 commit fdc55b5
Show file tree
Hide file tree
Showing 26 changed files with 172 additions and 53 deletions.
12 changes: 6 additions & 6 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/static/css/main.e5c9e4b3.css",
"main.js": "/static/js/main.4630310c.js",
"main.css": "/static/css/main.ef13128c.css",
"main.js": "/static/js/main.7889d053.js",
"static/media/bannerImgTwo.webp": "/static/media/bannerImgTwo.d93152138c5c9da3de58.webp",
"static/media/bannerImgThree.webp": "/static/media/bannerImgThree.cdd63ff84acf53a73a0d.webp",
"static/media/saleImgTwo.webp": "/static/media/saleImgTwo.ecb733524e878406c281.webp",
Expand All @@ -23,11 +23,11 @@
"static/media/newArrTwo.webp": "/static/media/newArrTwo.bdc7d9372116bdf40cc4.webp",
"static/media/newArrOne.webp": "/static/media/newArrOne.5982a995e5c312914fe6.webp",
"index.html": "/index.html",
"main.e5c9e4b3.css.map": "/static/css/main.e5c9e4b3.css.map",
"main.4630310c.js.map": "/static/js/main.4630310c.js.map"
"main.ef13128c.css.map": "/static/css/main.ef13128c.css.map",
"main.7889d053.js.map": "/static/js/main.7889d053.js.map"
},
"entrypoints": [
"static/css/main.e5c9e4b3.css",
"static/js/main.4630310c.js"
"static/css/main.ef13128c.css",
"static/js/main.7889d053.js"
]
}
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/smallLogo.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/smallLogo.ico"/><link rel="manifest" href="/manifest.json"/><title>OREBI Shopping | Experience the better</title><script defer="defer" src="/static/js/main.4630310c.js"></script><link href="/static/css/main.e5c9e4b3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/smallLogo.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/smallLogo.ico"/><link rel="manifest" href="/manifest.json"/><title>OREBI Shopping | Experience the better</title><script defer="defer" src="/static/js/main.7889d053.js"></script><link href="/static/css/main.ef13128c.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions build/static/js/main.4630310c.js

This file was deleted.

3 changes: 3 additions & 0 deletions build/static/js/main.7889d053.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"react-router-dom": "^6.6.0",
"react-scripts": "5.0.1",
"react-slick": "^0.29.0",
"redux-persist": "^6.0.0",
"slick-carousel": "^1.8.1",
"tailwind-scrollbar": "^2.1.0",
"web-vitals": "^2.1.4"
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Contact from "./pages/Contact/Contact";
import Home from "./pages/Home/Home";
import Journal from "./pages/Journal/Journal";
import Offer from "./pages/Offer/Offer";
import Payment from "./pages/payment/Payment";
import ProductDetails from "./pages/ProductDetails/ProductDetails";
import Shop from "./pages/Shop/Shop";

Expand Down Expand Up @@ -49,6 +50,7 @@ const router = createBrowserRouter(
<Route path="/offer" element={<Offer />}></Route>
<Route path="/product/:_id" element={<ProductDetails />}></Route>
<Route path="/cart" element={<Cart />}></Route>
<Route path="/paymentgateway" element={<Payment />}></Route>
</Route>
<Route path="/signup" element={<SignUp />}></Route>
<Route path="/signin" element={<SignIn />}></Route>
Expand Down
15 changes: 8 additions & 7 deletions src/components/SpecialCase/SpecialCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import { useSelector } from "react-redux";

const SpecialCase = () => {
const products = useSelector((state) => state.orebiReducer.products);
console.log(products.length);
return (
<div className="fixed top-52 right-2 z-20 hidden md:flex flex-col gap-2">
<div className="bg-white w-16 h-[70px] rounded-md flex flex-col gap-1 text-[#33475b] justify-center items-center shadow-testShadow overflow-x-hidden group cursor-pointer">
<div className="flex justify-center items-center">
<MdSwitchAccount className="text-2xl -translate-x-12 group-hover:translate-x-3 transition-transform duration-200" />
<Link to="/signin">
<div className="bg-white w-16 h-[70px] rounded-md flex flex-col gap-1 text-[#33475b] justify-center items-center shadow-testShadow overflow-x-hidden group cursor-pointer">
<div className="flex justify-center items-center">
<MdSwitchAccount className="text-2xl -translate-x-12 group-hover:translate-x-3 transition-transform duration-200" />

<MdSwitchAccount className="text-2xl -translate-x-3 group-hover:translate-x-12 transition-transform duration-200" />
<MdSwitchAccount className="text-2xl -translate-x-3 group-hover:translate-x-12 transition-transform duration-200" />
</div>
<p className="text-xs font-semibold font-titleFont">Profile</p>
</div>
<p className="text-xs font-semibold font-titleFont">Profile</p>
</div>
</Link>
<Link to="/cart">
<div className="bg-white w-16 h-[70px] rounded-md flex flex-col gap-1 text-[#33475b] justify-center items-center shadow-testShadow overflow-x-hidden group cursor-pointer relative">
<div className="flex justify-center items-center">
Expand Down
4 changes: 4 additions & 0 deletions src/components/home/BestSellers/BestSellers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const BestSellers = () => {
<Heading heading="Our Bestsellers" />
<div className="w-full grid grid-cols-1 md:grid-cols-2 lgl:grid-cols-3 xl:grid-cols-4 gap-10">
<Product
_id="1011"
img={bestSellerOne}
productName="Flower Base"
price="35.00"
Expand All @@ -22,6 +23,7 @@ const BestSellers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1012"
img={bestSellerTwo}
productName="New Backpack"
price="180.00"
Expand All @@ -30,6 +32,7 @@ const BestSellers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1013"
img={bestSellerThree}
productName="Household materials"
price="25.00"
Expand All @@ -38,6 +41,7 @@ const BestSellers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1014"
img={bestSellerFour}
productName="Travel Bag"
price="220.00"
Expand Down
5 changes: 5 additions & 0 deletions src/components/home/NewArrivals/NewArrivals.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const NewArrivals = () => {
<Slider {...settings}>
<div className="px-2">
<Product
_id="100001"
img={newArrOne}
productName="Round Table Clock"
price="44.00"
Expand All @@ -62,6 +63,7 @@ const NewArrivals = () => {
</div>
<div className="px-2">
<Product
_id="100002"
img={newArrTwo}
productName="Smart Watch"
price="250.00"
Expand All @@ -72,6 +74,7 @@ const NewArrivals = () => {
</div>
<div className="px-2">
<Product
_id="100003"
img={newArrThree}
productName="cloth Basket"
price="80.00"
Expand All @@ -82,6 +85,7 @@ const NewArrivals = () => {
</div>
<div className="px-2">
<Product
_id="100004"
img={newArrFour}
productName="Funny toys for babies"
price="60.00"
Expand All @@ -92,6 +96,7 @@ const NewArrivals = () => {
</div>
<div className="px-2">
<Product
_id="100005"
img={newArrTwo}
productName="Funny toys for babies"
price="60.00"
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/Products/Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Product = (props) => {
onClick={() =>
dispatch(
addToCart({
_id: props.id,
_id: props._id,
name: props.productName,
quantity: 1,
image: props.img,
Expand Down
6 changes: 3 additions & 3 deletions src/components/home/Sale/Sale.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ const Sale = () => {
return (
<div className="py-20 flex flex-col md:flex-row items-center justify-between gap-4 lg:gap-10">
<div className="w-full md:w-2/3 lg:w-1/2 h-full">
<Link to="#">
<Link to="/shop">
<Image className="h-full w-full object-cover" imgSrc={saleImgOne} />
</Link>
</div>
<div className="w-full md:w-2/3 lg:w-1/2 h-auto flex flex-col gap-4 lg:gap-10">
<div className="h-1/2 w-full">
<Link to="#">
<Link to="/shop">
<Image className="h-full w-full object-cover" imgSrc={saleImgTwo} />
</Link>
</div>
<div className="h-1/2 w-full">
<Link to="#">
<Link to="/shop">
<Image
className="h-full w-full object-cover"
imgSrc={saleImgThree}
Expand Down
4 changes: 4 additions & 0 deletions src/components/home/SpecialOffers/SpecialOffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SpecialOffers = () => {
<Heading heading="Special Offers" />
<div className="w-full grid grid-cols-1 md:grid-cols-2 lgl:grid-cols-3 xl:grid-cols-4 gap-10">
<Product
_id="1101"
img={spfOne}
productName="Cap for Boys"
price="35.00"
Expand All @@ -22,6 +23,7 @@ const SpecialOffers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1102"
img={spfTwo}
productName="Tea Table"
price="180.00"
Expand All @@ -30,6 +32,7 @@ const SpecialOffers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1103"
img={spfThree}
productName="Headphones"
price="25.00"
Expand All @@ -38,6 +41,7 @@ const SpecialOffers = () => {
des="Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic excepturi quibusdam odio deleniti reprehenderit facilis."
/>
<Product
_id="1104"
img={spfFour}
productName="Sun glasses"
price="220.00"
Expand Down
30 changes: 20 additions & 10 deletions src/components/pageProps/productDetails/ProductInfo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from "react";
import { useDispatch } from "react-redux";
import { addToCart } from "../../../redux/orebiSlice";

const ProductInfo = ({ productInfo }) => {
const dispatch = useDispatch();
console.log(productInfo);
return (
<div className="flex flex-col gap-5">
<h2 className="text-4xl font-semibold">{productInfo.productName}</h2>
Expand All @@ -10,16 +14,22 @@ const ProductInfo = ({ productInfo }) => {
<p className="font-medium text-lg">
<span className="font-normal">Colors:</span> {productInfo.color}
</p>
<p className="w-full h-14 flex items-center justify-between bg-white">
<span className="w-14 h-full text-2xl flex items-center justify-center hover:bg-gray-200 duration-300 cursor-pointer">
-
</span>
1
<span className="w-14 h-full text-2xl flex items-center justify-center hover:bg-gray-200 duration-300 cursor-pointer">
+
</span>
</p>
<button className="w-full py-4 bg-primeColor hover:bg-black duration-300 text-white text-lg font-titleFont">
<button
onClick={() =>
dispatch(
addToCart({
_id: productInfo.id,
name: productInfo.productName,
quantity: 1,
image: productInfo.img,
badge: productInfo.badge,
price: productInfo.price,
colors: productInfo.color,
})
)
}
className="w-full py-4 bg-primeColor hover:bg-black duration-300 text-white text-lg font-titleFont"
>
Add to Cart
</button>
<p className="font-normal text-sm">
Expand Down
2 changes: 1 addition & 1 deletion src/components/pageProps/shopPage/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Items({ currentItems }) {
currentItems.map((item) => (
<div key={item._id} className="w-full">
<Product
id={item._id}
_id={item._id}
img={item.img}
productName={item.productName}
price={item.price}
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { PersistGate } from "redux-persist/integration/react";
import "slick-carousel/slick/slick.css";
import { Provider } from "react-redux";
import { store } from "./redux/store";
import { store, persistor } from "./redux/store";
import "./index.css";
import App from "./App";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<Provider store={store}>
<App />
<PersistGate loading={null} persistor={persistor}>
<App />
</PersistGate>
</Provider>
);
2 changes: 1 addition & 1 deletion src/pages/Account/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const SignIn = () => {
onClick={handleSignUp}
className="bg-primeColor hover:bg-black text-gray-200 hover:text-white cursor-pointer w-full text-base font-medium h-10 rounded-md duration-300"
>
Create Account
Sign In
</button>
<p className="text-sm text-center font-titleFont font-medium">
Don't have an Account?{" "}
Expand Down
Loading

1 comment on commit fdc55b5

@vercel
Copy link

@vercel vercel bot commented on fdc55b5 Feb 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

orebishopping – ./

orebishopping-noorjsdivs.vercel.app
orebishopping.vercel.app
orebishopping-git-master-noorjsdivs.vercel.app

Please sign in to comment.