├── src
├── Style
│ ├── index.css
│ └── Navbar.css
├── Pages
│ ├── ProductCard
│ │ ├── Filters
│ │ │ ├── PriceRange.css
│ │ │ ├── Filters.jsx
│ │ │ ├── PriceRange.jsx
│ │ │ └── Accordians.jsx
│ │ ├── Skeleton
│ │ │ └── dataSkeleton.jsx
│ │ ├── carousel.jsx
│ │ ├── Mobile.jsx
│ │ ├── ProductCards.jsx
│ │ ├── Computer.jsx
│ │ ├── Personal.jsx
│ │ ├── Kitchen.jsx
│ │ └── HeadPhone.jsx
│ ├── Payment
│ │ ├── payment.module.css
│ │ └── Dig_Xp.png
│ ├── Wishlist
│ │ ├── MywishList.jsx
│ │ └── wish.module.css
│ ├── Cart
│ │ ├── EmptyCart.jsx
│ │ ├── CartItem.jsx
│ │ ├── Cart.jsx
│ │ └── cart.module.css
│ ├── Home
│ │ ├── Heading.jsx
│ │ ├── ViewButton.jsx
│ │ ├── ImageSet.jsx
│ │ ├── HomeCard1.jsx
│ │ ├── Laptop2.jsx
│ │ ├── BrandPromise.jsx
│ │ ├── Slider3.jsx
│ │ ├── Explore.jsx
│ │ ├── Carousel.jsx
│ │ ├── SliderFormat.jsx
│ │ ├── Laptop.jsx
│ │ ├── Refrigirator.jsx
│ │ └── Home.jsx
│ ├── Login.jsx
│ ├── Register.jsx
│ ├── AdminLogin.jsx
│ └── productdetailpage
│ │ ├── prod.module.css
│ │ └── ProductDetailpage.jsx
├── Redux
│ ├── auth
│ │ ├── auth.actionTypes.js
│ │ ├── auth.action.js
│ │ └── auth.reducer.js
│ ├── Products
│ │ ├── Product.types.js
│ │ ├── product.reducer.js
│ │ ├── ProductApi.js
│ │ └── Product.action.js
│ ├── adminAuth
│ │ ├── adminAuth.actionTypes.js
│ │ ├── adminAuth.action.js
│ │ └── adminAuth.reducer.js
│ ├── admin
│ │ ├── admin.actionTypes.js
│ │ ├── admin.action.js
│ │ └── admin.reducer.js
│ ├── cart
│ │ ├── cart.actionTypes.js
│ │ ├── cart.action.js
│ │ └── cart.reducer.js
│ └── store.js
├── setupTests.js
├── App.test.js
├── reportWebVitals.js
├── Components
│ ├── Loader.jsx
│ ├── Style.jsx
│ ├── NavComponents
│ │ └── dropdown.css
│ ├── PrivateRoute.jsx
│ ├── AdminLoginForm.jsx
│ ├── RegisterForm.jsx
│ ├── LoginForm.jsx
│ ├── Footer.jsx
│ └── Navbar.jsx
├── Admin
│ ├── AdminRequireAuth.jsx
│ ├── Components
│ │ ├── ProductsList.jsx
│ │ ├── ProductItem.jsx
│ │ └── AddProducts.jsx
│ └── Admin.jsx
├── index.js
├── App.js
├── Routers
│ ├── PrivateRoutes.jsx
│ └── AllRoutes.jsx
├── index.css
└── logo.svg
├── public
├── robots.txt
├── Digital.png
├── Digital1.png
├── favicon.ico
├── logo192.png
├── logo512.png
├── manifest.json
└── index.html
├── .gitignore
├── package.json
└── README.md
/src/Style/index.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Filters/PriceRange.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/Pages/Payment/payment.module.css:
--------------------------------------------------------------------------------
1 |
2 | .payhead{
3 | margin: 30px auto;
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/public/Digital.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/public/Digital.png
--------------------------------------------------------------------------------
/public/Digital1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/public/Digital1.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/public/logo512.png
--------------------------------------------------------------------------------
/src/Pages/Payment/Dig_Xp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uttammane1/Reliance-Digital/HEAD/src/Pages/Payment/Dig_Xp.png
--------------------------------------------------------------------------------
/src/Pages/Wishlist/MywishList.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const MywishList = () => {
4 | return (
5 |
6 |
7 |
8 | )
9 | }
10 |
11 | export default MywishList
--------------------------------------------------------------------------------
/src/Redux/auth/auth.actionTypes.js:
--------------------------------------------------------------------------------
1 | // Auth Action Type Code Here
2 |
3 |
4 | export const AUTH_LOGIN = "auth/login";
5 | export const AUTH_LOGOUT = "auth/logout";
6 | export const AUTH_SIGN_UP = "auth/signup";
7 |
--------------------------------------------------------------------------------
/src/Redux/Products/Product.types.js:
--------------------------------------------------------------------------------
1 | export const GET_POSTS_SUCCESS = "get/posts/success";
2 | export const GET_POSTS_ERROR = "get/posts/error";
3 | export const GET_POSTS_LOADING = "get/posts/loading";
4 | export const GET_POSTS_RESET = "get/posts/reset";
5 |
6 | //bm
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render( );
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/src/Redux/adminAuth/adminAuth.actionTypes.js:
--------------------------------------------------------------------------------
1 | export const LOGIN_LOADING = "auth/login/loading";
2 | export const LOGIN_ERROR = "auth/login/error";
3 | export const LOGIN_SUCCESS = "auth/login/success"
4 |
5 | export const LOGOUT = "auth/logout'";
6 |
7 | export const RESET = "auth/reset"
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Filters/Filters.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Accordians from './Accordians';
3 | import PriceRange from "./PriceRange"
4 | const Filters = ({data}) => {
5 |
6 | return (
7 |
12 | )
13 | }
14 |
15 | export default Filters
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 | .vercel
25 |
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/Redux/admin/admin.actionTypes.js:
--------------------------------------------------------------------------------
1 | export const GET_ADMIN_LOADING = "admin/loading";
2 | export const GET_ADMIN_SUCCESS = "admin/success";
3 | export const GET_ADMIN_ERROR = "admin/error";
4 |
5 | export const DELETE_ADMIN_LOADING = "admin/delete/loading";
6 | export const DELETE_ADMIN_SUCCESS = "admin/delete/success";
7 | export const DELETE_ADMIN_ERROR = "admin/delete/error";
8 |
9 | // Reset
10 | export const RESET_ADMIN_PRODUCTS = "admin/reset";
--------------------------------------------------------------------------------
/src/Redux/auth/auth.action.js:
--------------------------------------------------------------------------------
1 | // Auth Action Code Here
2 | import { AUTH_LOGIN, AUTH_LOGOUT, AUTH_SIGN_UP } from "./auth.actionTypes";
3 |
4 | export const userSignUp = (data) => (dispatch) => {
5 | dispatch({ type: AUTH_SIGN_UP, payload: data });
6 | };
7 | export const userLogin = () => (dispatch) => {
8 | dispatch({ type: AUTH_LOGIN });
9 | };
10 | export const userLogout = () => (dispatch) => {
11 | dispatch({ type: AUTH_LOGOUT });
12 | };
13 |
--------------------------------------------------------------------------------
/src/Components/Loader.jsx:
--------------------------------------------------------------------------------
1 | import { Image } from "@chakra-ui/react";
2 | import { Load } from "./Style";
3 |
4 |
5 | const Loader = () => {
6 | return (
7 |
8 |
9 |
10 |
11 |
12 | );
13 | };
14 |
15 | export default Loader;
--------------------------------------------------------------------------------
/src/Admin/AdminRequireAuth.jsx:
--------------------------------------------------------------------------------
1 |
2 | import React from "react";
3 | import { useSelector } from "react-redux";
4 | import { Navigate} from "react-router-dom";
5 |
6 |
7 | const AdminRequireAuth = ({ children }) => {
8 | const {isAuth} = useSelector(store => store.adminAuthManager)
9 |
10 | if (isAuth) {
11 | return children;
12 | } else {
13 | return (
14 |
17 | );
18 | }
19 | };
20 |
21 |
22 | export default AdminRequireAuth;
23 |
--------------------------------------------------------------------------------
/src/Redux/adminAuth/adminAuth.action.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import { LOGIN_ERROR, LOGIN_LOADING, LOGIN_SUCCESS, LOGOUT } from "./adminAuth.actionTypes";
3 |
4 |
5 |
6 | export const loginAdmin = async (dispatch,creds) => {
7 | dispatch({ type: LOGIN_LOADING });
8 | try {
9 | let response = await axios.post(`https://reqres.in/api/login`, creds);
10 | dispatch({ type: LOGIN_SUCCESS, payload: response.data });
11 | } catch (e) {
12 | dispatch({ type: LOGIN_ERROR, payload: e.message });
13 | }
14 | };
15 |
16 | export const logoutAdmin = () => ({type : LOGOUT});
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import "./index.css";
4 | import App from "./App";
5 | import { BrowserRouter } from "react-router-dom";
6 | import { ChakraProvider } from "@chakra-ui/react";
7 | import { Provider } from "react-redux";
8 | import { store } from "./Redux/store";
9 |
10 | const root = ReactDOM.createRoot(document.getElementById("root"));
11 | root.render(
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | );
20 |
21 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/Redux/cart/cart.actionTypes.js:
--------------------------------------------------------------------------------
1 | // cart action types
2 |
3 | export const GET_CART_SUCCESS = "get/cart/success";
4 | export const GET_CART_LOADING = "get/cart/loading";
5 | export const GET_CART_ERROR = "get/cart/error";
6 |
7 | export const ADD_TO_CART_SUCCESS = "add/cart/success";
8 | export const ADD_TO_CART_LOADING = "add/cart/loading";
9 | export const ADD_TO_CART_ERROR = "add/cart/error";
10 |
11 | export const DELETE_CART_SUCCESS = "delete/cart/success";
12 | export const DELETE_CART_LOADING = "delete/cart/loading";
13 | export const DELETE_CART_ERROR = "delete/cart/error";
14 |
15 | export const RESET_CART_PRODUCT = "cart/reset";
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Pages/Cart/EmptyCart.jsx:
--------------------------------------------------------------------------------
1 | import { Box,Button, } from '@chakra-ui/react'
2 |
3 | import React from 'react'
4 | import { Link } from 'react-router-dom'
5 |
6 |
7 |
8 | const EmptyCart = () => {
9 | return (
10 |
11 |
12 |
13 |
14 | GO TO SHOPPING
15 |
16 |
17 |
18 | )
19 | }
20 |
21 | export default EmptyCart
--------------------------------------------------------------------------------
/src/Pages/Home/Heading.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, Text, Center } from "@chakra-ui/react";
3 | import { Link } from "react-router-dom";
4 |
5 | const Heading = ({ heading }) => {
6 | return (
7 |
8 |
9 | {heading}
10 |
11 | VIEW ALL
18 |
19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default Heading;
26 |
--------------------------------------------------------------------------------
/src/Pages/Home/ViewButton.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Text, Button } from "@chakra-ui/react";
3 |
4 | const ViewButton = () => {
5 | return (
6 |
22 |
23 | View All
24 |
25 |
26 | );
27 | };
28 |
29 | export default ViewButton;
30 |
--------------------------------------------------------------------------------
/src/Components/Style.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | export const Load = styled.div`
4 | color: #ff6188;
5 | width: 100vw;
6 | height: 100vh;
7 | font-family: Consolas, Menlo, Monaco, monospace;
8 | font-weight: bold;
9 | font-size: 30vh;
10 | opacity: 0.8;
11 | display: flex;
12 | justify-content: center;
13 | align-items: center;
14 | span {
15 | display: inline-block;
16 | animation: pulse 0.4s alternate infinite ease-in-out;
17 | &:nth-child(odd) {
18 | animation-delay: 0.4s;
19 | }
20 | }
21 |
22 | @keyframes pulse {
23 | to {
24 | transform: scale(0.8);
25 | opacity: 0.5;
26 | }
27 | }
28 | `;
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from "react";
2 | import Footer from "./Components/Footer";
3 | import Loader from "./Components/Loader";
4 | import { Navbar } from "./Components/Navbar";
5 |
6 | import AllRoutes from "./Routers/AllRoutes";
7 |
8 | function App() {
9 | const [isLoading, setIsLoading] = useState(true);
10 | useEffect(() => {
11 | setIsLoading(true);
12 | let timer = setTimeout(() => {
13 | setIsLoading(false);
14 | return () => clearInterval(timer);
15 | }, 1000);
16 | }, []);
17 | return isLoading?(
18 |
19 | ):(
20 | <>
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | >
29 | )
30 |
31 |
32 | }
33 |
34 | export default App;
35 |
--------------------------------------------------------------------------------
/src/Redux/Products/product.reducer.js:
--------------------------------------------------------------------------------
1 |
2 | import {GET_POSTS_ERROR,GET_POSTS_LOADING,GET_POSTS_RESET,GET_POSTS_SUCCESS} from "./Product.types"
3 |
4 | let initState = {
5 | loading:false,
6 | error:false,
7 | data:[]
8 | };
9 |
10 | export const postReducer = (state=initState,{payload,type})=>{
11 | switch(type){
12 |
13 | case GET_POSTS_LOADING : {
14 | return {
15 | ...state,
16 | loading:true
17 | }
18 | }
19 | case GET_POSTS_ERROR : {
20 | return {
21 | ...state,
22 | loading:false,
23 | error:true
24 | }
25 | }
26 | case GET_POSTS_SUCCESS : {
27 | return {
28 | ...state,
29 | loading:false,
30 | data:payload
31 | }
32 | }
33 | case GET_POSTS_RESET : {
34 | return { ...initState }
35 | }
36 |
37 | default : {
38 | return state;
39 | }
40 | }
41 | }
42 |
43 |
44 | //bm
--------------------------------------------------------------------------------
/src/Components/NavComponents/dropdown.css:
--------------------------------------------------------------------------------
1 | .dropdown {
2 | float: left;
3 | overflow: hidden;
4 | }
5 | .dropdown .dropbtn {
6 | font-size: 16px;
7 |
8 | border: none;
9 | outline: none;
10 | color: white;
11 | background-color: inherit;
12 | font: inherit;
13 | margin: 0px;
14 | }
15 |
16 | .dropdown-content {
17 | display: none;
18 | position: absolute;
19 | background-color: rgb(37,47,100);
20 | left: 0;
21 | width: 100%;
22 | box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
23 | z-index: 100;
24 | }
25 |
26 |
27 | .dropdown:hover .dropdown-content {
28 | display: block;
29 | margin-top: 0;
30 | }
31 |
32 | /* Create three equal columns that floats next to each other */
33 | .column {
34 | float: left;
35 | width: 100%;
36 | padding: 10px;
37 | height: auto;
38 | }
39 |
40 | /* Clear floats after the columns */
41 | .row:after {
42 | content: "";
43 | display: table;
44 | clear: both;
45 | }
46 |
--------------------------------------------------------------------------------
/src/Components/PrivateRoute.jsx:
--------------------------------------------------------------------------------
1 | import { WarningIcon } from "@chakra-ui/icons";
2 | import { Flex, Text, useToast } from "@chakra-ui/react";
3 | import { useSelector } from "react-redux";
4 | import { Navigate } from "react-router-dom";
5 |
6 | export const PrivateRoute = ({ children }) => {
7 | let isAuth = useSelector((state) => state.authManager.isAuth);
8 |
9 | const toast = useToast()
10 | console.log(isAuth)
11 | if (isAuth) {
12 | return children
13 | } else {
14 | toast({
15 | position: 'top-left',
16 |
17 | render: () => (
18 |
19 |
20 | Login is Required! Please Login Firstly
21 |
22 |
23 | ),
24 | })
25 | return
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/src/Routers/PrivateRoutes.jsx:
--------------------------------------------------------------------------------
1 | import { WarningIcon } from "@chakra-ui/icons";
2 | import { Flex, Text, useToast } from "@chakra-ui/react";
3 | import { useSelector } from "react-redux";
4 | import { Navigate } from "react-router-dom";
5 |
6 | const PrivateRoute = ({ children }) => {
7 | let isAuth = useSelector((state) => state.authManager.isAuth);
8 |
9 | const toast = useToast()
10 | console.log(isAuth)
11 | if (isAuth) {
12 | return children
13 | } else {
14 | toast({
15 | position: 'bottom-center',
16 |
17 | render: () => (
18 |
19 |
20 | You are not Login. Please Login & Try Again!
21 |
22 |
23 | ),
24 | })
25 | return
26 | }
27 |
28 | }
29 |
30 | export default PrivateRoute;
--------------------------------------------------------------------------------
/src/Redux/store.js:
--------------------------------------------------------------------------------
1 | // Store Code Here
2 |
3 | import {
4 | applyMiddleware,
5 | combineReducers,
6 | compose,
7 | legacy_createStore,
8 | } from "redux";
9 |
10 | import thunk from "redux-thunk";
11 | import { adminReducer } from "./admin/admin.reducer";
12 | import { authAdminReducer } from "./adminAuth/adminAuth.reducer";
13 | import { authReducer } from "./auth/auth.reducer";
14 | import { cartReducer } from "./cart/cart.reducer";
15 | import {postReducer} from "./Products/product.reducer"
16 |
17 | const composeInhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
18 | const rootReducer = combineReducers({
19 | product:postReducer,
20 | adminProductsManager : adminReducer,
21 | cartManager : cartReducer,
22 | adminAuthManager : authAdminReducer,
23 | authManager : authReducer,
24 | });
25 | export const store = legacy_createStore(
26 | rootReducer,
27 | composeInhancer(applyMiddleware(thunk))
28 | );
--------------------------------------------------------------------------------
/src/Redux/auth/auth.reducer.js:
--------------------------------------------------------------------------------
1 | import { AUTH_LOGIN, AUTH_LOGOUT, AUTH_SIGN_UP } from "./auth.actionTypes";
2 |
3 | const int = {
4 | email: "",
5 | password: "",
6 | username: "",
7 | };
8 |
9 | const initialState = {
10 | isAuth: JSON.parse(localStorage.getItem("isAuth")) || false,
11 | userdata: JSON.parse(localStorage.getItem("userdata")) || int,
12 |
13 | };
14 | export const authReducer = (state = initialState, { type, payload }) => {
15 | switch (type) {
16 | case AUTH_SIGN_UP: {
17 | localStorage.setItem("userdata", JSON.stringify(payload));
18 | return { ...state, userdata: payload };
19 | }
20 | case AUTH_LOGIN: {
21 | localStorage.setItem("isAuth", true);
22 | return { ...state, isAuth: true };
23 | }
24 | case AUTH_LOGOUT: {
25 | localStorage.setItem("isAuth", false);
26 | return { ...state, isAuth: false };
27 | }
28 | default: {
29 | return state;
30 | }
31 | }
32 | };
--------------------------------------------------------------------------------
/src/Admin/Components/ProductsList.jsx:
--------------------------------------------------------------------------------
1 | import { DeleteIcon, } from "@chakra-ui/icons";
2 | import {
3 | Box,
4 | Circle,
5 | Flex,
6 | Text,
7 |
8 | Image,
9 |
10 | } from "@chakra-ui/react";
11 | import React, { useEffect} from "react";
12 | import { useDispatch, useSelector } from "react-redux";
13 | import { deleteAdminProducts, getAdminProducts } from "../../Redux/admin/admin.action";
14 | import ProductItem from "./ProductItem";
15 |
16 |
17 | const ProductsList = () => {
18 | const data = useSelector((store) => store.adminProductsManager.data);
19 | const dispatch = useDispatch();
20 | console.log(data);
21 |
22 | useEffect(() => {
23 | if(data.length === 0){
24 | dispatch(getAdminProducts())
25 | }
26 | },[data.length,dispatch])
27 |
28 |
29 |
30 | return (
31 |
32 |
33 | {
34 | data.map((el) => {
35 | return (
36 |
37 | )
38 | })
39 | }
40 |
41 |
42 | );
43 | };
44 |
45 | export default ProductsList;
46 |
--------------------------------------------------------------------------------
/src/Pages/Login.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Flex, Image, Text } from "@chakra-ui/react";
2 | import LoginForm from "../Components/LoginForm";
3 |
4 | const Login = () => {
5 | return (
6 |
7 |
8 |
9 |
15 |
16 |
17 |
22 |
23 | Login As User
24 |
25 |
26 |
27 |
28 |
29 |
30 | );
31 | };
32 |
33 | export default Login;
34 |
--------------------------------------------------------------------------------
/src/Pages/Register.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Flex, Image, Text } from "@chakra-ui/react";
2 | import RegisterForm from "../Components/RegisterForm";
3 |
4 | const Register = () => {
5 | return (
6 |
7 |
8 |
9 |
15 |
16 |
17 |
22 |
23 | Register As User
24 |
25 |
26 |
27 |
28 |
29 |
30 | );
31 | };
32 |
33 | export default Register;
34 |
--------------------------------------------------------------------------------
/src/Pages/Home/ImageSet.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Image, Spacer } from "@chakra-ui/react";
3 | import Heading from "./Heading";
4 | import SliderFormat from "./SliderFormat";
5 |
6 | const ImageSet = ({ type, heading, src }) => {
7 | return (
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
29 |
35 |
36 |
37 |
38 | );
39 | };
40 |
41 | export default ImageSet;
42 |
--------------------------------------------------------------------------------
/src/Pages/AdminLogin.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Flex, Image, Text } from "@chakra-ui/react";
2 |
3 | import AdminLoginForm from "../Components/AdminLoginForm";
4 |
5 |
6 | const AdminLogin = () => {
7 |
8 |
9 | return (
10 |
11 |
12 |
13 |
19 |
20 |
21 |
26 |
27 | Login As Admin
28 |
29 |
30 |
31 |
32 |
33 |
34 | );
35 | };
36 |
37 | export default AdminLogin;
38 |
--------------------------------------------------------------------------------
/src/Pages/Home/HomeCard1.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Grid, Image, Text } from "@chakra-ui/react";
3 | import { Link } from "react-router-dom";
4 | import uuid from "react-uuid";
5 |
6 | const HomeCard1 = ({ type, heading}) => {
7 | return (
8 |
9 |
10 |
11 | {heading}
12 |
13 |
14 |
15 |
16 |
31 | {type.map((i) => (
32 |
33 |
34 |
35 |
36 |
37 | ))}
38 |
39 |
40 | );
41 | };
42 |
43 | export default HomeCard1;
--------------------------------------------------------------------------------
/src/Redux/admin/admin.action.js:
--------------------------------------------------------------------------------
1 | import { DELETE_ADMIN_ERROR, DELETE_ADMIN_LOADING, DELETE_ADMIN_SUCCESS, GET_ADMIN_ERROR, GET_ADMIN_LOADING, GET_ADMIN_SUCCESS } from "./admin.actionTypes";
2 |
3 | import axios from "axios"
4 | export const getAdminProducts = () => async(dispatch) => {
5 | dispatch({
6 | type : GET_ADMIN_LOADING,
7 | })
8 | try{
9 | let response = await axios.get(`https://digital-express.vercel.app/computers`);
10 | dispatch({
11 | type : GET_ADMIN_SUCCESS,
12 | payload : response.data,
13 | })
14 | }
15 | catch(e){
16 | dispatch({
17 | type : GET_ADMIN_ERROR,
18 | payload : e,
19 | })
20 | }
21 | }
22 |
23 | export const deleteAdminProducts = (id) => async(dispatch) => {
24 | dispatch({
25 | type : DELETE_ADMIN_LOADING,
26 | })
27 | try{
28 | let response = await axios.delete(`https://digital-express.vercel.app/computers/${id}`);
29 | dispatch({
30 | type: DELETE_ADMIN_SUCCESS,
31 | payload : id,
32 | })
33 | }
34 | catch(e){
35 | dispatch({
36 | type : DELETE_ADMIN_ERROR,
37 | payload : e,
38 | })
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Pages/Home/Laptop2.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Image, Spacer } from "@chakra-ui/react";
3 | import Heading from "./Heading";
4 | import SliderFormat from "./SliderFormat";
5 |
6 | const Laptop2 = ({ type, heading, src }) => {
7 | return (
8 |
9 |
10 |
11 |
12 |
26 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 | );
50 | };
51 |
52 | export default Laptop2;
53 |
--------------------------------------------------------------------------------
/src/Redux/adminAuth/adminAuth.reducer.js:
--------------------------------------------------------------------------------
1 | import { LOGIN_ERROR, LOGIN_LOADING, LOGIN_SUCCESS, LOGOUT } from "./adminAuth.actionTypes";
2 |
3 |
4 | const token = localStorage.getItem("token") || "";
5 | const initialState = {
6 | loading : false,
7 | error : false,
8 | cred : {},
9 | isAuth : !!token,
10 | token : token,
11 | }
12 |
13 | export const authAdminReducer = (state = initialState, {type,payload}) => {
14 | switch(type) {
15 | case LOGIN_LOADING : {
16 | return {
17 | ...state,
18 | loading : true,
19 | error : false,
20 |
21 | }
22 | }
23 | case LOGIN_SUCCESS : {
24 | localStorage.setItem("token", payload.token)
25 | return {
26 | ...state,
27 | loading : false,
28 | isAuth : true,
29 | token : payload.token
30 | }
31 | }
32 | case LOGIN_ERROR : {
33 | return {
34 | ...state,
35 | loading : false,
36 | error : true,
37 | }
38 | }
39 | case LOGOUT : {
40 | localStorage.removeItem("token")
41 | return {
42 | ...state,
43 | isAuth : false,
44 | token : "",
45 | }
46 | }
47 | default : {
48 | return state;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Skeleton/dataSkeleton.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Skeleton from 'react-loading-skeleton'
3 | import 'react-loading-skeleton/dist/skeleton.css'
4 |
5 | const dataSkeleton = () => {
6 | //bm
7 | return (
8 |
9 |
10 |
16 |
22 |
28 |
34 |
40 |
46 |
52 |
58 |
59 | )
60 | }
61 |
62 | export default dataSkeleton
63 |
--------------------------------------------------------------------------------
/src/Pages/Home/BrandPromise.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Grid, Flex, Text, Image, Center } from "@chakra-ui/react";
3 | import uuid from "react-uuid";
4 |
5 | const BrandPromise = ({ type, heading }) => {
6 | return (
7 |
8 |
9 |
10 | {heading}
11 |
12 |
13 |
25 | {type.map((i) => (
26 |
35 |
36 |
37 |
38 |
39 |
40 | {i.title}
41 |
42 |
43 |
44 |
45 | {i.desc}
46 |
47 |
48 |
49 | ))}
50 |
51 |
52 | );
53 | };
54 |
55 | export default BrandPromise;
--------------------------------------------------------------------------------
/src/Redux/admin/admin.reducer.js:
--------------------------------------------------------------------------------
1 | import { DELETE_ADMIN_ERROR, DELETE_ADMIN_LOADING, DELETE_ADMIN_SUCCESS, GET_ADMIN_ERROR, GET_ADMIN_LOADING, GET_ADMIN_SUCCESS, RESET_ADMIN_PRODUCTS } from "./admin.actionTypes";
2 |
3 | // Note: Do not update/change the initial state
4 | const productInitalState = {
5 | loading: false,
6 | error: false,
7 | data: [],
8 | };
9 |
10 | export const adminReducer = (state = productInitalState, {type,payload}) => {
11 | switch(type){
12 | case GET_ADMIN_LOADING: {
13 | return{
14 | ...state,
15 | loading : true,
16 | }
17 | }
18 | case GET_ADMIN_SUCCESS: {
19 | return{
20 | ...state,
21 | loading : false,
22 | data : payload,
23 | }
24 | }
25 | case GET_ADMIN_ERROR : {
26 | return {
27 | ...state,
28 | loading : false,
29 | error : true,
30 | }
31 | }
32 | case RESET_ADMIN_PRODUCTS: {
33 | return{
34 | ...state,
35 | }
36 | }
37 |
38 | case DELETE_ADMIN_LOADING : {
39 | return {
40 | ...state,
41 | loading : true,
42 | }
43 | }
44 | case DELETE_ADMIN_SUCCESS : {
45 | const filterDeleteProducts = state.data.filter((product) => product.id !== payload);
46 | return{
47 | ...state,
48 | data : filterDeleteProducts,
49 | }
50 | }
51 | case DELETE_ADMIN_ERROR : {
52 | return{
53 | ...state,
54 | loading : false,
55 | error : payload,
56 | }
57 | }
58 |
59 | default : {
60 | return state;
61 | }
62 | }
63 | };
--------------------------------------------------------------------------------
/src/Redux/Products/ProductApi.js:
--------------------------------------------------------------------------------
1 | import axios from "axios"
2 |
3 |
4 | export const getPostsApi = async() => {
5 |
6 | let res = await axios.get(`https://digital-express.vercel.app/cameras`)
7 | return res.data;
8 | }
9 |
10 | export const getPostsApiTelevision = async() => {
11 |
12 | let res = await axios.get(`https://digital-express.vercel.app/televisions`)
13 | return res.data;
14 | }
15 |
16 | export const getPostsApiMobile = async() => {
17 |
18 | let res = await axios.get(`https://digital-express.vercel.app/mobilesandtablets`)
19 | return res.data;
20 | }
21 |
22 | export const getPostsApiHeadphone = async() => {
23 |
24 | let res = await axios.get(`https://digital-express.vercel.app/headphones`)
25 | return res.data;
26 | }
27 |
28 | export const getPostsApiHome = async() => {
29 |
30 | let res = await axios.get(`https://digital-express.vercel.app/homeappliances`)
31 | return res.data;
32 | }
33 |
34 | export const getPostsApiComputer = async() => {
35 |
36 | let res = await axios.get(`https://digital-express.vercel.app/computers`)
37 | return res.data;
38 | }
39 |
40 |
41 | export const getPostsApiKitchen = async() => {
42 |
43 | let res = await axios.get(`https://digital-express.vercel.app/kitchen`)
44 | return res.data;
45 | }
46 |
47 | export const getPostsApiPersonal = async() => {
48 |
49 | let res = await axios.get(`https://digital-express.vercel.app//personalcare`)
50 | return res.data;
51 | }
52 |
53 | export const getPersonalApi = async(name,id) => {
54 |
55 | let res = await axios.get(`https://digital-express.vercel.app/${name}/${id}`)
56 | return res.data;
57 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "my-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@chakra-ui/icons": "^2.0.16",
7 | "@chakra-ui/react": "^2.4.8",
8 | "@emotion/react": "^11.10.5",
9 | "@emotion/styled": "^11.10.5",
10 | "@testing-library/jest-dom": "^5.16.5",
11 | "@testing-library/react": "^13.4.0",
12 | "@testing-library/user-event": "^13.5.0",
13 | "axios": "^1.2.3",
14 | "bootstrap": "^5.2.3",
15 | "framer-motion": "^8.4.3",
16 | "react": "^18.2.0",
17 | "react-bootstrap": "^2.7.0",
18 | "react-bootstrap-carousel": "^4.1.1",
19 | "react-dom": "^18.2.0",
20 | "react-icons": "^4.7.1",
21 | "react-loading-skeleton": "^3.1.0",
22 | "react-redux": "^8.0.5",
23 | "react-router-dom": "^6.6.2",
24 | "react-scripts": "5.0.1",
25 | "react-slick": "^0.29.0",
26 | "react-slideshow-image": "^4.1.1",
27 | "react-uuid": "^2.0.0",
28 | "redux-thunk": "^2.4.2",
29 | "styled-components": "^5.3.6",
30 | "sweetalert": "^2.1.2",
31 | "swiper": "^8.4.6",
32 | "web-vitals": "^2.1.4"
33 | },
34 | "scripts": {
35 | "start": "react-scripts start",
36 | "build": "react-scripts build",
37 | "test": "react-scripts test",
38 | "eject": "react-scripts eject"
39 | },
40 | "eslintConfig": {
41 | "extends": [
42 | "react-app",
43 | "react-app/jest"
44 | ]
45 | },
46 | "browserslist": {
47 | "production": [
48 | ">0.2%",
49 | "not dead",
50 | "not op_mini all"
51 | ],
52 | "development": [
53 | "last 1 chrome version",
54 | "last 1 firefox version",
55 | "last 1 safari version"
56 | ]
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Redux/cart/cart.action.js:
--------------------------------------------------------------------------------
1 | // Cart Action Code Here
2 | import axios from "axios";
3 | import {
4 | ADD_TO_CART_ERROR,
5 | ADD_TO_CART_LOADING,
6 | ADD_TO_CART_SUCCESS,
7 | DELETE_CART_ERROR,
8 | DELETE_CART_LOADING,
9 | DELETE_CART_SUCCESS,
10 | GET_CART_ERROR,
11 | GET_CART_LOADING,
12 | GET_CART_SUCCESS,
13 | } from "./cart.actionTypes";
14 |
15 | export const getCartProducts = () => async (dispatch) => {
16 | dispatch({
17 | type: GET_CART_LOADING,
18 | });
19 | try {
20 | let response = await axios.get(`https://digital-express.vercel.app/cart`);
21 | dispatch({
22 | type: GET_CART_SUCCESS,
23 | payload: response.data,
24 | });
25 | } catch (e) {
26 | dispatch({
27 | type: GET_CART_ERROR,
28 | payload: e,
29 | });
30 | }
31 | };
32 |
33 | export const deleteProduct = (id) => async (dispatch) => {
34 | dispatch({
35 | type: DELETE_CART_LOADING,
36 | });
37 | try {
38 | await axios.delete(`https://digital-express.vercel.app/cart/${id}`);
39 | dispatch({
40 | type: DELETE_CART_SUCCESS,
41 | payload: id,
42 | });
43 | } catch (e) {
44 | dispatch({
45 | type: DELETE_CART_ERROR,
46 | payload: e,
47 | });
48 | }
49 | };
50 |
51 | //
52 | export const addItemCart = (item) => async (dispatch) => {
53 | dispatch({
54 | type: ADD_TO_CART_LOADING,
55 | });
56 | try {
57 | let response = await axios.post(`https://digital-express.vercel.app/cart`,item);
58 | console.log(response.data);
59 | dispatch({
60 | type: ADD_TO_CART_SUCCESS,
61 |
62 | });
63 | dispatch(getCartProducts())
64 |
65 | } catch (e) {
66 | dispatch({
67 | type: ADD_TO_CART_ERROR,
68 | payload: e,
69 | });
70 | }
71 | };
72 |
--------------------------------------------------------------------------------
/src/Pages/Home/Slider3.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Slide } from 'react-slideshow-image';
3 | import 'react-slideshow-image/dist/styles.css';
4 |
5 | const buttonStyle = {
6 | width: "30px",
7 | background: 'none',
8 | border: '0px'
9 | };
10 |
11 | const properties = {
12 | prevArrow: ,
13 | nextArrow:
14 | }
15 |
16 | const Slider3 = () => {
17 | return (
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Slider3;
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | Reliance Digital | Clone
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Redux/cart/cart.reducer.js:
--------------------------------------------------------------------------------
1 | // cart reducer code here
2 |
3 | import {
4 | ADD_TO_CART_ERROR,
5 | ADD_TO_CART_LOADING,
6 | ADD_TO_CART_SUCCESS,
7 | DELETE_CART_ERROR,
8 | DELETE_CART_LOADING,
9 | DELETE_CART_SUCCESS,
10 | GET_CART_ERROR,
11 | GET_CART_LOADING,
12 | GET_CART_SUCCESS,
13 | RESET_CART_PRODUCT,
14 | } from "./cart.actionTypes";
15 |
16 | // Note: Do not update/change the initial state
17 | const productInitalState = {
18 | loading: false,
19 | error: false,
20 | data: [],
21 | };
22 |
23 | export const cartReducer = (state = productInitalState, { type, payload }) => {
24 | switch (type) {
25 | case GET_CART_LOADING: {
26 | return {
27 | ...state,
28 | loading: true,
29 | };
30 | }
31 | case GET_CART_SUCCESS: {
32 | return {
33 | ...state,
34 | loading: false,
35 | data: payload,
36 | };
37 | }
38 | case GET_CART_ERROR: {
39 | return {
40 | ...state,
41 | loading: false,
42 | error: true,
43 | };
44 | }
45 | case RESET_CART_PRODUCT: {
46 | return {
47 | ...state,
48 | };
49 | }
50 | case ADD_TO_CART_LOADING: {
51 | return {
52 | ...state,
53 | loading: true,
54 | error: false,
55 | };
56 | }
57 |
58 | case ADD_TO_CART_SUCCESS: {
59 | return {
60 | ...state,
61 | };
62 | }
63 | case ADD_TO_CART_ERROR: {
64 | return {
65 | ...state,
66 | error: true,
67 | loading: false,
68 | };
69 | }
70 |
71 | case DELETE_CART_LOADING: {
72 | return {
73 | ...state,
74 | loading: true,
75 | };
76 | }
77 | case DELETE_CART_SUCCESS: {
78 | const filterDeleteProducts = state.data.filter(
79 | (product) => product.id !== payload
80 | );
81 | return {
82 | ...state,
83 | data: filterDeleteProducts,
84 | };
85 | }
86 | case DELETE_CART_ERROR: {
87 | return {
88 | ...state,
89 | loading: false,
90 | error: payload,
91 | };
92 | }
93 |
94 | default: {
95 | return state;
96 | }
97 | }
98 | };
99 |
--------------------------------------------------------------------------------
/src/Admin/Components/ProductItem.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { CheckCircleIcon, DeleteIcon, } from "@chakra-ui/icons";
3 | import {
4 | Box,
5 | Circle,
6 | Flex,
7 | Text,
8 |
9 | Image,
10 | useToast,
11 |
12 | } from "@chakra-ui/react";
13 | import { useDispatch } from 'react-redux';
14 | import { deleteAdminProducts, getAdminProducts } from '../../Redux/admin/admin.action';
15 |
16 | const ProductItem = ({img,id,name,price}) => {
17 | const toast = useToast()
18 |
19 | const dispatch = useDispatch();
20 |
21 | const handleDelete = (id) => {
22 | toast({
23 | position: 'bottom-center',
24 | duration: 1200,
25 | render: () => (
26 |
27 | {`${name} has been deleted!`}
28 |
29 |
30 | ),
31 | })
32 |
33 | dispatch(deleteAdminProducts(id))
34 | dispatch(getAdminProducts())
35 |
36 | }
37 |
38 | return (
39 |
40 |
49 |
55 |
56 |
57 | {name}
58 |
59 | {`Brand: HP`}
60 |
61 | {`Rs. ${price}`}
62 |
63 |
64 |
65 | handleDelete(id)}>
66 |
75 |
81 |
82 |
83 |
84 |
85 | )
86 | }
87 |
88 | export default ProductItem
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | width: 100%;
9 | overflow-x: hidden;
10 | padding: 0px;
11 | }
12 |
13 | code {
14 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
15 | monospace;
16 | }
17 |
18 | #filters{
19 | width: 20%;
20 | box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px
21 | }
22 |
23 | #productCards{
24 |
25 | display: grid;
26 | grid-template-columns: repeat(4,1fr);
27 | gap: 10px;
28 | margin-bottom: 20px;
29 |
30 | }
31 |
32 | #cardTitle{
33 | display: -webkit-box;
34 | overflow: hidden;
35 | -webkit-line-clamp: 2;
36 | -webkit-box-orient: vertical;
37 | }
38 |
39 | #sortingButton{
40 | border-radius: 5px;
41 | background:#ebeeef;
42 | color:black;
43 | padding:0px 8px 0px 8px;
44 | margin-right: 10px;
45 | }
46 | #titleBar{
47 | width: 78%;
48 | }
49 | #priceRange{
50 | justify-content: space-evenly;
51 | }
52 |
53 | @media all and (min-width: 360px) and (max-width: 750px) {
54 | #productCards{
55 | grid-template-columns: repeat(1,1fr);
56 | }
57 | #filters{
58 | display: none;
59 |
60 | }
61 | #sortButtonContainer{
62 | display: none;
63 | }
64 | #titleBar{
65 | width: 90%;
66 |
67 | }
68 | #Productcard img{
69 | margin: auto;
70 | }
71 |
72 | #priceRange{
73 | flex-direction: column;
74 | }
75 |
76 | }
77 |
78 | @media all and (min-width: 751px) and (max-width: 1024px) {
79 | #productCards{
80 | grid-template-columns: repeat(2,1fr);
81 |
82 | }
83 | #filters{
84 | display: none;
85 | }
86 | #titleBar{
87 | width: 90%;
88 |
89 | }
90 | #Productcard img{
91 | margin: auto;
92 | }
93 | #sortButtonContainer{
94 | display: none;
95 | }
96 |
97 | #priceRange{
98 | flex-direction: column;
99 | }
100 |
101 | }
102 | @media all and (min-width: 1025px) and (max-width: 1280px) {
103 | #productCards{
104 |
105 | grid-template-columns: repeat(3,1fr);
106 |
107 | }
108 |
109 | #priceRange{
110 | flex-direction: column;
111 | }
112 |
113 | }
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Pages/Cart/CartItem.jsx:
--------------------------------------------------------------------------------
1 | import { WarningIcon } from '@chakra-ui/icons'
2 | import { Flex, Text } from '@chakra-ui/layout'
3 | import { useToast } from '@chakra-ui/toast'
4 | import React from 'react'
5 | import { FaPlus } from 'react-icons/fa'
6 | import { useDispatch } from 'react-redux'
7 | import { deleteProduct, getCartProducts } from '../../Redux/cart/cart.action'
8 | import crt from "./cart.module.css"
9 | const CartItem = ({img,id,name,price,mrp,delevery}) => {
10 | const dispatch = useDispatch();
11 | const toast = useToast();
12 | const handleDelete = (id) => {
13 | dispatch(deleteProduct(id));
14 | dispatch(getCartProducts());
15 | toast({
16 | position: 'bottom-center',
17 |
18 | duration: 1200,
19 |
20 | render: () => (
21 |
22 |
23 | Your {name} is Removed from Cart
24 |
25 | ),
26 | })
27 | }
28 | return (
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
{name}
37 | RECOMMENDED SERVICES/WARRANTY
38 |
39 |
40 |
₹{price}
41 |
M.R.P: {mrp} Inclusive of all taxes
42 |
Free Shipping
43 |
Delivere by: {delevery}
44 |
*Delivery assurance is subject to our delivery locations staying open as per govt. regulations
45 |
46 |
47 |
48 | { handleDelete(id) }}>Remove
49 |
50 | {/* {
51 | let obj = {}
52 | for (let i of data)
53 | if (i.id === id) {
54 | obj = i
55 | }
56 | dispatch(addtoWish(obj));
57 | }}>Add to Wish */}
58 |
59 | Move to wishlist
60 |
61 |
62 |
63 | )
64 | }
65 |
66 | export default CartItem
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Filters/PriceRange.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, Checkbox, Container, Flex, Grid, GridItem, Image, Input, RangeSlider, RangeSliderFilledTrack, RangeSliderThumb, RangeSliderTrack, Spacer, StackDivider, Text, VStack } from '@chakra-ui/react'
3 |
4 | const PriceRange = () => {
5 | return (
6 |
7 |
8 |
9 |
10 | } spacing={4} align='stretch'>
11 |
12 |
13 |
14 | Price
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ₹499 ₹46999
23 |
24 |
25 |
26 | To
27 | {" "}
28 | GO
29 |
30 |
31 |
32 |
33 |
34 | Availability
35 |
36 |
37 | Exclude out of Stock
38 |
39 |
40 |
41 | Category
42 |
43 |
44 | Laptops
45 |
46 |
47 |
48 | Category
49 |
50 | Lenovo
51 |
52 |
53 |
54 | Acer
55 |
56 |
57 |
58 | Hp
59 |
60 |
61 |
62 |
63 |
64 |
65 | )
66 | }
67 |
68 | export default PriceRange
69 |
--------------------------------------------------------------------------------
/src/Components/AdminLoginForm.jsx:
--------------------------------------------------------------------------------
1 | import {
2 |
3 | FormControl,
4 | FormLabel,
5 | Text,
6 | Input,
7 | Spacer,
8 | Flex,
9 | } from "@chakra-ui/react";
10 | import React, { useEffect, useState } from "react";
11 | import { useDispatch, useSelector } from "react-redux";
12 | import { Link, useNavigate } from "react-router-dom";
13 | import { loginAdmin } from "../Redux/adminAuth/adminAuth.action";
14 |
15 | const AdminLoginForm = () => {
16 |
17 | const [loginCreds, setLoginCreds] = useState({});
18 | const {isAuth} = useSelector(store => store.adminAuthManager);
19 | const dispatch = useDispatch()
20 |
21 | const navigate = useNavigate();
22 |
23 |
24 | const hanldeChange = (e) => {
25 | const { name, value } = e.target;
26 | setLoginCreds({
27 | ...loginCreds,
28 | [name]: value,
29 | });
30 | };
31 |
32 | const handleSubmit = (e) => {
33 | e.preventDefault();
34 | loginAdmin(dispatch, loginCreds);
35 | };
36 |
37 | useEffect(() => {
38 | if(isAuth){
39 | navigate("/admin");
40 | }
41 | },[isAuth,navigate])
42 |
43 | return (
44 |
45 |
91 |
92 | );
93 | };
94 |
95 | export default AdminLoginForm;
96 |
--------------------------------------------------------------------------------
/src/Pages/Home/Explore.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Text, Image, Square, Center, Grid } from "@chakra-ui/react";
3 | import { Navigation, Autoplay } from "swiper";
4 | import { Swiper, SwiperSlide } from "swiper/react";
5 | import "swiper/css";
6 | import "swiper/css/navigation";
7 | import "swiper/css/autoplay";
8 | import { Link } from "react-router-dom";
9 | import uuid from "react-uuid";
10 | import ViewButton from "./ViewButton";
11 |
12 | const Explore = ({ type, heading }) => {
13 | return (
14 |
23 |
24 |
25 | {heading}
26 |
27 |
28 |
29 |
30 |
31 |
58 |
59 | {type.map((i) => (
60 |
61 |
62 |
63 |
64 |
65 |
70 |
71 |
72 |
73 |
74 |
75 | {i.categories}
76 |
77 |
78 |
79 |
80 |
81 |
82 | ))}
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | );
91 | };
92 |
93 | export default Explore;
94 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/carousel.jsx:
--------------------------------------------------------------------------------
1 | import { Image } from "@chakra-ui/react";
2 | import React,{useEffect,useState} from "react";
3 |
4 | export default function Carousel(){
5 |
6 | const ImagesArr=[
7 | "https://www.reliancedigital.in/medias/Winter-Sale-Carousel-Banner-2022.jpg?context=bWFzdGVyfGltYWdlc3w3ODA1OXxpbWFnZS9qcGVnfGltYWdlcy9oOGMvaDU3Lzk5MTgzMzY0MzQyMDYuanBnfDkxOGNjMWJiMjExYWUzYTQ0ODMzMTk5MjQ0YzY0YmVhNTE5ZjQxZTZjNzc4ZTRhNDhjYjc3N2I3NmZjNmM2ZDI",
8 | "https://www.reliancedigital.in/medias/Apple-S8-CLP-Banner-14-11-2022.jpg?context=bWFzdGVyfGltYWdlc3w5MjcyNHxpbWFnZS9qcGVnfGltYWdlcy9oMzgvaDdkLzk5MjgzNzEwNDQzODIuanBnfDcxMDY3Y2FkZDNmNTkxNGM5MmMzZDNmYjI3Y2U0MzQ4Yzk1NGM1YTMwZDkzNWZiZWYzMjc0NWExNWY4NmExMGQ",
9 | "https://www.reliancedigital.in/medias/Laptop-Carnival-Carousel-Banner-D.jpg?context=bWFzdGVyfGltYWdlc3w5MTcwNXxpbWFnZS9qcGVnfGltYWdlcy9oM2UvaDJiLzk5MzA5MTgwNjgyNTQuanBnfDM0NDIxMjI1ZmE2NjQ1MDk4MWY2MjJlMjU2Mjg0YzAxNDViYTRiM2YzMTEyYjU5OGUwNTZlNDY4NzcxYzk3M2Y",
10 | "https://www.reliancedigital.in/medias/Accessories-Fiesta-Carousel-Banner-D.jpg?context=bWFzdGVyfGltYWdlc3w5MTAwN3xpbWFnZS9qcGVnfGltYWdlcy9oY2MvaDI5Lzk5Mjk4MTAyMTQ5NDIuanBnfGUxYTc3MTMzNThhNzlkZGQyNTNlYTYxMzM3OWM4NzQzYjY2YWYwYzFkNjhhMjA5M2YwNDhiYTMwMzA2ZGY5MTY",
11 | "https://www.reliancedigital.in/medias/Moto-G42-Carousel-Banner-09-12-2022.jpg?context=bWFzdGVyfGltYWdlc3wxMDMyNDN8aW1hZ2UvanBlZ3xpbWFnZXMvaGQ2L2g2ZC85OTI5ODI3Mzg1Mzc0LmpwZ3w4MzEyODVmNTUyNWIwODNlNTA1YThjNTA4Njg5ZmU1YTU1ZjZlMzM5NWY5ODI0ZWNmOTAwYjY5M2RhNWVkOTky",
12 | "https://www.reliancedigital.in/medias/Smartwatch-Carnival-Carousel-Banner-D.jpg?context=bWFzdGVyfGltYWdlc3w5MTMyMnxpbWFnZS9qcGVnfGltYWdlcy9oYmYvaGFmLzk5Mjk4MzI1NjI3MTguanBnfDBkOTJjZDk5YTI1MTU3NWU5MDc1NGQ0ZDg2YjFlOWRhOGRhN2FiMzgxMDY3YWI5Y2M1NDk0MjNjZjU1MzNjYjY",
13 | "https://www.reliancedigital.in/medias/Entertainment-Fest-Carousel-Banner-08-D.jpg?context=bWFzdGVyfGltYWdlc3wyMDEwMzl8aW1hZ2UvanBlZ3xpbWFnZXMvaGQxL2g2MS85OTI5MTgxNjI2Mzk4LmpwZ3w2MjQzNGNlODRiMmRkZmE1ZDA1Njg3MTNmM2ExMWE5ZDQ4MDJhN2VkYTBmOWVjMjg1MTdhNTM3YmNhM2E3YjM0",
14 | "https://www.reliancedigital.in/medias/Monitors-Carousel-Banner-02-12-2022.jpg?context=bWFzdGVyfGltYWdlc3w4Mjc4NHxpbWFnZS9qcGVnfGltYWdlcy9oNTEvaDNlLzk5MzExODEzNTkxMzQuanBnfDA5Nzc0YWExYjdjM2YzNTg4Njk4MDJjZGU1ZWQ4NzAzOTIzZDgxMWU2MjVhYjdkNTI2MzBhNWJhYzg0ZTZjMTk"
15 | ]
16 |
17 | function slideshow(){
18 |
19 |
20 | let i=0;
21 | setInterval(()=>{
22 | if(i===ImagesArr.length){
23 | i=0;
24 | setPic(ImagesArr[0]);
25 |
26 | }
27 |
28 | setPic(ImagesArr[i]);
29 | i++;
30 |
31 | },3000)
32 |
33 |
34 |
35 |
36 | }
37 |
38 | useEffect(()=>{
39 | slideshow();
40 |
41 | },[])
42 |
43 |
44 | const [pic,setPic]= useState(ImagesArr[0]);
45 | return(
46 |
47 |
48 |
49 |
50 | )
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/src/Redux/Products/Product.action.js:
--------------------------------------------------------------------------------
1 | import {GET_POSTS_ERROR,GET_POSTS_LOADING,GET_POSTS_SUCCESS} from "./Product.types"
2 | import { getPersonalApi, getPostsApi, getPostsApiComputer, getPostsApiHeadphone, getPostsApiHome, getPostsApiKitchen, getPostsApiMobile, getPostsApiPersonal, getPostsApiTelevision } from "./ProductApi"
3 | export const getPosts=()=>async(dispatch)=>{
4 | dispatch({type:GET_POSTS_LOADING});
5 | try{
6 | let data = await getPostsApi()
7 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
8 | }catch(e){
9 | dispatch({type:GET_POSTS_ERROR})
10 | }
11 | }
12 | export const getPostsTelevisions=()=>async(dispatch)=>{
13 | dispatch({type:GET_POSTS_LOADING});
14 | try{
15 | let data = await getPostsApiTelevision()
16 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
17 | }catch(e){
18 | dispatch({type:GET_POSTS_ERROR})
19 | }
20 | }
21 |
22 | export const getPostsMobile=()=>async(dispatch)=>{
23 | dispatch({type:GET_POSTS_LOADING});
24 | try{
25 | let data = await getPostsApiMobile()
26 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
27 | }catch(e){
28 | dispatch({type:GET_POSTS_ERROR})
29 | }
30 | }
31 |
32 | export const getPostsHeadPhone=()=>async(dispatch)=>{
33 | dispatch({type:GET_POSTS_LOADING});
34 | try{
35 | let data = await getPostsApiHeadphone()
36 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
37 | }catch(e){
38 | dispatch({type:GET_POSTS_ERROR})
39 | }
40 | }
41 |
42 | export const getPostsHome=()=>async(dispatch)=>{
43 | dispatch({type:GET_POSTS_LOADING});
44 | try{
45 | let data = await getPostsApiHome()
46 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
47 | }catch(e){
48 | dispatch({type:GET_POSTS_ERROR})
49 | }
50 | }
51 |
52 | export const getPostsComputer=()=>async(dispatch)=>{
53 | dispatch({type:GET_POSTS_LOADING});
54 | try{
55 | let data = await getPostsApiComputer()
56 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
57 | }catch(e){
58 | dispatch({type:GET_POSTS_ERROR})
59 | }
60 | }
61 |
62 | export const getPostsKitchen=()=>async(dispatch)=>{
63 | dispatch({type:GET_POSTS_LOADING});
64 | try{
65 | let data = await getPostsApiKitchen()
66 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
67 | }catch(e){
68 | dispatch({type:GET_POSTS_ERROR})
69 | }
70 | }
71 |
72 | export const getPostsPersonal=()=>async(dispatch)=>{
73 | dispatch({type:GET_POSTS_LOADING});
74 | try{
75 | let data = await getPostsApiPersonal()
76 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
77 | }catch(e){
78 | dispatch({type:GET_POSTS_ERROR})
79 | }
80 | }
81 |
82 | export const getPersonalPost=(name,id)=>async(dispatch)=>{
83 | dispatch({type:GET_POSTS_LOADING});
84 | try{
85 | let data = await getPersonalApi(name,id)
86 | dispatch({type:GET_POSTS_SUCCESS,payload:data})
87 | }catch(e){
88 | dispatch({type:GET_POSTS_ERROR})
89 | }
90 | }
--------------------------------------------------------------------------------
/src/Pages/Cart/Cart.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from 'react'
2 | import { useDispatch, useSelector } from 'react-redux';
3 |
4 | import crt from "./cart.module.css"
5 | import { FaPlus } from 'react-icons/fa';
6 | import { deleteProduct, getCartProducts } from '../../Redux/cart/cart.action';
7 | import { useNavigate } from 'react-router-dom';
8 | import EmptyCart from './EmptyCart';
9 | import CartItem from './CartItem';
10 |
11 |
12 |
13 | const Cart = () => {
14 | const data = useSelector((store) => store.cartManager.data);
15 | const navigate = useNavigate();
16 | const dispatch = useDispatch();
17 | const [delevery, setDelevery] = useState("");
18 | const [total, setTotal] = useState(0);
19 |
20 | const handleTotal = (arr) => {
21 | setTotal(0);
22 | let amt = 0;
23 | arr.forEach((e) => {
24 | let x = e.price
25 | let a = x.replaceAll(",", "")
26 | amt += +a;
27 | })
28 | setTotal(amt);
29 | }
30 |
31 |
32 |
33 |
34 | const handlePayment = () => {
35 | localStorage.setItem("finalPrice",total);
36 | navigate("/checkout");
37 | }
38 |
39 | useEffect(() => {
40 | if (data.length === 0) {
41 | dispatch(getCartProducts())
42 | }
43 | const date = new Date();
44 | const x = date.getDate() + 4;
45 | date.setDate(x)
46 | let s = date.toString().split(" ")
47 | let a = s[2] + " " + s[1] + " " + s[3]
48 | setDelevery(a);
49 | handleTotal(data);
50 | }, [data.length, dispatch])
51 | console.log(data);
52 |
53 |
54 | return (
55 | <>
56 | {
57 | data.length === 0 ? :
58 |
59 | {
60 | data.map((el) => {
61 | return (
62 |
63 | )
64 | })
65 | }
66 |
67 |
68 |
Checkout
69 |
70 |
71 |
72 | APPLY
73 |
74 |
75 |
76 |
PRICE DETAILS
77 |
78 |
Price ({data.length} Items)
79 | ₹{total}
80 |
81 |
82 |
Delivery Charges
83 | FREE
84 |
85 |
86 |
87 |
AMOUNT PAYABLE
88 | ₹{total}
89 |
90 |
91 |
92 |
93 |
94 |
95 | Total: ₹{total}
96 | Checkout
97 |
98 |
99 | }
100 | >
101 | )
102 | }
103 |
104 | export default Cart
--------------------------------------------------------------------------------
/src/Routers/AllRoutes.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Route, Routes } from "react-router-dom";
3 | import Home from "../Pages/Home/Home";
4 | import Admin from "../Admin/Admin";
5 | import AdminRequireAuth from "../Admin/AdminRequireAuth";
6 | import AdminLogin from "../Pages/AdminLogin";
7 | import Login from "../Pages/Login";
8 | import Register from "../Pages/Register";
9 | import Cart from "../Pages/Cart/Cart";
10 | import Payment from "../Pages/Payment/Payment";
11 | import ProductCards from "../Pages/ProductCard/ProductCards";
12 | import Televisions from "../Pages/ProductCard/Television";
13 | import Mobile from "../Pages/ProductCard/Mobile";
14 | import HeadPhone from "../Pages/ProductCard/HeadPhone";
15 | import HomeAppliances from "../Pages/ProductCard/HomeAppliances";
16 | import Computer from "../Pages/ProductCard/Computer";
17 | import Personal from "../Pages/ProductCard/Personal";
18 | import Kitchen from "../Pages/ProductCard/Kitchen";
19 | import PrivateRoute from "./PrivateRoutes";
20 | import ProductDetailpage from "../Pages/productdetailpage/ProductDetailpage";
21 | import Wishlist from "../Pages/Wishlist/Wishlist";
22 |
23 |
24 | const AllRoutes = () => {
25 | return (
26 |
27 |
28 | }>
29 |
33 |
34 |
35 | }
36 | >
37 | }>
38 | }>
39 | }>
40 | }>
41 | }>
42 | }>
43 | }>
44 | }>
45 | }>
46 | }>
47 | }>
48 | }>
49 | }>
50 | }>
51 |
52 |
53 |
54 | } >
55 | }>
56 | }>
57 | }>
58 | }>
59 | }>
60 | }>
61 | }>
62 |
63 |
64 |
65 | );
66 | };
67 |
68 | export default AllRoutes;
69 |
--------------------------------------------------------------------------------
/src/Pages/Home/Carousel.jsx:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import { Slide } from 'react-slideshow-image';
4 | import 'react-slideshow-image/dist/styles.css';
5 |
6 | const buttonStyle = {
7 | width: "30px",
8 | background: 'none',
9 | border: '0px'
10 | };
11 | const properties = {
12 | prevArrow: ,
13 | nextArrow:
14 | }
15 | const responsiveSettings = [
16 | {
17 | breakpoint: 800,
18 | settings: {
19 | slidesToShow: 1,
20 | slidesToScroll: 1
21 | }
22 | },
23 | {
24 | breakpoint: 500,
25 | settings: {
26 | slidesToShow: 1,
27 | slidesToScroll: 1
28 | }
29 | }
30 | ];
31 | const Carousal = () => {
32 | return (
33 |
34 |
35 |
36 |
37 |
38 |
39 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default Carousal;
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Filters/Accordians.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {
3 | Accordion,
4 | AccordionItem,
5 | AccordionButton,
6 | AccordionPanel,
7 | AccordionIcon,
8 | Box
9 | } from '@chakra-ui/react'
10 |
11 | const Accordians = () => {
12 | return (
13 |
118 | )
119 | }
120 |
121 | export default Accordians
122 |
--------------------------------------------------------------------------------
/src/Admin/Admin.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Heading,
4 | Tab,
5 | TabList,
6 | TabPanel,
7 | TabPanels,
8 | Tabs,
9 | } from "@chakra-ui/react";
10 | import React, { useEffect, useState } from "react";
11 | import AddProducts from "./Components/AddProducts";
12 | import ProductsList from "./Components/ProductsList";
13 |
14 | const Admin = () => {
15 | let [data, setData] = useState([]);
16 |
17 | useEffect(() => {
18 | fetch("https://digital-express.vercel.app/computers")
19 | .then((res) => res.json())
20 | .then((res) => setData(res));
21 | }, []);
22 |
23 | return (
24 |
25 |
26 |
27 | Home
28 | Add Product
29 | Products
30 |
31 |
32 |
33 |
34 | Welcome Mukesh
35 |
36 |
42 |
43 |
56 | {data.length} Products
57 |
58 |
59 |
72 | 0 Under Review
73 |
74 |
87 | 0 have'nt Pass Review
88 |
89 |
90 |
91 |
92 |
93 | Add Product
94 |
95 |
96 |
97 |
98 |
99 | All Products List
100 |
101 |
102 |
103 |
104 |
105 |
106 | );
107 | };
108 |
109 | export default Admin;
110 |
--------------------------------------------------------------------------------
/src/Pages/productdetailpage/prod.module.css:
--------------------------------------------------------------------------------
1 | .main {
2 | width: 90%;
3 | margin: auto;
4 | padding: 2px;
5 | display: flex;
6 | background-color: rgb(223, 223, 223);
7 | gap: 2px;
8 | }
9 |
10 | .box1 {
11 | flex: 3;
12 | background-color: white;
13 | }
14 |
15 | .box2 {
16 | flex: 6;
17 | background-color: white;
18 | }
19 |
20 | .heading {
21 | display: -webkit-box;
22 | -webkit-line-clamp: 1;
23 | -webkit-box-orient: vertical;
24 | overflow: hidden;
25 | text-align: left;
26 | margin: 10px;
27 | }
28 |
29 | .infobox {
30 | display: flex;
31 | }
32 |
33 | .info1 {
34 | flex: 7;
35 | border: 1px solid rgb(245, 247, 247);
36 | border-bottom: 0;
37 | padding: 10px;
38 | text-align: left;
39 | border-left: 0;
40 | }
41 |
42 | .info2 {
43 | flex: 6;
44 | border: 1px solid rgb(245, 247, 247);
45 | border-bottom: 0;
46 | text-align: left;
47 | padding: 10px;
48 | border-right: 0;
49 | }
50 |
51 | .info2>*{
52 | margin: 6px 0;
53 | }
54 |
55 | .mrp {
56 | display: flex;
57 | align-items: center;
58 | gap: 4px;
59 | color: rgb(87, 87, 87);
60 | }
61 |
62 | .inc {
63 | font-size: x-small;
64 | margin-top: -2;
65 | }
66 |
67 | .discount {
68 | color: rgb(126, 126, 126);
69 | }
70 |
71 | .delev {
72 | width: 24px;
73 | }
74 |
75 | .lines {
76 | font-size: x-small;
77 | }
78 |
79 | /* button box */
80 |
81 | .butbox {
82 | margin: 10px 0;
83 | display: flex;
84 | gap: 20px;
85 | }
86 |
87 | .butbox > * {
88 | flex: 1;
89 | color: white;
90 | border-radius: 2px;
91 | }
92 |
93 | .butbox>button:nth-child(1){
94 | background-color: rgb(228,37,41);
95 | padding: 8px 0;
96 | }
97 |
98 | .butbox>button:nth-child(1):hover{
99 | background-color: rgb(0, 0, 150);
100 | }
101 |
102 | .butbox>button:nth-child(2){
103 | background-color: rgb(252,96,39) ;
104 | padding: 8px 0;
105 | }
106 |
107 | .butbox>button:nth-child(2):hover{
108 | background-color: rgb(255, 68, 0) ;
109 | }
110 |
111 | .alert{
112 | position: fixed;
113 | top:0;
114 | background-color: rgb(0, 0, 255);
115 | padding: 20px 10px;
116 | margin: 20px 40%;
117 | width: 280px;
118 | border-radius: 10px;
119 | color: white;
120 | }
121 |
122 | .alert>h2{
123 | display: flex;
124 | align-items: center ;
125 | gap: 10px;
126 | }
127 |
128 |
129 | @media all and (max-width: 580px) {
130 | .main {
131 | display: grid;
132 | width: 90%;
133 | margin: auto;
134 | }
135 | .heading{
136 | font-size: small;
137 | }
138 |
139 | .infobox {
140 | display: grid;
141 | grid-template-areas:
142 | "box2 "
143 | "box1";
144 | }
145 | .info1 {
146 | grid-area: "box1";
147 | }
148 | .info2 {
149 | grid-area: "box2";
150 | }
151 | .butbox{
152 | position: fixed;
153 | background-color: blue;
154 | bottom: 0;
155 | left: 0;
156 | margin: 0;
157 | right: 0;
158 | gap: 0;
159 | }
160 |
161 | .butbox>button:nth-child(1){
162 | color: rgb(228,37,41);
163 | background-color: white;
164 | padding: 4px 0;
165 | }
166 |
167 | .butbox > * {
168 | border-radius: 0;
169 | }
170 |
171 | .butbox>button:nth-child(1):hover{
172 | background-color: rgb(0, 0, 150);
173 | color: white;
174 | }
175 |
176 | .alert{
177 | margin: 20px 28%;
178 | }
179 |
180 | .alert>h2{
181 | text-align: center;
182 | }
183 |
184 | }
185 |
--------------------------------------------------------------------------------
/src/Components/RegisterForm.jsx:
--------------------------------------------------------------------------------
1 | import { CheckCircleIcon } from "@chakra-ui/icons";
2 | import {
3 | Flex,
4 | FormControl,
5 | FormLabel,
6 | Input,
7 | Spacer,
8 | Text,
9 | useToast,
10 | } from "@chakra-ui/react";
11 | import React, { useState } from "react";
12 | import { useDispatch } from "react-redux";
13 | import { Link, useNavigate } from "react-router-dom";
14 | import { userSignUp } from "../Redux/auth/auth.action";
15 |
16 | const RegisterForm = () => {
17 | let intdata = {
18 | email: "",
19 | password: "",
20 | username: "",
21 | };
22 |
23 | const [data, setData] = useState(intdata);
24 | const dispatch = useDispatch();
25 | const toast = useToast();
26 | const navigate = useNavigate();
27 |
28 | const handleSubmit = (e) => {
29 | e.preventDefault();
30 |
31 | toast({
32 | position: "bottom-center",
33 | render: () => (
34 |
40 |
41 |
42 | Signed Up Successfully!!!
43 |
44 |
45 | ),
46 | });
47 | dispatch(userSignUp(data));
48 |
49 | setData(intdata);
50 | navigate("/login");
51 | };
52 |
53 | const handleChange = (e) => {
54 | console.log(1);
55 | const { name, value } = e.target;
56 | setData({ ...data, [name]: value });
57 | };
58 |
59 | return (
60 |
61 |
118 |
119 | );
120 | };
121 |
122 | export default RegisterForm;
123 |
--------------------------------------------------------------------------------
/src/Style/Navbar.css:
--------------------------------------------------------------------------------
1 | *{
2 | margin: 0;
3 | padding: 0;
4 |
5 | }
6 | body{
7 | width: 100%;
8 | }
9 | #main_nav{
10 | /* border: 4px solid green; */
11 | margin-top: 63px;
12 | }
13 | #menu_nav{
14 | color: white;
15 | font-size: small;
16 | font-weight: bold;
17 | }
18 | .input{
19 | display: grid;
20 | grid-template-columns: repeat(3,1fr);
21 | justify-content: space-between;
22 | border: 0px solid black;
23 | }
24 | .in input{
25 | width: 500px;
26 | }
27 | .dropdown {
28 | position: relative;
29 | display: inline-block;
30 | cursor: pointer;
31 |
32 | }
33 |
34 | .dropdown-content {
35 | /* margin-top: 20px; */
36 |
37 | display: none;
38 | position: absolute;
39 | right: 0;
40 | background-color: #f1f1f1;
41 |
42 | min-width: 318px;
43 |
44 | z-index: 1;
45 | }
46 |
47 | .dropdown-content p {
48 | font-size: 14px;
49 | text-decoration: none;
50 | margin: 10px;
51 | display: block;
52 | }
53 |
54 | .dropdown:hover .dropdown-content {display: block;}
55 |
56 | #dropdown-account{
57 | position: relative;
58 | display: inline-block;
59 | cursor: pointer;
60 |
61 |
62 | }
63 | #dropdown-account-content{
64 | position: absolute;
65 | display: none;
66 | /* border: 1px solid black; */
67 | border-radius: 10px;
68 | background-color: #003380;
69 | height: auto;
70 | min-width: 320px;
71 | right: 10;
72 | margin-top: 4px;
73 | padding: 20px;
74 | z-index: 10;
75 |
76 | }
77 | #dropdown-account:hover #dropdown-account-content{
78 | display: block;
79 | }
80 |
81 |
82 | #menu-dropdown{
83 | position: relative;
84 | display: inline-block;
85 | cursor: pointer;
86 |
87 | }
88 | .menu-dropdown-content{
89 | position: absolute;
90 | display: none;
91 | border-bottom-left-radius: 10px;
92 | border-bottom-right-radius: 10px;
93 | background-color:#003380 ;
94 | color: white;
95 | height: auto;
96 | top: 10;
97 | left: 0;
98 | width: 1000px;
99 | z-index: 2;
100 | cursor: pointer;
101 |
102 | }
103 |
104 | #menu-title{
105 | padding: 10px;
106 | cursor: pointer;
107 |
108 | }
109 | #menu-title:hover{
110 | background-color: #e42529;
111 | color: white;
112 | cursor: pointer;
113 | text-decoration: none;
114 |
115 | }
116 |
117 | #menu-dropdown:hover .menu-dropdown-content{
118 | display: block;
119 | cursor: pointer;
120 | }
121 |
122 | @media only screen and (max-width: 1300px) {
123 | #after-top{
124 | display: none;
125 | }
126 | #menu_nav{
127 | display: none;
128 | }
129 | #bottom_nav{
130 | display: none;
131 | }
132 | .input{
133 | grid-template-columns: repeat(1,1fr);
134 |
135 | }
136 | .in{
137 | margin-top: 90px;
138 | width: 100%;
139 | }
140 | .in input{
141 | width: 100%;
142 | }
143 | .logo{
144 | margin-left: 80px;
145 | margin-top: 1px;
146 | }
147 | .group{
148 | width: 100%;
149 | }
150 | /* #mobile_bar{
151 |
152 | display: flex;
153 | align-items: center;
154 | justify-content: space-between;
155 | padding-top: 15px;
156 | padding-bottom: 15px;
157 | } */
158 | #top-bar{
159 | display: none;
160 | }
161 | }
162 |
163 | @media only screen and (min-width: 1301px) {
164 | #mobile_bar{
165 | display: none
166 | };
167 | .input{
168 | grid-template-columns: repeat(1,1fr);
169 |
170 | }
171 | }
--------------------------------------------------------------------------------
/src/Components/LoginForm.jsx:
--------------------------------------------------------------------------------
1 | import { CheckCircleIcon, WarningIcon } from "@chakra-ui/icons";
2 | import {
3 | Flex,
4 | FormControl,
5 | FormLabel,
6 | Input,
7 | Spacer,
8 | Text,
9 | useToast,
10 | } from "@chakra-ui/react";
11 | import React, { useState } from "react";
12 | import { useDispatch, useSelector } from "react-redux";
13 | import { Link, useNavigate } from "react-router-dom";
14 | import { userLogin } from "../Redux/auth/auth.action";
15 |
16 | let intdata = {
17 | email: "",
18 | password: "",
19 | };
20 |
21 | const LoginForm = () => {
22 | const [data, setData] = useState(intdata);
23 | const existingData = useSelector((state) => state.authManager.userdata);
24 | const dispatch = useDispatch();
25 | const toast = useToast();
26 | const isAuth = useSelector((state) => state.authManager.isAuth);
27 | const navigate = useNavigate();
28 |
29 | const handleSubmit = (e) => {
30 | e.preventDefault();
31 | if (
32 | data.email !== existingData.email ||
33 | data.password !== existingData.password
34 | ) {
35 | toast({
36 | position: "bottom-center",
37 |
38 | render: () => (
39 |
40 |
41 |
42 | Ohh ! Sorry, You entered Wrong Email or Password. Please Enter Correct Details. Try Again Login!
43 |
44 |
45 | ),
46 | });
47 | } else {
48 | toast({
49 | position: "bottom-center",
50 | render: () => (
51 |
58 |
59 |
60 | You are Successfully Login. We redirected you to HomePage.
61 |
62 |
63 | ),
64 | });
65 | dispatch(userLogin());
66 | navigate("/");
67 | }
68 |
69 | setData(intdata);
70 | };
71 | const handleChange = (e) => {
72 | const { type, value } = e.target;
73 | setData({ ...data, [type]: value });
74 | };
75 |
76 |
77 | return (
78 |
79 |
120 |
121 | );
122 | };
123 |
124 | export default LoginForm;
125 |
--------------------------------------------------------------------------------
/src/Pages/Wishlist/wish.module.css:
--------------------------------------------------------------------------------
1 | .container{
2 | width: 94%;
3 | margin: auto;
4 | }
5 |
6 | .userdetail>div{
7 | display: flex;
8 | align-items: center;
9 | gap: 20px;
10 | margin: 10px;
11 | }
12 |
13 | .myinfo{
14 | margin: 8px auto 22px auto;
15 | }
16 |
17 | .myinfo>h2{
18 | font-size: medium;
19 | font-weight: bold;
20 | }
21 |
22 | .myinfo>p{
23 | font-size: medium;
24 | color: rgb(81, 81, 81);
25 | }
26 |
27 | /* ================= */
28 | /* part 2 */
29 | /* ==================== */
30 |
31 |
32 | .heading{
33 | background-color: rgba(185, 255, 255, 0.765);
34 | padding: 6px 20px;
35 | }
36 |
37 | .heading>h3{
38 | font-weight: 100;
39 | font-size: small;
40 | }
41 |
42 | .option{
43 | display: grid;
44 | grid-template-columns: repeat(3,1fr);
45 | gap: 20px;
46 | padding: 20px 10px;
47 | width: 100%;
48 | border: 2px solid black;
49 | }
50 |
51 |
52 |
53 | .option>div{
54 | padding: 10px;
55 | border: 1px solid rgba(173, 173, 173, 0.715);
56 | border-radius: 6px;
57 | height: 80px;
58 | display: flex;
59 | align-items:flex-start ;
60 | justify-content: space-between;
61 | }
62 |
63 | .option img{
64 | width: 60px;
65 | }
66 |
67 | .option h3{
68 | margin-left: 10px ;
69 | color: rgb(4, 4, 141);
70 | font-size: 14px;
71 | font-weight: bolder;
72 | }
73 |
74 | .option p{
75 | margin-left: 10px ;
76 | margin-top: 4px;
77 | font-weight: 100;
78 | color: rgba(49, 49, 49, 0.79);
79 | font-size: 12px;
80 | }
81 |
82 |
83 |
84 | /* data css */
85 |
86 |
87 |
88 | .proinfobox{
89 | border-radius: 4px;
90 | background-color: white;
91 | overflow: hidden;
92 | margin: 0;
93 | margin: 10px 0;
94 | padding: 4px 10px 0 10px ;
95 | padding: 0;
96 | box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
97 | }
98 |
99 | .productbox{
100 | display: flex;
101 | border: 0;
102 | padding: 10px;
103 | }
104 |
105 | .productbox>div:nth-child(1){
106 | flex: 1;
107 | }
108 | .productbox>div:nth-child(2){
109 | flex: 3;
110 | padding: 0 10px;
111 | }
112 | .productbox>div:nth-child(3){
113 | flex: 2;
114 | text-align: end;
115 | }
116 |
117 | .productbox h3{
118 | font-size: medium;
119 | font-weight: 400;
120 | color: rgb(0, 0, 126);
121 | display: -webkit-box;
122 | -webkit-line-clamp: 2;
123 | -webkit-box-orient: vertical;
124 | overflow: hidden;
125 | margin: 0 0 10px 0;
126 | }
127 |
128 | .productbox h2{
129 | font-size: medium;
130 | font-weight: 400;
131 | color: rgb(0, 0, 0);
132 | }
133 |
134 | .productbox h5>span{
135 | font-size: x-small;
136 | color: rgb(229,45,49);
137 | }
138 |
139 | .productbox h5{
140 | display: flex;
141 | align-items: center;
142 | gap: 6px ;
143 | }
144 |
145 | .cartimg{
146 | width: 80%;
147 | }
148 |
149 | .plslogo{
150 | color: black ;
151 | background-color: yellow;
152 | border-radius: 90px;
153 | padding: 4px;
154 | }
155 |
156 | #mxm{
157 | display: grid;
158 | gap: 6px;
159 | }
160 |
161 |
162 | #strikethrough{
163 | font-size: small;
164 | color: rgb(89, 122, 122);
165 | }
166 | #strikethrough>span{
167 | font-size: x-small;
168 | }
169 |
170 | .appendingdata{
171 | margin: 0;
172 | padding: 0;
173 | }
174 |
175 |
176 | #ships{
177 | font-size: 14px;
178 | color: rgb(27, 146, 146);
179 | }
180 |
181 |
182 | #delevery{
183 | display: flex;
184 | align-items: center;
185 | font-size: small;
186 | text-align: end;
187 | color: rgb(58, 58, 183);
188 | justify-content: flex-end;
189 | }
190 |
191 |
192 | #gov{
193 | font-size: 10px;
194 | color: rgb(27, 146, 146);
195 | }
196 |
197 |
198 |
199 | @media screen and (min-width:500px) and (max-width:800px) {
200 | .option{
201 | grid-template-columns: repeat(2,1fr);
202 | }
203 |
204 | .myinfo{
205 | display: none;
206 | }
207 |
208 | }
209 |
210 | @media screen and (max-width:500px) {
211 | .option{
212 | grid-template-columns: repeat(1,1fr);
213 | }
214 |
215 | .myinfo{
216 | display: none;
217 | }
218 | }
--------------------------------------------------------------------------------
/src/Pages/Home/SliderFormat.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Text, Image, Square } from "@chakra-ui/react";
3 | import { Navigation, Autoplay } from "swiper";
4 | import { Swiper, SwiperSlide } from "swiper/react";
5 | import "swiper/css";
6 | import "swiper/css/navigation";
7 | import "swiper/css/autoplay";
8 | import { Link } from "react-router-dom";
9 | import uuid from "react-uuid";
10 |
11 | const SliderFormat = ({ type }) => {
12 | return (
13 |
14 |
15 |
42 | {type.map((i) => (
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
57 | {i.name}
58 |
59 |
60 |
61 |
62 |
63 | Deal Price:{" "}
64 |
65 |
66 |
67 |
68 | ₹{i.price}
69 |
70 |
71 |
72 |
73 |
74 | MRP:{" "}
75 |
76 | {" "}
77 |
78 | ₹{i.mrp}
79 |
80 |
81 |
82 |
83 | You Save:{" "}
84 |
85 | {" "}
86 |
87 | {i.discount}
88 |
89 |
90 | {i.Rating}
91 |
101 |
102 | OFFERS AVAILABLE
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | ))}
111 |
112 |
113 |
114 | );
115 | };
116 |
117 | export default SliderFormat;
--------------------------------------------------------------------------------
/src/Pages/Home/Laptop.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Text, Image, Square } from "@chakra-ui/react";
3 | import { Navigation, Autoplay } from "swiper";
4 | import { Swiper, SwiperSlide } from "swiper/react";
5 | import "swiper/css";
6 | import "swiper/css/navigation";
7 | import "swiper/css/autoplay";
8 | import Heading from "./Heading";
9 | import { Link } from "react-router-dom";
10 | import uuid from "react-uuid";
11 |
12 | const Laptop = ({ type, heading }) => {
13 | return (
14 |
15 |
16 |
17 |
44 | {type.map((i) => (
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
59 | {i.name}
60 |
61 |
62 |
63 |
64 |
65 | Deal Price:{" "}
66 |
67 |
68 |
69 |
70 | ₹{i.price}
71 |
72 |
73 |
74 |
75 |
76 | MRP:{" "}
77 |
78 | {" "}
79 |
80 | ₹{i.mrp}
81 |
82 |
83 |
84 |
85 | You Save:{" "}
86 |
87 | {" "}
88 |
89 | {i.discount}
90 |
91 |
92 | {i.Rating}
93 |
103 |
104 | OFFERS AVAILABLE
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | ))}
113 |
114 |
115 |
116 | );
117 | };
118 |
119 | export default Laptop;
--------------------------------------------------------------------------------
/src/Pages/Home/Refrigirator.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Text, Image, Square } from "@chakra-ui/react";
3 | import { Navigation, Autoplay } from "swiper";
4 | import { Swiper, SwiperSlide } from "swiper/react";
5 | import "swiper/css";
6 | import "swiper/css/navigation";
7 | import "swiper/css/autoplay";
8 | import Heading from "./Heading";
9 | import { Link } from "react-router-dom";
10 | import uuid from "react-uuid";
11 |
12 | const Refri = ({ type, heading }) => {
13 | return (
14 |
15 |
16 |
17 |
44 | {type.map((i) => (
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
59 | {i.name}
60 |
61 |
62 |
63 |
64 |
65 | Deal Price:{" "}
66 |
67 |
68 |
69 |
70 | ₹{i.price}
71 |
72 |
73 |
74 |
75 |
76 | MRP:{" "}
77 |
78 | {" "}
79 |
80 | ₹{i.mrp}
81 |
82 |
83 |
84 |
85 | You Save:{" "}
86 |
87 | {" "}
88 |
89 | {i.discount}
90 |
91 |
92 | {i.Rating}
93 |
103 |
104 | OFFERS AVAILABLE
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | ))}
113 |
114 |
115 |
116 | );
117 | };
118 |
119 | export default Refri;
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Project Name - Reliance-Digital-Clone :
2 | Project Description:-This project is a collaborative effort to create a visually appealing simplified clone of the ‘Reliance Digital’ website utilizing HTML5, CSS3, JavaScript (ES6) and React.js. The goal is to replicate the main features and design elements of the current site to gain practical hand-on experience and showcase our skills in web development.
3 |
4 | Reliance Digital is an ECommerce Website. It is used for buying electrical products, home appliances & other miscellaneous items in day to day uses. Reliance Digital Stores are bigger in size than any other format Reliance Digital Mini Stores. It is one of the largest retailers of electronics in India with over 5,000 products in its inventory.
5 |
6 |
7 | ## Tech Stack Used :
8 |
9 | Increased website performance by optimizing front-end and back-end code for faster loading times.
10 | Applied responsive design principles to ensure consistent display and functionality across a wide range of devices, including mobile phones, tablets, and desktop computers, utilizing the below mentioned tech stacks :-
11 |
12 |
13 | ◉ JavaScript : 94.0%
14 | ◉ HTML : 0.6%
15 | ◉ CSS : 5.4%
16 |
17 |
18 | ## Functionalities :
19 |
20 |
21 |
22 | 1. Cart Functionality (like adding an item and removing)
23 | 2. Admin Page
24 | 3. Admin can add a product product Will be shown on the latest page
25 | 4. Login and Sign Up
26 |
27 |
28 | ## Features :
29 |
30 | - User Authentication (Login/Logout)
31 | - Product Listing
32 | - Product Details
33 | - Add to Cart
34 | - Sort and Filter Products
35 | - Responsive Design for optimal viewing on different devices
36 |
37 | ## Installation :
38 |
39 | To get started with the project, follow these steps:
40 |
41 | 1. **Clone the repository:**
42 | ```sh
43 | git clone - https://github.com/uttammane1/Reliance-Digital.git
44 | ```
45 |
46 | 2. **Navigate to the project directory:**
47 | ```sh
48 | cd Reliance-Digital
49 | ```
50 |
51 | 3. **Install dependencies:**
52 | ```sh
53 | npm install
54 | ```
55 |
56 | 4. **Install additional libraries:**
57 | ```sh
58 | npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion axios react-router-dom
59 | ```
60 |
61 | 5. **Start the development server:**
62 | ```sh
63 | npm start
64 | ```
65 |
66 | ## Technologies Used
67 |
68 | - **React:** Front-end library for building user interfaces
69 | - **React Router:** For routing and navigation
70 | - **Chakra UI:** For UI components and styling
71 | - **Axios:** For API requests
72 | - **Context API:** For state management
73 |
74 | ## Usage
75 |
76 | - **Home Page:** Browse the homepage for a selection of featured products.
77 | - **Product Listing:** View a list of all available products, with options to sort and filter.
78 | - **Product Details:** Click on a product to see detailed information.
79 | - **Add to Cart:** Add products to your cart and view your cart.
80 | - **Login/Logout:** Authenticate to gain access to personalized features.
81 |
82 | # Pages
83 |
84 | ## Navbar
85 | The navbar provides easy navigation throughout the site, including links to the Home, Products, Cart, and Checkout pages.
86 |
87 | 
88 |
89 |
90 | ## Home Page
91 | The home page showcases featured products and promotions, providing users with an overview of what is available.
92 |
93 | 
94 |
95 |
96 | ## Product Page
97 | The product page displays a list of products, complete with sorting and filtering options to help users find exactly what they need.
98 |
99 | 
100 |
101 |
102 | ## Cart Page
103 | The cart page allows users to view products they have added to their cart, adjust quantities, and proceed to checkout.
104 |
105 | 
106 |
107 | ## Checkout Page
108 | The checkout page enables users to finalize their purchases by entering their shipping information and payment details.
109 |
110 | 
111 |
--------------------------------------------------------------------------------
/src/Admin/Components/AddProducts.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | Flex,
5 | FormControl,
6 | FormLabel,
7 | Input,
8 | useToast,
9 | Text
10 | } from "@chakra-ui/react";
11 | import React, { useRef, useState } from "react";
12 | import {CheckCircleIcon, WarningIcon} from "@chakra-ui/icons"
13 | import { useNavigate } from "react-router-dom";
14 |
15 | const intitialData = {
16 | name: "",
17 | img: "",
18 | price: "",
19 | mrp: "",
20 | discount: "",
21 | brand: "",
22 | };
23 |
24 | const AddProducts = () => {
25 | const [data, setData] = useState(intitialData);
26 | const imgref = useRef();
27 | const [loading, setLoading] = useState(false);
28 | const toast = useToast();
29 | const navigate = useNavigate();
30 | const handleChange = (e) => {
31 | const { name, value } = e.target;
32 | setData({ ...data, [name]: value });
33 | };
34 |
35 | const handleImage = async () => {
36 | setLoading(true);
37 | let form = new FormData();
38 | form.append("image", imgref.current.files[0]);
39 | let res = await fetch(
40 | "https://api.imgbb.com/1/upload?expiration=600&key=0dc66cccd3a39544a0bdbcace49e0027",
41 | {
42 | method: "POST",
43 | body: form,
44 | }
45 | );
46 | let acc_res = await res.json();
47 | const imageurl = acc_res.data.display_url;
48 | console.log(imageurl);
49 | setData({ ...data, img: imageurl });
50 | setLoading(false);
51 | };
52 |
53 | const handleSubmit = async (e) => {
54 | e.preventDefault();
55 | if (data.name === "" || data.brand === "" || data.img === "" || data.price === "" || data.discount === "" || data.mrp === "") {
56 | toast({
57 | position: 'top-left',
58 |
59 | render: () => (
60 |
61 |
62 | Add Product Image
63 |
64 |
65 | ),
66 | })
67 | return
68 | }
69 | toast({
70 | position: 'top-left',
71 | render: () => (
72 |
73 |
74 | Product has been added!!
75 |
76 |
77 | ),
78 | })
79 | let res = await fetch("https://digital-express.vercel.app/computers", {
80 | method: "POST",
81 | body: JSON.stringify(data),
82 | headers: {
83 | "Content-Type": "application/json"
84 | }
85 |
86 | }).then(setData(intitialData));
87 | navigate("/")
88 |
89 | }
90 |
91 | return (
92 |
93 |
154 |
155 | );
156 | };
157 |
158 | export default AddProducts;
159 |
--------------------------------------------------------------------------------
/src/Pages/productdetailpage/ProductDetailpage.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Flex, Heading, Image, ListItem, Text, UnorderedList, useToast } from '@chakra-ui/react';
2 | import React, { useEffect, useState } from 'react'
3 | import mycs from "./prod.module.css";
4 |
5 | import { useParams } from 'react-router';
6 | import axios from 'axios';
7 | import { addItemCart } from '../../Redux/cart/cart.action';
8 | import { useDispatch } from 'react-redux';
9 | import { CheckCircleIcon } from '@chakra-ui/icons';
10 |
11 |
12 |
13 | const ProductDetailpage = () => {
14 | const [data, setData] = useState([]);
15 | const {name,id }= useParams()
16 | console.log(id,name)
17 | const dispatch = useDispatch();
18 | const toast = useToast();
19 |
20 |
21 |
22 | useEffect(() => {
23 | axios.get(`https://digital-express.vercel.app/${name}/${id}`).then((e)=>setData(e.data))
24 | }, [name,id]);
25 |
26 | return (
27 | <>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | {data.name}
36 |
37 |
38 |
39 |
40 |
41 | Key Features
42 |
43 |
44 | Definitive Quality
45 | High-Definition Clarity
46 | Transmits Original Colours
47 | Clear Touch' Easy Clean
48 |
49 |
50 | Return Policy
51 |
52 |
53 | Items are eligible for return within 7 Days of Delivery.
54 | All accessories, product & packaging need to be returned in original condition.
55 |
56 |
57 | Got Feedback to share on this page?
58 |
59 |
60 |
61 |
62 | ₹{data.price}
63 |
64 |
65 | MRP: {data.mrp} (Inclusive of all taxes)
66 |
67 |
68 | You Save: {data.discount}
69 |
70 |
71 | FREE Shipping!
72 |
73 | *Delivery assurance is subject to our delivery locations staying open as per govt. regulations
74 |
75 | {
76 | dispatch(addItemCart(data));
77 | toast({
78 | position: 'bottom-center',
79 | duration: 1200,
80 | render: () => (
81 |
82 |
83 | You Successfully Added Product in Cart. Please Check Your Cart!
84 |
85 | ),
86 | })
87 | }}>Add to Cart
88 | BUY NOW
89 |
90 |
91 |
92 |
93 |
94 |
95 | >
96 | )
97 | }
98 |
99 | export default ProductDetailpage
--------------------------------------------------------------------------------
/src/Pages/Home/Home.jsx:
--------------------------------------------------------------------------------
1 | import { Box } from "@chakra-ui/react";
2 | import React from "react";
3 | import Carousel from "./Carousel";
4 | import "react-slideshow-image/dist/styles.css";
5 | import {
6 | AppleWatch,
7 | Card1,
8 | Card2,
9 | Headphones,
10 | Explore1,
11 | Laptops,
12 | Laptops2,
13 | Phones,
14 | Refrigerators,
15 | TV,
16 | BrandPromises,
17 | } from "./Data";
18 | import Refri from "./Refrigirator";
19 | import Laptop from "./Laptop";
20 | import HomeCard1 from "./HomeCard1";
21 | import Slider3 from "./Slider3";
22 | import Laptop2 from "./Laptop2";
23 | import Explore from "./Explore";
24 | import BrandPromise from "./BrandPromise";
25 | import ImageSet from "./ImageSet";
26 |
27 | const Home = () => {
28 | return (
29 |
30 | {/* -----------------------------------slider1---------------------------- */}
31 |
32 |
33 |
34 |
35 |
36 | {/* --------------------------Home Appliances Fest------------------------- */}
37 |
38 |
39 |
40 |
41 |
42 | {/* --------------------------------Refrigirator--------------------------- */}
43 |
44 |
45 |
46 |
47 |
48 | {/*------------------------------Home Appliances Card1-----------------------*/}
49 |
50 |
51 |
52 |
53 |
54 | {/*------------------------------Home Appliances Card2-----------------------*/}
55 |
56 |
57 |
58 |
59 |
60 | {/*------------------------------------Slider3---------------------------------*/}
61 |
62 |
63 |
64 |
65 |
66 | {/*----------------------------------Brand Price------------------------------*/}
67 |
68 |
69 |
73 |
74 |
75 | {/*---------------------------------Trending Laptops----------------------------------*/}
76 |
77 |
81 |
86 |
87 |
88 | {/*---------------------------------Everyday Appliances---------------------------*/}
89 |
90 |
91 |
96 |
97 |
98 | {/*---------------------------------Trending in Televisions------------------------ */}
99 |
100 |
101 |
106 |
107 |
108 | {/*----------------------------------Price Drop on Apple Smartwatches------------------ */}
109 |
110 |
111 |
116 |
117 |
118 | {/*----------------------------------Best Selling Audio Accessories-----------------------*/}
119 |
120 |
121 |
126 |
127 |
128 | {/*--------------------------------EXPLORE OUR RANGE OF PRODUCTS---------------------- */}
129 |
130 |
131 |
132 |
133 |
134 | );
135 | };
136 |
137 | export default Home;
138 |
--------------------------------------------------------------------------------
/src/Components/Footer.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Container,
4 | Link,
5 | SimpleGrid,
6 | Stack,
7 | Text,
8 | Flex,
9 | useColorModeValue,
10 | Center,
11 | Image,
12 | } from '@chakra-ui/react';
13 | import {FaTwitter,FaFacebook,FaYoutube} from "react-icons/fa"
14 |
15 | const ListHeader = ({ children }) => {
16 | return (
17 |
18 | {children}
19 |
20 | );
21 | };
22 |
23 | export default function Footer() {
24 | return (
25 |
28 |
29 |
30 |
31 | PRODUCT CATEGORIES
32 | Smartphones
33 | Laptops
34 | DSLR Cameras
35 | Televisions
36 | Air Conditioners
37 | Refrigerators
38 | Kitchen Appliances
39 | Accessories
40 | Personal Care & Grooming
41 |
42 |
43 | SITE INFO
44 | About Digital Xpress
45 | resQ Services
46 | Site Map
47 | Gift Cards
48 | Corporate Enquries
49 | Contact Us
50 |
51 |
52 | RESOURCE CENTRE
53 | Product Reviews
54 | Buying Guides
55 | How Tos
56 | Featured Stories
57 | Events & Happenings
58 | Nearest Store
59 |
60 |
61 | POLICIES
62 | Terms of Use
63 | FAQs
64 | Cancellation and Return Policy
65 | Pricing and Payment Policy
66 | Shipping and Delivery Policy
67 | Privacy Policy
68 | E-waste Recycling Policy
69 | EMI and Additional Cashbak T&C
70 | DigitalOne Loyalty Program T&C
71 | Caution Notice
72 |
73 |
74 | {/*-------------------------------------------------------------------------------*/}
75 |
76 |
77 |
78 |
79 | FOLLOW US
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | EXPERIENCE RELIANCE DIGITAL APP ON MOBILE
92 |
93 |
94 |
100 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | {/**------------------------------------------------------------------------------ */}
113 |
114 |
115 |
116 |
117 | Disclaimer
118 |
119 |
120 |
121 |
122 | Product prices, offers and availability are subject to change from
123 | time to time. All prices are inclusive of taxes. Product colours &
124 | images are only for illustration and they may not exactly match with
125 | the actual product. Product specs are subject to change & may vary
126 | from actual product. While every care is taken to avoid inaccuracies
127 | in content, these are provided as is, without warranty of any kind.
128 |
129 |
130 |
136 |
137 |
138 |
139 |
140 | {" "}
141 | © 2024 Reliance Digital. All Rights Reserved. @Uttam Mane
142 |
143 |
144 |
145 |
146 | );
147 | }
--------------------------------------------------------------------------------
/src/Pages/Cart/cart.module.css:
--------------------------------------------------------------------------------
1 | .box{
2 | /* border: 2px solid black; */
3 | display: flex;
4 | justify-content: space-around;
5 | width: 90%;
6 | margin: 30px auto;
7 | background-color: unset;
8 | gap: 30px;
9 | }
10 |
11 | .box>div:nth-child(1){
12 | flex: 7;
13 | }
14 | .box>div:nth-child(2){
15 | flex: 3;
16 | }
17 |
18 | /* ===== product box styling ===== */
19 |
20 | .productbox{
21 | display: flex;
22 | border: 0;
23 | padding: 10px;
24 | }
25 |
26 | .proinfobox{
27 | border-radius: 4px;
28 | background-color: white;
29 | overflow: hidden;
30 | margin: 0;
31 | margin: 10px 0;
32 | padding: 4px 10px 0 10px ;
33 | padding: 0;
34 | box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
35 | }
36 |
37 | .cartimg{
38 | width: 80%;
39 | }
40 |
41 | .productbox>div:nth-child(1){
42 | flex: 1;
43 | }
44 | .productbox>div:nth-child(2){
45 | flex: 3;
46 | padding: 0 10px;
47 | }
48 | .productbox>div:nth-child(3){
49 | flex: 2;
50 | text-align: end;
51 | }
52 |
53 | .productbox h3{
54 | font-size: medium;
55 | font-weight: 400;
56 | color: rgb(0, 0, 126);
57 | display: -webkit-box;
58 | -webkit-line-clamp: 2;
59 | -webkit-box-orient: vertical;
60 | overflow: hidden;
61 | margin: 0 0 10px 0;
62 | }
63 |
64 | .productbox h2{
65 | font-size: medium;
66 | font-weight: 400;
67 | color: rgb(0, 0, 0);
68 | }
69 |
70 | .productbox h5>span{
71 | font-size: x-small;
72 | color: rgb(229,45,49);
73 | }
74 |
75 | .productbox h5{
76 | display: flex;
77 | align-items: center;
78 | gap: 6px ;
79 | }
80 |
81 | #strikethrough{
82 | font-size: small;
83 | color: rgb(89, 122, 122);
84 | }
85 | #strikethrough>span{
86 | font-size: x-small;
87 | }
88 |
89 | .plslogo{
90 | color: black ;
91 | background-color: yellow;
92 | border-radius: 90px;
93 | padding: 4px;
94 | }
95 |
96 | #delevery{
97 | display: flex;
98 | align-items: center;
99 | font-size: small;
100 | text-align: end;
101 | color: rgb(58, 58, 183);
102 | justify-content: flex-end;
103 | }
104 |
105 | #ships{
106 | font-size: 14px;
107 | color: rgb(27, 146, 146);
108 | }
109 |
110 | #gov{
111 | font-size: 10px;
112 | color: rgb(27, 146, 146);
113 | }
114 | #mxm{
115 | display: grid;
116 | gap: 6px;
117 | }
118 |
119 | /* ======= cart Product buttons =========== */
120 |
121 | .cartbutton{
122 | display: flex;
123 | width: 100%;
124 | margin: 0 auto 0 auto;
125 | }
126 | .cartbutton>button:nth-child(1){
127 | flex: 1;
128 | padding: 10px;
129 | margin: 0;
130 | background-color: white;
131 | border-radius: 0;
132 | border: 1px solid rgb(194, 194, 194) ;
133 | cursor: pointer;
134 | color: blue;
135 | border-bottom-left-radius: 4px ;
136 | }
137 | .cartbutton>button:nth-child(2){
138 | flex: 1;
139 | border-radius: 0;
140 | margin: 0;
141 | padding: 10px;
142 | border: 1px solid rgb(194, 194, 194) ;
143 | background-color: white;
144 | cursor: pointer;
145 | color: blue;
146 | border-bottom-right-radius: 4px ;
147 | }
148 |
149 |
150 | /* ================================== */
151 |
152 | /* ========= checkout Box =========== */
153 |
154 | .checkoutbox{
155 | padding: 10px;
156 | }
157 |
158 | .checkoutbox h4{
159 | font-size: medium;
160 | font-weight: 400;
161 | }
162 |
163 | #checkoutbtn{
164 | width: 100%;
165 | background: rgb(228,37,41);
166 | color: white;
167 | padding: 8px;
168 | border-radius: 3px;
169 | border: 0;
170 | }
171 |
172 | /* ======= cart coupon ============ */
173 |
174 | #coupon{
175 | display: flex;
176 | width: 100%;
177 | }
178 |
179 | #coupon>input{
180 | width: 70%;
181 | padding: 6px 18px;
182 | border: 1px solid rgb(199, 199, 199);
183 | border-right: 1px solid blue;
184 | outline: 0;
185 | border-top-left-radius: 3px ;
186 | border-top-right-radius: 0;
187 | border-bottom-right-radius: 0;
188 | border-bottom-left-radius: 3px;
189 | }
190 |
191 | #coupon>button{
192 | width: 30%;
193 | padding: 6px 10px;
194 | border: 1px solid rgb(199, 199, 199);
195 | border-left: 2px solid blue;
196 | color: blue;
197 | font-weight: 500;
198 | border-top-left-radius: 0 ;
199 | border-top-right-radius: 3px;
200 | border-bottom-right-radius: 3px;
201 | border-bottom-left-radius: 0;
202 | }
203 |
204 |
205 | /* ========== pricebox ========== */
206 |
207 | #pricebox{
208 | margin: 0 0 10px 0 ;
209 | }
210 |
211 | #pricebox>div{
212 | display: flex;
213 | align-items: center;
214 | justify-content: space-between;
215 | margin: 14px 0;
216 | }
217 |
218 | #pricebox h4{
219 | font-size: small ;
220 | color: teal;
221 | }
222 |
223 | .finalout{
224 | margin-top: 20px ;
225 | padding: 16px 14px ;
226 | display: grid;
227 | gap: 8px;
228 | background-color: white;
229 | box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
230 | }
231 |
232 | .finalout hr{
233 | border-radius: 20px;
234 | border: 1px solid rgba(160, 160, 160, 0.4);
235 | }
236 |
237 | .finalout>hr{
238 | margin: 8px 0;
239 | }
240 |
241 | .bottom{
242 | position: fixed;
243 | bottom: 0;
244 | left: 0;
245 | right: 0;
246 | display: none;
247 | background-color: white;
248 | }
249 | .bottom>button:nth-child(1){
250 | flex: 1;
251 | padding: 10px;
252 | border: 0;
253 | }
254 | .bottom>button:nth-child(2){
255 | flex: 1;
256 | background: rgb(228,37,41);
257 | color: white;
258 | padding: 10px;
259 | border: 0;
260 | }
261 |
262 | .payamt h5{
263 | font-family: 'Montserrat', sans-serif;
264 | color: rgb(105, 105, 105);
265 | font-weight: 500;
266 | }
267 |
268 |
269 | /* ====== media query for 0-980px =========== */
270 |
271 |
272 | @media screen and (max-width:980px) {
273 | .box{
274 | display: grid;
275 | grid-template-columns: repeat(1,1fr);
276 | }
277 | #checkoutbtn{
278 | display: none;
279 | }
280 |
281 | .bottom{
282 | display: flex;
283 | }
284 |
285 | }
286 |
287 | /* End */
--------------------------------------------------------------------------------
/src/Components/Navbar.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Flex,
4 | Image,
5 | Input,
6 | InputGroup,
7 | InputLeftElement,
8 | InputRightElement,
9 | Text,
10 | useDisclosure,
11 | useToast,
12 | } from "@chakra-ui/react";
13 | import React from "react";
14 | import { BsCartFill, BsFillFilePlusFill, BsFillMicFill } from "react-icons/bs";
15 | import { MdAccountCircle } from "react-icons/md";
16 | import { CheckCircleIcon, Search2Icon, WarningIcon } from "@chakra-ui/icons";
17 | import { FaShoppingCart } from "react-icons/fa";
18 | import { Hamburger } from "./NavComponents/Hamburger";
19 | import Dropdown from "./NavComponents/Dropdown";
20 | import {Link as RouterLink} from "react-router-dom"
21 | import { Link } from "react-router-dom";
22 | import { useDispatch, useSelector } from "react-redux";
23 | import { userLogout } from "../Redux/auth/auth.action";
24 |
25 |
26 |
27 | export const Navbar = () => {
28 | const username = useSelector((state) => state.authManager.userdata.username);
29 | const isAuth = useSelector((state) => state.authManager.isAuth)
30 | const dispatch = useDispatch();
31 | const toast = useToast();
32 | const {onClose } = useDisclosure()
33 |
34 | const handleLogOut = () => {
35 | if (!isAuth) {
36 | toast({
37 | position: 'bottom-center',
38 |
39 | duration: 1200,
40 |
41 | render: () => (
42 |
43 |
44 | You Are Not Login. Please Login Again!
45 |
46 | ),
47 | })
48 |
49 | } else {
50 |
51 | toast({
52 | position: 'bottom-center',
53 | duration: 1200,
54 | render: () => (
55 |
56 |
57 | You are Successfully Logged Out. Please Login Again!
58 |
59 | ),
60 | })
61 | dispatch(userLogout())
62 | }
63 |
64 |
65 |
66 | }
67 | return (
68 |
69 |
70 |
71 |
72 |
78 | Find a Store
79 | |
80 | Wishlist
81 | |
82 | Contact Us
83 |
84 |
85 |
86 |
87 |
88 |
95 |
96 |
101 |
102 |
103 |
109 | }
111 | paddingRight={"20px"}
112 | />
113 |
114 |
120 | {
121 | isAuth ?
122 | Hi, {username}
123 | |
124 | :
125 |
126 | Select Your Pin Code
127 | |
128 |
129 | }
130 |
131 |
132 | Cart
133 |
134 |
135 | {
136 | isAuth ?
137 |
138 | Logout
139 |
140 | :
141 |
142 |
143 |
144 | Login
145 |
146 |
147 |
148 | }
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
164 |
169 |
170 |
171 |
172 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 | }
190 | />
191 |
197 | }
199 | />
200 |
201 |
202 |
203 | );
204 | };
205 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Mobile.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect } from "react";
4 | import { getPostsMobile } from "../../Redux/Products/Product.action";
5 |
6 | import {
7 | Card,
8 | CardBody,
9 | CardFooter,
10 | Text,
11 | Button,
12 | Divider,
13 | Stack,
14 | Image,
15 | Badge,
16 | } from "@chakra-ui/react";
17 | import Filters from "./Filters/Filters";
18 | import { BsHeart } from "react-icons/bs";
19 | import Carousel from "./carousel";
20 | import { useState } from "react";
21 | import Skeleton from 'react-loading-skeleton'
22 | import 'react-loading-skeleton/dist/skeleton.css'
23 | import { addItemCart } from "../../Redux/cart/cart.action";
24 | import { Link } from "react-router-dom";
25 | const Mobile = () => {
26 | const { loading, error, data } = useSelector((store) => store.product);
27 |
28 |
29 |
30 | const [skeletonLoading,setSkeletonLoading] = useState(true)
31 |
32 | const dispatch = useDispatch();
33 | //console.log(data);
34 | useEffect(() => {
35 | setTimeout(() => {
36 | dispatch(getPostsMobile());
37 | setSkeletonLoading(false)
38 | }, 5000);
39 |
40 | }, []);
41 |
42 |
43 | const sortByLH = () => {
44 | console.log("LH",data);
45 | return data.sort((a, b) => b.name.localeCompare(a.name));
46 | // console.log("d",d);
47 | };
48 |
49 | const sortByHL = () => {
50 | console.log("HL",data);
51 |
52 | return data.sort((a, b) => a.name.localeCompare(b.name));
53 |
54 | };
55 |
56 |
57 |
58 | return (
59 | <>
60 |
61 |
62 |
63 |
64 |
65 |
73 | Filters
74 |
75 |
76 |
77 |
78 |
79 |
80 |
87 | Mobiles
88 |
89 | (Showing 1-{data.length} results of total Products )
90 |
91 |
Sort By : {" "}{" "}
92 | Relevance
93 | Low to High
94 | High to Low
95 |
96 |
97 |
98 | {skeletonLoading ?
99 |
100 | (
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
)
186 | :
187 |
188 | (
189 | {data.map((product) => (
190 |
191 |
192 |
193 |
199 |
200 |
201 |
207 | {product.name}
208 |
209 |
210 |
215 | {" "}
216 | ₹
217 | {product.mrp}
218 |
219 |
224 |
225 | ₹
226 | {product.mrp}{" "}
227 | {" "}
228 |
229 |
234 | {" "}
235 | ₹
236 | {product.discount}
237 |
238 |
239 |
240 |
246 | OFFERS AVAILABLE
247 |
248 |
254 | CASHBACK
255 |
256 |
257 |
258 |
259 |
260 |
261 |
267 |
268 | {
269 |
270 |
275 | Compare
276 |
277 | }
278 |
279 | }>
280 | Wishlist
281 |
282 |
283 |
284 |
285 | ))}
286 |
287 |
)}
288 |
289 |
290 | >
291 | );
292 | };
293 |
294 | export default Mobile;
295 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/ProductCards.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect, useState } from "react";
4 | import { getPosts } from "../../Redux/Products/Product.action";
5 | import Skeleton from 'react-loading-skeleton'
6 | import 'react-loading-skeleton/dist/skeleton.css'
7 | import { addItemCart } from "../../Redux/cart/cart.action";
8 | import {
9 | Card,
10 | CardBody,
11 | CardFooter,
12 | Text,
13 | Button,
14 | Divider,
15 | Stack,
16 |
17 | Image,
18 | Badge,
19 |
20 | } from "@chakra-ui/react";
21 | import Filters from "./Filters/Filters";
22 | import { AddIcon, MinusIcon } from "@chakra-ui/icons";
23 | import { BsHeart } from "react-icons/bs";
24 | import Carousel from "./carousel";
25 | import { Link } from "react-router-dom";
26 |
27 | const ProductCards = () => {
28 | const { loading, error, data } = useSelector((store) => store.product);
29 |
30 | const [skeletonLoading,setSkeletonLoading] = useState(true)
31 |
32 | const dispatch = useDispatch();
33 | //console.log(data);
34 | useEffect(() => {
35 | setTimeout(() => {
36 | dispatch(getPosts());
37 | setSkeletonLoading(false)
38 | }, 5000);
39 |
40 | }, []);
41 |
42 | const sortByLH = () => {
43 | console.log("LH",data);
44 | return data.sort((a, b) => b.name.localeCompare(a.name));
45 | // console.log("d",d);
46 | };
47 |
48 | const sortByHL = () => {
49 | console.log("HL",data);
50 |
51 | return data.sort((a, b) => a.name.localeCompare(b.name));
52 |
53 | };
54 |
55 |
56 |
57 | return (
58 | <>
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
74 | Filters
75 |
76 |
77 |
78 |
79 |
80 |
81 |
88 | Camera
89 |
90 | (Showing 1-{data.length} results of total Products )
91 |
92 |
Sort By : {" "}{" "}
93 | Relevance
94 | Low to High
95 | High to Low
96 |
97 |
98 |
99 | {skeletonLoading ?
100 |
101 | (
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
)
187 | :
188 |
189 | (
190 | {data.map((product) => (
191 |
192 |
193 |
194 |
200 |
201 |
202 |
208 | {product.name}
209 |
210 |
211 |
216 | {" "}
217 | ₹
218 | {product.mrp}
219 |
220 |
225 |
226 | ₹
227 | {product.mrp}{" "}
228 | {" "}
229 |
230 |
235 | {" "}
236 | ₹
237 | {product.discount}
238 |
239 |
240 |
241 |
247 | OFFERS AVAILABLE
248 |
249 |
255 | CASHBACK
256 |
257 |
258 |
259 |
260 |
261 |
262 |
268 |
269 | {
270 |
271 |
276 | Compare
277 |
278 | }
279 |
280 | }>
281 | Wishlist
282 |
283 |
284 |
285 |
286 | ))}
287 |
288 |
)}
289 |
290 |
291 | >
292 | );
293 | };
294 |
295 | export default ProductCards;
296 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Computer.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect, useState } from "react";
4 | import { getPosts, getPostsComputer, getPostsHeadPhone, getPostsMobile, getPostsTelevisions } from "../../Redux/Products/Product.action";
5 |
6 | import {
7 | Card,
8 | CardBody,
9 | CardFooter,
10 | Text,
11 | Button,
12 | Divider,
13 | Stack,
14 | Heading,
15 | Box,
16 | Image,
17 | Badge,
18 | Accordion,
19 | AccordionItem,
20 | AccordionButton,
21 | AccordionPanel,
22 | AccordionIcon,
23 | } from "@chakra-ui/react";
24 | import Filters from "./Filters/Filters";
25 | import { AddIcon, MinusIcon } from "@chakra-ui/icons";
26 | import { BsHeart } from "react-icons/bs";
27 | import Carousel from "./carousel";
28 | import Skeleton from 'react-loading-skeleton'
29 | import 'react-loading-skeleton/dist/skeleton.css'
30 | import { addItemCart } from "../../Redux/cart/cart.action";
31 | import { Link } from "react-router-dom";
32 | const Computer = () => {
33 | const { loading, error, data } = useSelector((store) => store.product);
34 |
35 | const [skeletonLoading,setSkeletonLoading] = useState(true)
36 |
37 | const dispatch = useDispatch();
38 | //console.log(data);
39 | useEffect(() => {
40 | setTimeout(() => {
41 | dispatch(getPostsComputer());
42 | setSkeletonLoading(false)
43 | }, 5000);
44 |
45 | }, []);
46 |
47 | const sortByLH = () => {
48 | console.log("LH",data);
49 | return data.sort((a, b) => b.name.localeCompare(a.name));
50 | // console.log("d",d);
51 | };
52 |
53 | const sortByHL = () => {
54 | console.log("HL",data);
55 |
56 | return data.sort((a, b) => a.name.localeCompare(b.name));
57 |
58 | };
59 |
60 |
61 |
62 | return (
63 | <>
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
79 | Filters
80 |
81 |
82 |
83 |
84 |
85 |
86 |
93 | Computers
94 |
95 | (Showing 1-{data.length} results of total Products )
96 |
97 |
Sort By : {" "}{" "}
98 | Relevance
99 | Low to High
100 | High to Low
101 |
102 |
103 |
104 | {skeletonLoading ?
105 |
106 | (
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
)
192 | :
193 |
194 | (
195 | {data.map((product) => (
196 |
197 |
198 |
199 |
205 |
206 |
207 |
213 | {product.name}
214 |
215 |
216 |
221 | {" "}
222 | ₹
223 | {product.mrp}
224 |
225 |
230 |
231 | ₹
232 | {product.mrp}{" "}
233 | {" "}
234 |
235 |
240 | {" "}
241 | ₹
242 | {product.discount}
243 |
244 |
245 |
246 |
252 | OFFERS AVAILABLE
253 |
254 |
260 | CASHBACK
261 |
262 |
263 |
264 |
265 |
266 |
267 |
273 |
274 | {
275 |
276 |
281 | Comapre
282 |
283 | }
284 |
285 | }>
286 | Wishlist
287 |
288 |
289 |
290 |
291 | ))}
292 |
293 |
)}
294 |
295 |
296 | >
297 | );
298 | };
299 |
300 | export default Computer;
301 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Personal.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect, useState } from "react";
4 | import { getPosts, getPostsMobile, getPostsPersonal, getPostsTelevisions } from "../../Redux/Products/Product.action";
5 | import Skeleton from 'react-loading-skeleton'
6 | import 'react-loading-skeleton/dist/skeleton.css'
7 | import { addItemCart } from "../../Redux/cart/cart.action";
8 | import {
9 | Card,
10 | CardBody,
11 | CardFooter,
12 | Text,
13 | Button,
14 | Divider,
15 | Stack,
16 | Heading,
17 | Box,
18 | Image,
19 | Badge,
20 | Accordion,
21 | AccordionItem,
22 | AccordionButton,
23 | AccordionPanel,
24 | AccordionIcon,
25 | } from "@chakra-ui/react";
26 | import Filters from "./Filters/Filters";
27 | import { AddIcon, MinusIcon } from "@chakra-ui/icons";
28 | import { BsHeart } from "react-icons/bs";
29 | import Carousel from "./carousel";
30 | import { Link } from "react-router-dom";
31 |
32 | const Personal = () => {
33 | const { loading, error, data } = useSelector((store) => store.product);
34 |
35 |
36 | const [skeletonLoading,setSkeletonLoading] = useState(true)
37 |
38 | const dispatch = useDispatch();
39 | //console.log(data);
40 | useEffect(() => {
41 | setTimeout(() => {
42 | dispatch(getPostsPersonal());
43 | setSkeletonLoading(false)
44 | }, 5000);
45 |
46 | }, []);
47 |
48 |
49 | const sortByLH = () => {
50 | console.log("LH",data);
51 | return data.sort((a, b) => b.name.localeCompare(a.name));
52 | // console.log("d",d);
53 | };
54 |
55 | const sortByHL = () => {
56 | console.log("HL",data);
57 |
58 | return data.sort((a, b) => a.name.localeCompare(b.name));
59 |
60 | };
61 |
62 |
63 |
64 | return (
65 | <>
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
81 | Filters
82 |
83 |
84 |
85 |
86 |
87 |
88 |
95 | Personal Care
96 |
97 | (Showing 1-{data.length} results of total Products )
98 |
99 |
Sort By : {" "}{" "}
100 | Relevance
101 | Low to High
102 | High to Low
103 |
104 |
105 |
106 | {skeletonLoading ?
107 |
108 | (
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
)
194 | :
195 |
196 | (
197 | {data.map((product) => (
198 |
199 |
200 |
201 |
207 |
208 |
209 |
215 | {product.name}
216 |
217 |
218 |
223 | {" "}
224 | ₹
225 | {product.mrp}
226 |
227 |
232 |
233 | ₹
234 | {product.mrp}{" "}
235 | {" "}
236 |
237 |
242 | {" "}
243 | ₹
244 | {product.discount}
245 |
246 |
247 |
248 |
254 | OFFERS AVAILABLE
255 |
256 |
262 | CASHBACK
263 |
264 |
265 |
266 |
267 |
268 |
269 |
275 |
276 | {
277 |
278 |
283 | Compare
284 |
285 | }
286 |
287 | }>
288 | Wishlist
289 |
290 |
291 |
292 |
293 | ))}
294 |
295 |
)}
296 |
297 |
298 | >
299 | );
300 | };
301 |
302 | export default Personal;
303 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/Kitchen.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect, useState } from "react";
4 | import { getPosts, getPostsHeadPhone, getPostsHome, getPostsKitchen, getPostsMobile, getPostsTelevisions } from "../../Redux/Products/Product.action";
5 |
6 | import {
7 | Card,
8 | CardBody,
9 | CardFooter,
10 | Text,
11 | Button,
12 | Divider,
13 | Stack,
14 | Heading,
15 | Box,
16 | Image,
17 | Badge,
18 | Accordion,
19 | AccordionItem,
20 | AccordionButton,
21 | AccordionPanel,
22 | AccordionIcon,
23 | } from "@chakra-ui/react";
24 | import Filters from "./Filters/Filters";
25 | import { AddIcon, MinusIcon } from "@chakra-ui/icons";
26 | import { BsHeart } from "react-icons/bs";
27 | import Carousel from "./carousel";
28 | import Skeleton from 'react-loading-skeleton'
29 | import 'react-loading-skeleton/dist/skeleton.css'
30 | import { addItemCart } from "../../Redux/cart/cart.action";
31 | import { Link } from "react-router-dom";
32 | const Kitchen = () => {
33 | const { loading, error, data } = useSelector((store) => store.product);
34 |
35 | const [skeletonLoading,setSkeletonLoading] = useState(true)
36 |
37 | const dispatch = useDispatch();
38 | //console.log(data);
39 | useEffect(() => {
40 | setTimeout(() => {
41 | dispatch(getPostsKitchen());
42 | setSkeletonLoading(false)
43 | }, 5000);
44 |
45 | }, []);
46 |
47 |
48 | const sortByLH = () => {
49 | console.log("LH",data);
50 | return data.sort((a, b) => b.name.localeCompare(a.name));
51 | // console.log("d",d);
52 | };
53 |
54 | const sortByHL = () => {
55 | console.log("HL",data);
56 |
57 | return data.sort((a, b) => a.name.localeCompare(b.name));
58 |
59 | };
60 |
61 |
62 |
63 | return (
64 | <>
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
80 | Filters
81 |
82 |
83 |
84 |
85 |
86 |
87 |
94 | Kitchen
95 |
96 | (Showing 1-{data.length} results of total Products )
97 |
98 |
Sort By : {" "}{" "}
99 | Relevance
100 | Low to High
101 | High to Low
102 |
103 |
104 |
105 | {skeletonLoading ?
106 |
107 | (
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
)
193 | :
194 |
195 | (
196 | {data.map((product) => (
197 |
198 |
199 |
200 |
206 |
207 |
208 |
214 | {product.name}
215 |
216 |
217 |
222 | {" "}
223 | ₹
224 | {product.mrp}
225 |
226 |
231 |
232 | ₹
233 | {product.mrp}{" "}
234 | {" "}
235 |
236 |
241 | {" "}
242 | ₹
243 | {product.discount}
244 |
245 |
246 |
247 |
253 | OFFERS AVAILABLE
254 |
255 |
261 | CASHBACK
262 |
263 |
264 |
265 |
266 |
267 |
268 |
274 |
275 | {
276 |
277 |
282 | Compare
283 |
284 | }
285 |
286 | }>
287 | Wishlist
288 |
289 |
290 |
291 |
292 | ))}
293 |
294 |
)}
295 |
296 |
297 | >
298 | );
299 | };
300 |
301 | export default Kitchen;
302 |
--------------------------------------------------------------------------------
/src/Pages/ProductCard/HeadPhone.jsx:
--------------------------------------------------------------------------------
1 | import { useSelector, useDispatch } from "react-redux";
2 | import { store } from "../../Redux/store";
3 | import React, { useEffect, useState } from "react";
4 | import { getPosts, getPostsHeadPhone, getPostsMobile, getPostsTelevisions } from "../../Redux/Products/Product.action";
5 |
6 | import {
7 | Card,
8 | CardBody,
9 | CardFooter,
10 | Text,
11 | Button,
12 | Divider,
13 | Stack,
14 | Heading,
15 | Box,
16 | Image,
17 | Badge,
18 | Accordion,
19 | AccordionItem,
20 | AccordionButton,
21 | AccordionPanel,
22 | AccordionIcon,
23 | } from "@chakra-ui/react";
24 | import Filters from "./Filters/Filters";
25 | import { AddIcon, MinusIcon } from "@chakra-ui/icons";
26 | import { BsHeart } from "react-icons/bs";
27 | import Carousel from "./carousel";
28 | import Skeleton from 'react-loading-skeleton'
29 | import 'react-loading-skeleton/dist/skeleton.css'
30 | import { addItemCart } from "../../Redux/cart/cart.action";
31 | import { Link } from "react-router-dom";
32 | const HeadPhone = () => {
33 | const { loading, error, data } = useSelector((store) => store.product);
34 |
35 |
36 | const [skeletonLoading,setSkeletonLoading] = useState(true)
37 |
38 | const dispatch = useDispatch();
39 | //console.log(data);
40 | useEffect(() => {
41 | setTimeout(() => {
42 | dispatch(getPostsHeadPhone());
43 | setSkeletonLoading(false)
44 | }, 5000);
45 |
46 | }, []);
47 |
48 | const sortByLH = () => {
49 | console.log("LH",data);
50 | return data.sort((a, b) => b.name.localeCompare(a.name));
51 | // console.log("d",d);
52 | };
53 |
54 | const sortByHL = () => {
55 | console.log("HL",data);
56 |
57 | return data.sort((a, b) => a.name.localeCompare(b.name));
58 |
59 | };
60 |
61 |
62 |
63 | return (
64 | <>
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
80 | Filters
81 |
82 |
83 |
84 |
85 |
86 |
87 |
94 | Headphones
95 |
96 | (Showing 1-{data.length} results of total Products )
97 |
98 |
Sort By : {" "}{" "}
99 | Relevance
100 | Low to High
101 | High to Low
102 |
103 |
104 |
105 | {skeletonLoading ?
106 |
107 | (
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
)
193 | :
194 |
195 | (
196 | {data.map((product) => (
197 |
198 |
199 |
200 |
206 |
207 |
208 |
214 | {product.name}
215 |
216 |
217 |
222 | {" "}
223 | ₹
224 | {product.mrp}
225 |
226 |
231 |
232 | ₹
233 | {product.mrp}{" "}
234 | {" "}
235 |
236 |
241 | {" "}
242 | ₹
243 | {product.discount}
244 |
245 |
246 |
247 |
253 | OFFERS AVAILABLE
254 |
255 |
261 | CASHBACK
262 |
263 |
264 |
265 |
266 |
267 |
268 |
274 |
275 | {
276 |
277 |
282 | {
283 | let obj = {}
284 | for(let i of data)
285 | if(i.id === product.id){
286 | obj = i
287 | }
288 | dispatch(addItemCart(obj));
289 |
290 | }}>Add to Cart
291 |
292 | }
293 |
294 | }>
295 | Wishlist
296 |
297 |
298 |
299 |
300 | ))}
301 |
302 |
)}
303 |
304 |
305 | >
306 | );
307 | };
308 |
309 | export default HeadPhone;
310 |
--------------------------------------------------------------------------------