├── .gitignore
├── project
├── public
│ ├── robots.txt
│ ├── favicon.ico
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── index.html
├── src
│ ├── assets
│ │ └── Logo.png
│ ├── image
│ │ └── SizeChart.jpeg
│ ├── components
│ │ ├── Confirm
│ │ │ ├── Logo.png
│ │ │ ├── Header.jsx
│ │ │ ├── Product.jsx
│ │ │ ├── Footer.jsx
│ │ │ └── Confirm.jsx
│ │ ├── Delivery
│ │ │ ├── Logo.png
│ │ │ ├── Header.jsx
│ │ │ ├── Footer.jsx
│ │ │ ├── Address.jsx
│ │ │ └── Delivery.jsx
│ │ ├── Payment
│ │ │ ├── Logo.png
│ │ │ ├── jcb.png
│ │ │ ├── visa.png
│ │ │ ├── dinersClub.png
│ │ │ ├── masterCard.jpg
│ │ │ ├── unionPay.png
│ │ │ ├── americanExpress.png
│ │ │ ├── Header.jsx
│ │ │ ├── Footer.jsx
│ │ │ └── Payment.jsx
│ │ ├── Products.css
│ │ ├── Navbar.css
│ │ ├── Pagination.jsx
│ │ ├── sidebar
│ │ │ ├── Header.jsx
│ │ │ └── Sidebar.jsx
│ │ ├── Wishlist.jsx
│ │ ├── Footer.jsx
│ │ ├── ListChild.jsx
│ │ ├── Carousel.jsx
│ │ ├── Products.jsx
│ │ ├── ProductList.jsx
│ │ ├── Navbar.jsx
│ │ └── ProductDetails.jsx
│ ├── redux
│ │ ├── social
│ │ │ ├── social.types.js
│ │ │ ├── social.actions.js
│ │ │ └── social.reducer.js
│ │ ├── products
│ │ │ ├── ProdactionTypes.js
│ │ │ ├── ProdReducer.js
│ │ │ └── Prodaction.js
│ │ ├── auth
│ │ │ ├── auth.types.js
│ │ │ ├── auth.actions.js
│ │ │ └── auth.reducer.js
│ │ └── store.js
│ ├── App.test.js
│ ├── App.jsx
│ ├── index.js
│ ├── App.css
│ ├── components_css
│ │ └── ProductDetails.css
│ └── pages
│ │ ├── AllRoutes.jsx
│ │ ├── Home.jsx
│ │ └── Social.jsx
├── .gitignore
├── package.json
└── README.md
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Local Netlify folder
2 | .netlify
3 |
--------------------------------------------------------------------------------
/project/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/public/favicon.ico
--------------------------------------------------------------------------------
/project/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/public/logo192.png
--------------------------------------------------------------------------------
/project/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/public/logo512.png
--------------------------------------------------------------------------------
/project/src/assets/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/assets/Logo.png
--------------------------------------------------------------------------------
/project/src/image/SizeChart.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/image/SizeChart.jpeg
--------------------------------------------------------------------------------
/project/src/components/Confirm/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Confirm/Logo.png
--------------------------------------------------------------------------------
/project/src/components/Delivery/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Delivery/Logo.png
--------------------------------------------------------------------------------
/project/src/components/Payment/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/Logo.png
--------------------------------------------------------------------------------
/project/src/components/Payment/jcb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/jcb.png
--------------------------------------------------------------------------------
/project/src/components/Payment/visa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/visa.png
--------------------------------------------------------------------------------
/project/src/components/Payment/dinersClub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/dinersClub.png
--------------------------------------------------------------------------------
/project/src/components/Payment/masterCard.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/masterCard.jpg
--------------------------------------------------------------------------------
/project/src/components/Payment/unionPay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/unionPay.png
--------------------------------------------------------------------------------
/project/src/components/Payment/americanExpress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/himanshudestiny/Nyresa/HEAD/project/src/components/Payment/americanExpress.png
--------------------------------------------------------------------------------
/project/src/redux/social/social.types.js:
--------------------------------------------------------------------------------
1 | export const USER_LOADING = "users/loading";
2 | export const USER_ERROR = "users/error";
3 |
4 | export const ADD_USER = "users/add";
5 |
--------------------------------------------------------------------------------
/project/src/redux/products/ProdactionTypes.js:
--------------------------------------------------------------------------------
1 | export const GET_PRODUCT = "get/products";
2 |
3 | export const Loading = "products/loading";
4 |
5 | export const Filter = "data/filter";
6 |
--------------------------------------------------------------------------------
/project/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 |
--------------------------------------------------------------------------------
/project/src/redux/auth/auth.types.js:
--------------------------------------------------------------------------------
1 | export const AUTH_SIGN_IN_LOADING = "auth/signin/loading";
2 | export const AUTH_SIGN_IN_SUCCESS = "auth/signin/success";
3 | export const AUTH_SIGN_IN_ERROR = "auth/signin/error";
4 | export const AUTH_SIGN_OUT = "auth/signout";
5 |
6 | export const RESET_AUTH = "auth/reset";
7 |
--------------------------------------------------------------------------------
/project/.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 |
--------------------------------------------------------------------------------
/project/src/App.jsx:
--------------------------------------------------------------------------------
1 | import "./App.css";
2 | import Navbar from "./components/Navbar";
3 | import AllRoutes from "./pages/AllRoutes";
4 | import { useEffect } from "react";
5 |
6 | function App() {
7 | useEffect(() => {
8 | document.title = "NYRESA";
9 | }, []);
10 |
11 | return (
12 |
16 | );
17 | }
18 |
19 | export default App;
20 |
--------------------------------------------------------------------------------
/project/src/redux/social/social.actions.js:
--------------------------------------------------------------------------------
1 | import { USER_LOADING, USER_ERROR, ADD_USER } from "./social.types";
2 | import axios from "axios";
3 |
4 | export const addUser = (newUser) => async (dispatch) => {
5 | dispatch({ type: USER_LOADING });
6 | try {
7 | let res = axios.post("https://nyresa-database.vercel.app/users", {
8 | ...newUser,
9 | });
10 | dispatch({ type: ADD_USER, payload: res.data });
11 | } catch (error) {
12 | dispatch({ type: USER_ERROR, payload: error.message });
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/project/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App";
4 | import { ChakraProvider } from "@chakra-ui/react";
5 | import { BrowserRouter } from "react-router-dom";
6 | import { Provider as ReduxProvider } from "react-redux";
7 | import { store } from "./redux/store";
8 |
9 | const root = ReactDOM.createRoot(document.getElementById("root"));
10 | root.render(
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | );
19 |
--------------------------------------------------------------------------------
/project/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 |
--------------------------------------------------------------------------------
/project/src/redux/auth/auth.actions.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import {
3 | AUTH_SIGN_IN_LOADING,
4 | AUTH_SIGN_IN_SUCCESS,
5 | AUTH_SIGN_IN_ERROR,
6 | AUTH_SIGN_OUT,
7 | } from "./auth.types";
8 |
9 | export const login = (creds) => async (dispatch) => {
10 | dispatch({ type: AUTH_SIGN_IN_LOADING });
11 | try {
12 | let res = await axios.post("https://reqres.in/api/login", creds);
13 | dispatch({ type: AUTH_SIGN_IN_SUCCESS, payload: res.data });
14 | } catch (error) {
15 | dispatch({ type: AUTH_SIGN_IN_ERROR, payload: error.message });
16 | }
17 | };
18 |
19 | export const logout = () => ({ type: AUTH_SIGN_OUT });
20 |
--------------------------------------------------------------------------------
/project/src/redux/store.js:
--------------------------------------------------------------------------------
1 | import {
2 | legacy_createStore,
3 | applyMiddleware,
4 | combineReducers,
5 | compose,
6 | } from "redux";
7 | import thunk from "redux-thunk";
8 | import { authReducer } from "./auth/auth.reducer";
9 | import { socialReducer } from "./social/social.reducer";
10 | import { prodReducer } from "./products/ProdReducer";
11 |
12 | const rootReducer = combineReducers({
13 | socialManager: socialReducer,
14 | authManager: authReducer,
15 | prodManager: prodReducer,
16 | });
17 |
18 | const composer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
19 |
20 | export const store = legacy_createStore(
21 | rootReducer,
22 | composer(applyMiddleware(thunk))
23 | );
24 |
--------------------------------------------------------------------------------
/project/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/project/src/redux/products/ProdReducer.js:
--------------------------------------------------------------------------------
1 | import { GET_PRODUCT, Loading, Filter } from "./ProdactionTypes";
2 |
3 | const init = {
4 | loading: false,
5 | data: [],
6 | };
7 |
8 | export const prodReducer = (state = init, action) => {
9 | switch (action.type) {
10 | case Loading: {
11 | return {
12 | ...state,
13 | loading: true,
14 | };
15 | }
16 |
17 | case GET_PRODUCT: {
18 | return {
19 | ...state,
20 | loading: false,
21 | data: action.payload,
22 | };
23 | }
24 |
25 | // case Filter: {
26 | // return {
27 | // ...state,
28 | // loading: false,
29 | // data: action.payload,
30 | // };
31 | // }
32 |
33 | default: {
34 | return state;
35 | }
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/project/src/redux/social/social.reducer.js:
--------------------------------------------------------------------------------
1 | import { USER_LOADING, USER_ERROR, ADD_USER } from "./social.types";
2 |
3 | const initialState = {
4 | loading: false,
5 | error: false,
6 | users: [],
7 | };
8 |
9 | export const socialReducer = (state = initialState, { type, payload }) => {
10 | switch (type) {
11 | case USER_LOADING: {
12 | return {
13 | ...state,
14 | loading: true,
15 | };
16 | }
17 | case USER_ERROR: {
18 | return {
19 | ...state,
20 | loading: false,
21 | error: payload || true,
22 | };
23 | }
24 | case ADD_USER: {
25 | return {
26 | ...state,
27 | loading: false,
28 | users: [...state.users, payload],
29 | };
30 | }
31 |
32 | default:
33 | return state;
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/project/src/components/Products.css:
--------------------------------------------------------------------------------
1 | *{
2 | /* color:rgb(0, 0, 0) */
3 | }
4 |
5 | .hovereffect:hover{
6 | color: black;
7 | }
8 |
9 | .sortsec{
10 | display: flex;
11 | justify-content: space-between;
12 | width: 100%;
13 | margin: auto;
14 |
15 |
16 | }
17 |
18 | @media only screen and (max-width:500px) {
19 | .sortsec{
20 | justify-content: space-around;
21 | }
22 |
23 | }
24 |
25 | .subtitle{
26 | font-family:'Courier New', Courier, monospace,monospace;
27 | font-weight: bold;
28 | color: gray;
29 | }
30 |
31 | .subtitle:hover{
32 | color: black;
33 | }
34 | .price{
35 | display:flex;
36 | justify-content: space-between;
37 |
38 | width: 60%;
39 | margin: auto;
40 | margin-top: 8px;
41 |
42 | }
43 |
44 | .eldiv:hover{
45 | box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px;
46 | }
47 |
--------------------------------------------------------------------------------
/project/src/components/Navbar.css:
--------------------------------------------------------------------------------
1 | .NavOne {
2 | font-family: "Arial, Helvetica, sans-serif";
3 | font-weight: 600;
4 | width: 95%;
5 | margin: auto;
6 | }
7 |
8 | .NavOne p {
9 | color: rgb(89, 88, 88);
10 | }
11 |
12 | .NavOne p:hover {
13 | color: black;
14 | }
15 | .categ {
16 | padding: 20px;
17 | font-family: "Century Gothic";
18 | font-weight: 400;
19 | text-transform: uppercase;
20 | }
21 | .categ:hover {
22 | background-color: #f2f2f2;
23 | }
24 | #heart {
25 | color: rgb(89, 88, 88);
26 | align-items: "center";
27 | justify-content: "center";
28 | }
29 | #heart:hover {
30 | color: black;
31 | }
32 |
33 | #cart {
34 | color: rgb(89, 88, 88);
35 | }
36 | #cart:hover {
37 | color: black;
38 | }
39 | .stickyNav {
40 | color: #9f2943;
41 | text-align: center;
42 | position: -webkit-sticky;
43 |
44 | background-color: #f2f2f2;
45 | position: sticky;
46 | top: 0;
47 | }
48 |
--------------------------------------------------------------------------------
/project/src/components_css/ProductDetails.css:
--------------------------------------------------------------------------------
1 | .Product_details_Mega_container{
2 | width: 80%;
3 | height: auto;
4 | display: flex;
5 | }
6 | .Product_details_Mega_container div{
7 | width: 50%;
8 | }
9 | .Product_details_Mega_container_second_child{
10 | text-align: left;
11 | }
12 | .Product_details_Mega_container_first_child{
13 | display: flex;
14 | }
15 |
16 | @media screen and (max-width: 800px) {
17 | .Product_details_Mega_container
18 | {
19 | display:grid;
20 | }
21 | .Product_details_Mega_container div{
22 | width: 100%;
23 | }
24 | }
25 |
26 | .checkoutDiv{
27 | margin-top: 40px;
28 | margin-bottom: 40px;
29 | padding: '10px';
30 | display: flex;
31 | justify-content: space-around;
32 | }
33 |
34 |
35 | @media screen and (max-width: 800px)
36 | {
37 | .checkoutDiv{
38 | display: grid;
39 | }
40 | .checkoutDiv_button
41 | {
42 | margin-top: 10px;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Nyresa
2 |
3 | Description
4 | Nyresa is basically an e-commerce website where users can buy products such as clothings, apparels etc.
5 |
6 |
7 |
8 |
9 |
10 | Tech Stacks we have used
11 |
12 | React
13 | JavaScript
14 | Redux
15 | ChakraUI
16 |
17 |
18 | Features
19 |
20 | Landing Page
21 | Signup-Signin Page
22 | Products Page
23 | Single Product Page
24 | Cart Page
25 | Wishlist
26 | Checkout Page
27 |
28 |
29 | Deployed Link
30 | https://numerous-governor-3295.netlify.app/
31 |
32 |
Presentation Link
33 | https://drive.google.com/file/d/1TPtnOJjYIUWNhWusZLpNrRyZ4duzLj-i/view
34 |
--------------------------------------------------------------------------------
/project/src/components/Pagination.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { ChevronRightIcon, ChevronLeftIcon } from "@chakra-ui/icons";
3 |
4 | const Pagination = ({ count, currentPage, updateCurrentPage }) => {
5 | let arr = new Array(count).fill(0);
6 |
7 | return (
8 |
9 | updateCurrentPage(currentPage - 1)}
12 | >
13 |
14 |
15 |
16 | {arr.map((el, i) => (
17 | updateCurrentPage(i + 1)}
23 | >
24 | {i + 1}
25 |
26 | ))}
27 |
28 | updateCurrentPage(currentPage + 1)}
31 | >
32 |
33 |
34 |
35 | );
36 | };
37 |
38 | export default Pagination;
39 |
--------------------------------------------------------------------------------
/project/src/redux/auth/auth.reducer.js:
--------------------------------------------------------------------------------
1 | import {
2 | AUTH_SIGN_IN_LOADING,
3 | AUTH_SIGN_IN_SUCCESS,
4 | AUTH_SIGN_IN_ERROR,
5 | AUTH_SIGN_OUT,
6 | RESET_AUTH,
7 | } from "./auth.types";
8 |
9 | const initialState = {
10 | loading: false,
11 | data: {
12 | token: "",
13 | isAuth: false,
14 | },
15 | error: false,
16 | };
17 |
18 | export const authReducer = (state = initialState, { type, payload }) => {
19 | switch (type) {
20 | case AUTH_SIGN_IN_LOADING: {
21 | return {
22 | ...state,
23 | loading: true,
24 | };
25 | }
26 | case AUTH_SIGN_IN_SUCCESS: {
27 | return {
28 | ...state,
29 | loading: false,
30 | data: {
31 | token: payload.token,
32 | isAuth: true,
33 | },
34 | };
35 | }
36 | case AUTH_SIGN_IN_ERROR: {
37 | return {
38 | ...state,
39 | loading: false,
40 | error: true,
41 | };
42 | }
43 | case AUTH_SIGN_OUT: {
44 | return {
45 | ...state,
46 | data: {
47 | token: "",
48 | isAuth: false,
49 | },
50 | };
51 | }
52 | case RESET_AUTH: {
53 | return {
54 | state: initialState,
55 | };
56 | }
57 |
58 | default:
59 | return state;
60 | }
61 | };
62 |
--------------------------------------------------------------------------------
/project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "project",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@chakra-ui/icons": "^2.0.13",
7 | "@chakra-ui/react": "^2.4.3",
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.1",
14 | "framer-motion": "^7.7.2",
15 | "react": "^18.2.0",
16 | "react-dom": "^18.2.0",
17 | "react-icons": "^4.7.1",
18 | "react-redux": "^8.0.5",
19 | "react-router-dom": "^6.4.5",
20 | "react-scripts": "5.0.1",
21 | "react-slick": "^0.29.0",
22 | "redux": "^4.2.0",
23 | "redux-thunk": "^2.4.2",
24 | "swiper": "^8.4.5",
25 | "web-vitals": "^2.1.4"
26 | },
27 | "scripts": {
28 | "start": "react-scripts start",
29 | "build": "react-scripts build",
30 | "test": "react-scripts test",
31 | "eject": "react-scripts eject"
32 | },
33 | "eslintConfig": {
34 | "extends": [
35 | "react-app",
36 | "react-app/jest"
37 | ]
38 | },
39 | "browserslist": {
40 | "production": [
41 | ">0.2%",
42 | "not dead",
43 | "not op_mini all"
44 | ],
45 | "development": [
46 | "last 1 chrome version",
47 | "last 1 firefox version",
48 | "last 1 safari version"
49 | ]
50 | },
51 | "homepage": "."
52 | }
53 |
--------------------------------------------------------------------------------
/project/src/pages/AllRoutes.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Routes, Route } from "react-router-dom";
3 | import Home from "./Home";
4 | import Social from "./Social";
5 | import ProductDetails from "../components/ProductDetails";
6 | import Products from "../components/Products";
7 | import ProductList from "../components/ProductList";
8 | import Payment from "./../components/Payment/Payment";
9 | import Delivery from "./../components/Delivery/Delivery";
10 | import Confirm from "./../components/Confirm/Confirm";
11 | import Wishlist from "../components/Wishlist";
12 |
13 | const AllRoutes = () => {
14 | return (
15 |
16 |
17 | } />
18 | } />
19 | } />
20 | } />
21 | } />
22 | } />
23 | } />
24 | } />
25 | } />
26 | } />
27 | } />
28 | } />
29 |
30 |
31 | );
32 | };
33 |
34 | export default AllRoutes;
35 |
--------------------------------------------------------------------------------
/project/src/components/Delivery/Header.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import Logo from "./Logo.png";
4 |
5 | import { Grid, GridItem } from "@chakra-ui/react";
6 |
7 | const Header = () => {
8 | return (
9 |
10 |
20 |
21 |
36 |
37 | SHOPPING BAG
38 |
39 |
40 | SIGN IN
41 |
42 |
49 | DELIVERY
50 |
51 |
52 | PAYMENT
53 |
54 |
55 | CONFIRM
56 |
57 |
58 |
59 | );
60 | };
61 |
62 | export default Header;
63 |
--------------------------------------------------------------------------------
/project/src/components/Confirm/Header.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import Logo from "./Logo.png";
4 |
5 | import { Grid, GridItem } from "@chakra-ui/react";
6 |
7 | const Header = () => {
8 | return (
9 |
10 |
20 |
21 |
36 |
37 | SHOPPING BAG
38 |
39 |
40 | SIGN IN
41 |
42 |
43 | DELIVERY
44 |
45 |
46 | PAYMENT
47 |
48 |
49 |
56 | CONFIRM
57 |
58 |
59 |
60 |
61 | );
62 | };
63 |
64 | export default Header;
65 |
--------------------------------------------------------------------------------
/project/src/components/Payment/Header.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import Logo from "./Logo.png";
4 |
5 | import { Grid, GridItem } from "@chakra-ui/react";
6 |
7 | const Header = () => {
8 | return (
9 |
10 |
20 |
21 |
36 |
37 | SHOPPING BAG
38 |
39 |
40 | SIGN IN
41 |
42 |
43 | DELIVERY
44 |
45 |
46 |
53 | PAYMENT
54 |
55 |
56 |
57 | CONFIRM
58 |
59 |
60 |
61 | );
62 | };
63 |
64 | export default Header;
65 |
--------------------------------------------------------------------------------
/project/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/project/src/components/sidebar/Header.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Text, Flex, Select } from "@chakra-ui/react";
2 | import { useEffect } from "react";
3 | import { FaListUl } from "react-icons/fa";
4 | import Pagination from "../Pagination";
5 | import "../Products.css";
6 |
7 | const Header = ({
8 | showSidebarButton = true,
9 | onShowSidebar,
10 | count,
11 | page,
12 | updateCurrentPage,
13 | sortorder,
14 | category,
15 | }) => {
16 |
17 |
18 |
19 | const handlechange = (e) => {
20 | sortorder(e.target.value);
21 |
22 | };
23 |
24 | // useEffect(()=>{
25 |
26 | // },[count,category,sortorder,page])
27 |
28 | return (
29 |
30 |
31 | {showSidebarButton && (
32 |
33 | Filter
34 |
35 |
36 |
37 |
38 | )}
39 |
40 |
41 |
42 |
43 | {category === "Mens" ? 108 : category === "Womens" ? 102 : 98}{" "}
44 | Products
45 |
46 |
47 |
55 | Sort by price
56 | Price low-to-high
57 | Price high-to-low
58 |
59 |
60 | {!showSidebarButton && (
61 |
66 | )}
67 |
68 |
69 |
70 |
71 | );
72 | };
73 |
74 | export default Header;
75 |
--------------------------------------------------------------------------------
/project/src/redux/products/Prodaction.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable array-callback-return */
2 | import axios from "axios";
3 | import { GET_PRODUCT, Loading, Filter } from "./ProdactionTypes";
4 |
5 | export const getdata = (cat = "Mens",page = 1, sort , order, val) => async (dispatch) => {
6 | dispatch({ type: Loading });
7 |
8 | try {
9 |
10 | if(cat!=="" && page!=="" && sort!=="" && order!=="" && val!==""){
11 |
12 | let res = await axios.get(
13 | `https://nyresa-project-server.onrender.com/${cat}?_page=${page}&_limit=30&_sort=${sort}&_order=${order}`
14 | );
15 |
16 | let filtered = res.data.filter((el) => {
17 | if (el.subtitle !== null && el.subtitle.includes(val)) {
18 | return el;
19 | }
20 | });
21 |
22 |
23 | dispatch({ type: GET_PRODUCT, payload: filtered });
24 |
25 | }
26 |
27 | else if(cat!=="" && page!=="" && sort!=="" && order!==""){
28 |
29 | let res = await axios.get(
30 | `https://nyresa-project-server.onrender.com/${cat}?_page=${page}&_limit=12&_sort=${sort}&_order=${order}`
31 | );
32 |
33 | dispatch({ type: GET_PRODUCT, payload: res.data });
34 |
35 | }
36 |
37 | else if(cat!=="" && page!=="" && val!==""){
38 |
39 | let res = await axios.get(
40 | `https://nyresa-project-server.onrender.com/${cat}?_page=${page}&_limit=30`
41 | );
42 |
43 | let filtered = res.data.filter((el) => {
44 | if (el.subtitle !== null && el.subtitle.includes(val)) {
45 | return el;
46 | }
47 | });
48 |
49 |
50 | dispatch({ type: GET_PRODUCT, payload: filtered });
51 |
52 | }
53 |
54 | else {
55 |
56 | let res = await axios.get(
57 | `https://nyresa-project-server.onrender.com/${cat}?_page=${page}&_limit=12`
58 | );
59 |
60 | dispatch({ type: GET_PRODUCT, payload: res.data });
61 | }
62 |
63 |
64 |
65 | } catch (e) {
66 | console.log(e);
67 | }
68 | };
69 |
70 |
71 |
72 |
73 | // export const filterdata =
74 | // (val, page, sort = "discounted_price", order = "", cat = "Mens") =>
75 | // async (dispatch) => {
76 | // dispatch({ type: Loading });
77 |
78 | // let res = await axios.get(
79 | // `https://nyresa-database.vercel.app/${cat}?_page=${page}&_limit=30&_sort=${sort}&_order=${order}`
80 | // );
81 |
82 | // let filtered = res.data.filter((el) => {
83 | // if (el.subtitle !== null && el.subtitle.includes(val)) {
84 | // return el;
85 | // }
86 | // });
87 |
88 | // dispatch({ type: Filter, payload: filtered });
89 | // };
90 |
--------------------------------------------------------------------------------
/project/src/components/Confirm/Product.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { SimpleGrid, Box, Grid, GridItem, Image } from "@chakra-ui/react";
4 |
5 | const Product = ({ title, desc, price, quantity, subTotal, size, image }) => {
6 | return (
7 |
8 |
16 |
21 |
33 |
34 |
35 |
36 |
37 |
38 | {title}
39 |
40 | {desc}
41 |
42 | Size: {size}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Price
52 |
53 |
54 | Quantity
55 |
56 |
57 | Subtotal
58 |
59 |
60 |
61 |
62 | ${price}
63 |
64 |
65 | {quantity}
66 |
67 |
68 | ${subTotal}
69 |
70 |
71 |
72 |
73 |
74 |
75 | );
76 | };
77 |
78 | export default Product;
79 |
--------------------------------------------------------------------------------
/project/src/components/Confirm/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { SimpleGrid, Box } from "@chakra-ui/react";
4 | import { MdCall } from "react-icons/md";
5 | import { GrMail } from "react-icons/gr";
6 |
7 | const Footer = () => {
8 | return (
9 |
16 |
23 |
24 |
25 |
26 |
27 |
28 | CALL US
29 |
30 |
31 | +49 89 127695-101
32 |
33 |
34 | Argentina: 0800-666-0663
35 |
36 |
37 | Chile: 800-914-515
38 |
39 |
40 | Colombia: 01800-518-5268
41 |
42 |
43 | Mexico: 01-800-099-0703
44 |
45 |
46 | Peru: 0800-78259
47 |
48 |
49 | Puerto Rico: 1-787-303-4205
50 |
51 |
52 | Available 24/7
53 |
54 |
55 |
56 |
57 |
64 |
65 |
66 |
67 |
68 |
69 | MAIL US
70 |
71 |
72 | customercare@mytheresa.com
73 |
74 |
75 | Please note that due to a high amount of requests, we might take a
76 | few days to get back to you. We apologize for any inconvenience this
77 | may cause.
78 |
79 |
80 |
81 |
82 | );
83 | };
84 |
85 | export default Footer;
86 |
--------------------------------------------------------------------------------
/project/src/components/Delivery/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { SimpleGrid, Box } from "@chakra-ui/react";
4 | import { MdCall } from "react-icons/md";
5 | import { GrMail } from "react-icons/gr";
6 |
7 | const Footer = () => {
8 | return (
9 |
16 |
23 |
24 |
25 |
26 |
27 |
28 | CALL US
29 |
30 |
31 | +49 89 127695-101
32 |
33 |
34 | Argentina: 0800-666-0663
35 |
36 |
37 | Chile: 800-914-515
38 |
39 |
40 | Colombia: 01800-518-5268
41 |
42 |
43 | Mexico: 01-800-099-0703
44 |
45 |
46 | Peru: 0800-78259
47 |
48 |
49 | Puerto Rico: 1-787-303-4205
50 |
51 |
52 | Available 24/7
53 |
54 |
55 |
56 |
57 |
64 |
65 |
66 |
67 |
68 |
69 | MAIL US
70 |
71 |
72 | customercare@mytheresa.com
73 |
74 |
75 | Please note that due to a high amount of requests, we might take a
76 | few days to get back to you. We apologize for any inconvenience this
77 | may cause.
78 |
79 |
80 |
81 |
82 | );
83 | };
84 |
85 | export default Footer;
86 |
--------------------------------------------------------------------------------
/project/src/components/Payment/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { SimpleGrid, Box } from "@chakra-ui/react";
4 | import { MdCall } from "react-icons/md";
5 | import { GrMail } from "react-icons/gr";
6 |
7 | const Footer = () => {
8 | return (
9 |
16 |
23 |
24 |
25 |
26 |
27 |
28 | CALL US
29 |
30 |
31 | +49 89 127695-101
32 |
33 |
34 | Argentina: 0800-666-0663
35 |
36 |
37 | Chile: 800-914-515
38 |
39 |
40 | Colombia: 01800-518-5268
41 |
42 |
43 | Mexico: 01-800-099-0703
44 |
45 |
46 | Peru: 0800-78259
47 |
48 |
49 | Puerto Rico: 1-787-303-4205
50 |
51 |
52 | Available 24/7
53 |
54 |
55 |
56 |
57 |
64 |
65 |
66 |
67 |
68 |
69 | MAIL US
70 |
71 |
72 | customercare@mytheresa.com
73 |
74 |
75 | Please note that due to a high amount of requests, we might take a
76 | few days to get back to you. We apologize for any inconvenience this
77 | may cause.
78 |
79 |
80 |
81 |
82 | );
83 | };
84 |
85 | export default Footer;
86 |
--------------------------------------------------------------------------------
/project/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/project/src/components/Wishlist.jsx:
--------------------------------------------------------------------------------
1 | import { Box, Button, Grid, Image, Text, useToast } from "@chakra-ui/react";
2 | import axios from "axios";
3 | import "./Products.css";
4 | import { CloseIcon, StarIcon } from "@chakra-ui/icons";
5 | import React from "react";
6 | import { Link, useNavigate } from "react-router-dom";
7 | import { useState } from "react";
8 | import { useEffect } from "react";
9 |
10 | const getwish = async () => {
11 | let res = await axios.get("https://nyresa-project-server.onrender.com/wishlist");
12 | return res.data;
13 | };
14 |
15 | const Wishlist = () => {
16 | const [wish, setwish] = useState([]);
17 | const toast = useToast();
18 | const navigate=useNavigate()
19 |
20 | const remove = async (id) => {
21 | // eslint-disable-next-line no-unused-vars
22 | let res = await axios.delete(
23 | `https://nyresa-project-server.onrender.com/wishlist/${id}`
24 | );
25 |
26 | let updt = wish.filter((el) => el.id !== id);
27 |
28 | setwish(updt);
29 | };
30 |
31 | const movecart =(el) => {
32 | fetch("https://nyresa-project-server.onrender.com/productlist", {
33 | method: "POST",
34 | headers: {
35 | "Content-Type": "application/json",
36 | },
37 | body: JSON.stringify(el),
38 | }).then((res) => res.json());
39 | navigate("/ProductList");
40 | remove(el.id)
41 | }
42 | useEffect(() => {
43 | getwish().then((res) => setwish(res));
44 | }, []);
45 |
46 | return (
47 |
48 | {wish.length === 0 && (
49 |
50 | THERE ARE NO PRODUCTS ON YOUR WISHLIST.
51 |
52 | Check out our new arrivals and start adding to your wishlist now!
53 |
54 |
55 | {" "}
56 | SHOP NEW ARRIVALS
57 |
58 |
59 | )}
60 |
61 |
70 | {wish.map((el) => (
71 |
72 |
73 | {" "}
74 | remove(el.id)} />
75 |
76 |
77 |
84 | {el.title}
85 |
86 | {el.subtitle}
87 |
88 |
89 | {Array(5)
90 | .fill("")
91 | .map((_, i) => (
92 |
98 | ))}
99 |
100 | {el.rating}
101 |
102 |
103 |
104 |
105 | €{el.discounted_price}
106 |
107 | €{el.strike_price}
108 |
109 | {el.discount}
110 |
111 |
112 | movecart(el)}
120 | >
121 | MOVE TO BAG
122 |
123 |
124 | ))}
125 |
126 |
127 | );
128 | };
129 |
130 | export default Wishlist;
131 |
--------------------------------------------------------------------------------
/project/src/components/Footer.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | chakra,
4 | Container,
5 | SimpleGrid,
6 | Stack,
7 | Text,
8 | VisuallyHidden,
9 | Input,
10 | IconButton,
11 | useColorModeValue,
12 | Image,
13 | } from "@chakra-ui/react";
14 | import { FaInstagram, FaTwitter, FaYoutube } from "react-icons/fa";
15 | import { BiMailSend } from "react-icons/bi";
16 | import { Link } from "react-router-dom";
17 |
18 | const SocialButton = ({ children, label, href }) => {
19 | return (
20 |
36 | {label}
37 | {children}
38 |
39 | );
40 | };
41 |
42 | const ListHeader = ({ children }) => {
43 | return (
44 |
45 | {children}
46 |
47 | );
48 | };
49 |
50 | export default function LargeWithNewsletter() {
51 | return (
52 |
59 |
60 |
64 |
65 |
66 |
67 |
71 |
72 |
73 | © 2022 NYRESA.com. All rights reserved
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | Company
88 | About us
89 | Blog
90 | Contact us
91 | Pricing
92 | Testimonials
93 |
94 |
95 | Support
96 | Help Center
97 | Terms of Service
98 | Legal
99 | Privacy Policy
100 | Status
101 |
102 |
103 | Stay up to date
104 |
105 |
113 | }
121 | />
122 |
123 |
124 |
125 |
126 |
127 | );
128 | }
129 |
--------------------------------------------------------------------------------
/project/src/components/ListChild.jsx:
--------------------------------------------------------------------------------
1 | import { SimpleGrid, Box, Grid, GridItem, Image } from "@chakra-ui/react";
2 | import React, { useState } from "react";
3 |
4 | const ListChild = ({
5 | title,
6 | desc,
7 | id,
8 | price,
9 | image,
10 | quant,
11 | getData,
12 | setProduct,
13 | size
14 | }) => {
15 | // eslint-disable-next-line no-unused-vars
16 | const [quantity, setQuantity] = useState(1);
17 |
18 | const handleInc = (id) => {
19 | console.log(id);
20 |
21 | setQuantity((prev) => prev + 1);
22 | fetch(`https://nyresa-project-server.onrender.com/productlist/${id}`, {
23 | method: "PATCH",
24 | headers: {
25 | "Content-Type": "application/json",
26 | },
27 | body: JSON.stringify({
28 | quantity: quant + 1,
29 | price: (quant + 1) * Number(price),
30 | }),
31 | }).then((res) => res.json()).then(()=>getData().then((res)=>setProduct(res)))
32 | };
33 |
34 | const handleDec = (id) => {
35 | console.log(id);
36 |
37 | fetch(`https://nyresa-project-server.onrender.com/productlist/${id}`, {
38 | method: "PATCH",
39 | headers: {
40 | "Content-Type": "application/json",
41 | },
42 | body: JSON.stringify({
43 | quantity: quant - 1,
44 | price: (quant - 1) * Number(price),
45 | }),
46 | }).then((res) => res.json()).then(()=>getData().then((res)=>setProduct(res)))
47 | };
48 |
49 | return (
50 |
51 |
59 |
64 |
76 |
77 |
78 |
79 |
80 |
81 | {title}
82 |
83 | {desc}
84 |
85 | Size: {size}
86 |
87 |
88 | item no.: {id} {" "}
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | Price
98 |
99 |
100 | Quantity
101 |
102 |
103 | Subtotal
104 |
105 |
106 |
107 |
108 | ${price}
109 |
110 | handleDec(id)}
114 | >
115 | -
116 |
117 |
118 | {quant}
119 |
120 | handleInc(id)}
123 | >
124 | +
125 |
126 |
127 | {quant * Number(price)}
128 |
129 |
130 |
131 |
132 |
133 |
134 | );
135 | };
136 |
137 | export default ListChild;
138 |
--------------------------------------------------------------------------------
/project/src/components/Carousel.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import {
3 | Box,
4 | IconButton,
5 | Heading,
6 | Button,
7 | Image,
8 | Text,
9 | Flex,
10 | } from "@chakra-ui/react";
11 | import { ChevronLeftIcon, ChevronRightIcon } from "@chakra-ui/icons";
12 | import Slider from "react-slick";
13 | import { Link } from "react-router-dom";
14 |
15 | const settings = {
16 | dots: false,
17 | arrows: false,
18 |
19 | infinite: true,
20 | autoplay: false,
21 | speed: 1000,
22 | slidesToShow: 4,
23 | slidesToScroll: 4,
24 | responsive: [
25 | {
26 | breakpoint: 1200,
27 | settings: {
28 | slidesToShow: 3,
29 | slidesToScroll: 1,
30 | },
31 | },
32 | {
33 | breakpoint: 1008,
34 | settings: {
35 | slidesToShow: 3,
36 | slidesToScroll: 1,
37 | },
38 | },
39 | {
40 | breakpoint: 800,
41 | settings: {
42 | slidesToShow: 2,
43 | slidesToScroll: 1,
44 | },
45 | },
46 | {
47 | breakpoint: 500,
48 | settings: {
49 | slidesToShow: 1,
50 | slidesToScroll: 1,
51 | },
52 | },
53 | ],
54 | };
55 |
56 | export default function Carousel({ data, title, link }) {
57 | const [slider, setSlider] = useState(null);
58 |
59 | return (
60 |
64 |
70 |
75 |
81 | {title}
82 |
83 |
84 |
93 |
98 | slider?.slickPrev()}
105 | _hover={{ bg: "none" }}
106 | >
107 | slider?.slickPrev()}
116 | />
117 |
118 |
119 |
128 | setSlider(slider)}>
129 | {data.map((ele) => (
130 |
131 |
132 |
133 |
134 |
135 | {ele.title}
136 |
137 | {ele.subtitle}
138 |
139 | $ {ele.discounted_price}
140 |
141 |
142 |
143 |
144 | ))}
145 |
146 |
147 |
152 | slider?.slickNext()}
159 | >
160 |
170 |
171 |
172 |
173 |
181 |
182 |
194 | VIEW ALL
195 |
196 |
197 |
198 |
199 | );
200 | }
201 |
--------------------------------------------------------------------------------
/project/src/components/Delivery/Address.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Grid,
4 | GridItem,
5 | Box,
6 | SimpleGrid,
7 | Radio,
8 | RadioGroup,
9 | Stack,
10 | Input,
11 | Select,
12 | Button,
13 | } from "@chakra-ui/react";
14 |
15 | const Address = () => {
16 | const [bvalue, setbValue] = React.useState("");
17 | const [bfirstName, setbFirstName] = React.useState("");
18 | const [blastName, setbLastName] = React.useState("");
19 | const [bcompany, setbCompany] = React.useState("");
20 | const [bemail, setbEmail] = React.useState("");
21 | const [bstreet, setbStreet] = React.useState("");
22 | const [blineTwo, setbLineTwo] = React.useState("");
23 | const [bpost, setbPost] = React.useState("");
24 | const [bcity, setbCity] = React.useState("");
25 | const [bcountry, setbCountry] = React.useState("");
26 | const [bphone, setbPhone] = React.useState("");
27 | return (
28 |
29 |
30 |
35 |
36 |
37 | BILLING ADDRESS
38 |
39 |
40 | Please enter your billing address in the form below.
41 |
42 |
43 | setbValue(bvalue)}
47 | >
48 |
49 |
50 | Ms.*
51 |
52 |
53 | Mrs.*
54 |
55 |
56 | Mr.*
57 |
58 |
59 |
60 |
61 |
62 |
151 |
152 |
153 |
154 |
155 |
156 | );
157 | };
158 |
159 | export default Address;
160 |
--------------------------------------------------------------------------------
/project/src/components/Products.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "./Products.css";
3 | import { useState } from "react";
4 | import {
5 | Box,
6 | Divider,
7 | Grid,
8 | Heading,
9 | Image,
10 | Progress,
11 | Text,
12 | useBreakpointValue,
13 | } from "@chakra-ui/react";
14 |
15 | import Header from "../components/sidebar/Header";
16 | import Sidebar from "../components/sidebar/Sidebar";
17 | import { useSelector, useDispatch } from "react-redux";
18 | import { useEffect } from "react";
19 | import { getdata } from "../redux/products/Prodaction";
20 | import { StarIcon } from "@chakra-ui/icons";
21 | import Pagination from "./Pagination";
22 | import { useNavigate } from "react-router-dom";
23 | import Footer from "./Footer";
24 |
25 | const smVariant = { navigation: "drawer", navigationButton: true };
26 | const mdVariant = { navigation: "sidebar", navigationButton: false };
27 |
28 | const Products = ({ category }) => {
29 |
30 | const [c,setc]=useState(category);
31 | const [page, setpage] = useState(1);
32 | const [sort, setsort] = useState("");
33 | const [order, setorder] = useState("");
34 | const [filtval, setfiltval] = useState("");
35 |
36 |
37 | const navigate = useNavigate();
38 |
39 | const [isSidebarOpen, setSidebarOpen] = useState(false);
40 | const variants = useBreakpointValue({ base: smVariant, md: mdVariant });
41 |
42 | const toggleSidebar = () => setSidebarOpen(!isSidebarOpen);
43 |
44 | const products = useSelector((store) => store.prodManager);
45 |
46 | const dispatch = useDispatch();
47 |
48 |
49 |
50 |
51 |
52 | useEffect(() => {
53 |
54 | if(c!==category){
55 | setpage(1);
56 | setfiltval("");
57 | setc(category);
58 | }
59 |
60 | dispatch(getdata(category, page, sort, order, filtval));
61 |
62 |
63 | // eslint-disable-next-line react-hooks/exhaustive-deps
64 | }, [category, page, sort, order, filtval]);
65 |
66 |
67 | const filterbyval=(filt)=>{
68 | setfiltval(filt)
69 | }
70 |
71 | const sortorder = (val) => {
72 | setsort("discounted_price");
73 | setorder(val);
74 | };
75 |
76 |
77 | const updateCurrentPage=(pan)=>{
78 | setpage(pan);
79 | }
80 | const tolocal = (el) => {
81 | localStorage.setItem("element", JSON.stringify(el));
82 | navigate("/ProductDetails");
83 | };
84 |
85 | return (
86 | <>
87 |
93 |
106 |
107 |
116 |
117 |
118 |
119 | {products.loading && (
120 |
121 | Loading ....
122 |
123 |
124 | )}
125 |
126 | {products.data.length === 0 && (
127 |
128 |
133 | Results not found for this page
134 |
135 | )}
136 |
137 |
146 | {products.data?.map((el) => (
147 | tolocal(el)}
151 | textAlign="center"
152 | >
153 |
160 | {el.title}
161 | {el.subtitle}
162 |
163 | {Array(5)
164 | .fill("")
165 | .map((_, i) => (
166 |
172 | ))}
173 |
174 | {el.rating}
175 |
176 |
177 |
178 |
179 | €{el.discounted_price}
180 |
181 | €{el.strike_price}
182 |
183 | {el.discount}
184 |
185 |
186 | ))}
187 |
188 |
189 |
190 |
195 |
200 |
201 |
202 |
203 |
204 |
205 | >
206 | );
207 | };
208 |
209 | export default Products;
210 |
--------------------------------------------------------------------------------
/project/src/components/ProductList.jsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable array-callback-return */
2 | /* eslint-disable no-unused-vars */
3 | import {
4 | Box,
5 | Button,
6 | Center,
7 | Grid,
8 | Popover,
9 | PopoverContent,
10 | PopoverTrigger,
11 | Text,
12 | } from "@chakra-ui/react";
13 | import React, { useEffect, useState } from "react";
14 | import { Link, useNavigate } from "react-router-dom";
15 | import ListChild from "./ListChild";
16 | import Footer from "./Footer";
17 |
18 | const getData = async() => {
19 | return await fetch(`https://nyresa-project-server.onrender.com/productlist`).then((res) =>
20 | res.json()
21 | );
22 | };
23 |
24 | const ProductList = () => {
25 | const navigate = useNavigate();
26 | const [loading, setLoading] = useState(false);
27 | const [error, setError] = useState(false);
28 | const [product, setProduct] = useState([]);
29 | const [flag, setFlag] = useState(false);
30 | let total = 0;
31 |
32 | useEffect(() => {
33 | setLoading(true);
34 | getData()
35 | .then((res) => {
36 | setLoading(false);
37 | setError(false);
38 | setProduct(res);
39 | })
40 | .catch((err) => {
41 | setLoading(false);
42 | setError(true);
43 | });
44 | },[getData]);
45 | useEffect(()=>{
46 | getData().then((res) => {
47 | setLoading(false);
48 | setError(false);
49 | setProduct(res);
50 | })
51 | .catch((err) => {
52 | setLoading(false);
53 | setError(true);
54 | })
55 | },[])
56 | if (loading) {
57 | return LOADING........
;
58 | }
59 | if (error) {
60 | return ERROR
;
61 | }
62 |
63 | const handleDelete = (id) => {
64 | fetch(
65 | `https://nyresa-project-server.onrender.com/productlist/${id}`,
66 | {
67 | method: "DELETE",
68 | headers: {
69 | "Content-Type": "application/jaon",
70 | },
71 | body: JSON.stringify({id}),
72 | }
73 | ).then((res) => res.json()).then(()=>getData()
74 | .then((res) => {
75 | setLoading(false);
76 | setError(false);
77 | setProduct(res);
78 | })
79 | .catch((err) => {
80 | setLoading(false);
81 | setError(true);
82 | }))
83 | };
84 | const handleWishlist = (el) => {
85 | setFlag(true);
86 | fetch("https://nyresa-project-server.onrender.com/wishlist", {
87 | method: "POST",
88 | headers: {
89 | "Content-Type": "application/json",
90 | },
91 | body: JSON.stringify(el),
92 | }).then((res) => res.json());
93 | };
94 | const handleCheckout = () => {
95 | navigate("/delivery");
96 | };
97 | const handleWishlistBag = (el) => {
98 | handleDelete(el.id)
99 | navigate("/wishlist");
100 | };
101 | return (
102 |
103 |
104 |
105 |
106 | YOUR SHOPPING BAG
107 |
114 | PROCEED TO CHECKOUT
115 |
116 |
117 |
118 | {product.map((el) => (
119 |
123 |
136 |
137 |
handleDelete(el.id)}
141 | >
142 | X Remove
143 |
144 |
145 |
146 | handleWishlist(el)}
149 | bgColor={"#c5d5e3"}
150 | >
151 | ADD TO WISHLIST{" "}
152 |
158 |
159 |
160 |
161 |
162 | {flag ? (
163 |
164 | Successfully added in the Wishlist
165 |
166 | {el.title}
167 |
168 | {el.discounted_price}
169 | handleWishlistBag(el)}
176 | >
177 | VIEW WISHLIST BAG
178 |
184 |
185 |
186 |
187 | setFlag(false)}
190 | >
191 | BACK TO SHOP
192 |
193 |
194 | ) : (
195 | ""
196 | )}
197 |
198 |
199 |
200 | ))}
201 | {product.length === 0 && (
202 |
203 | THERE ARE NO PRODUCTS ON YOUR WISHLIST.
204 |
205 | Check out our new arrivals and start adding to your wishlist
206 | now!
207 |
208 |
209 | {" "}
210 | SHOP NEW ARRIVALS
211 |
212 |
213 | )}
214 |
219 | {product.map((el)=>{
220 | console.log(total+=Number(el.price))
221 | })}
222 |
223 | Total:- ${total}
224 |
225 |
226 |
235 | PROCEED TO CHECKOUT
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 | );
244 | };
245 |
246 | export default ProductList;
247 |
--------------------------------------------------------------------------------
/project/src/components/Navbar.jsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 | import {
3 | Box,
4 | Flex,
5 | Text,
6 | Image,
7 | Menu,
8 | MenuButton,
9 | MenuList,
10 | MenuItem,
11 | MenuDivider,
12 | IconButton,
13 | useDisclosure,
14 | useToast,
15 | } from "@chakra-ui/react";
16 | import { Link } from "react-router-dom";
17 | import { AiOutlineHeart } from "react-icons/ai";
18 | import { HamburgerIcon, CloseIcon } from "@chakra-ui/icons";
19 |
20 | import "./Navbar.css";
21 |
22 | import { useDispatch, useSelector } from "react-redux";
23 | import { logout } from "../redux/auth/auth.actions";
24 | import axios from "axios";
25 |
26 | export default function Navbar() {
27 | const { isAuth } = useSelector((store) => store.authManager.data);
28 | const dispatch = useDispatch();
29 | const toast = useToast();
30 |
31 | const { isOpen, onOpen, onClose } = useDisclosure();
32 | let [mytext, setMytext] = useState(true);
33 | let [cart, setCart] = useState([]);
34 |
35 | let mn = setInterval(() => {
36 | setMytext(!mytext);
37 |
38 | clearInterval(mn);
39 | }, 5000);
40 | const handleLogout = () => {
41 | if (isAuth) {
42 | dispatch(logout());
43 | toast({
44 | title: "Logout Successful!",
45 | status: "success",
46 | duration: 2000,
47 | isClosable: true,
48 | position: "top",
49 | });
50 | }
51 | };
52 |
53 | let abc = () => (
54 |
55 | {mytext
56 | ? "FREE SHIPPING on orders over $800"
57 | : "FREE RETURNS within 30 days"}
58 |
59 | );
60 |
61 | const getCart = async () => {
62 | axios
63 | .get(`https://nyresa-project-server.onrender.com/productlist`)
64 | .then((res) => setCart(res.data));
65 | };
66 |
67 | useEffect(() => {
68 | abc();
69 | getCart()
70 | // eslint-disable-next-line react-hooks/exhaustive-deps
71 | }, [mytext]);
72 | useEffect(() => {
73 | console.log(getCart());
74 | }, []);
75 |
76 | return (
77 |
78 |
79 |
87 |
93 |
94 |
95 | WOMEN
96 |
97 |
98 |
99 |
100 | MEN
101 |
102 |
103 |
104 |
105 | KIDS
106 |
107 |
108 |
109 |
110 |
115 |
116 | Signup For Newsletter
117 |
118 |
119 | {isAuth ? "Logout" : "My account"}
120 |
121 |
122 |
123 | My wishlist
124 |
125 |
126 |
127 |
128 |
129 | India | English
130 |
131 |
132 |
133 |
134 |
142 |
143 |
153 | ) : (
154 |
155 | )
156 | }
157 | display={{ lg: "none" }}
158 | onClick={isOpen ? onClose : onOpen}
159 | />
160 |
161 |
162 |
163 |
164 | Women
165 |
166 |
167 |
168 |
169 |
170 |
171 | Men
172 |
173 |
174 |
175 |
176 |
177 |
178 | Kids
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | {isAuth ? "Logout" : "My account"}
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 | My Wishlist
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 | {/* ================================================================ */}
204 |
205 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
234 | SHOPPING BAG
235 |
236 |
237 |
244 |
251 |
260 | {cart.length}
261 |
262 |
263 |
264 |
265 |
266 |
267 |
277 | {abc()}
278 |
279 |
280 | );
281 | }
282 |
--------------------------------------------------------------------------------
/project/src/pages/Home.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Box, Flex, Heading, Image, Text } from "@chakra-ui/react";
3 | import { Link } from "react-router-dom";
4 | import Carousel from "../components/Carousel";
5 | import data from "../assets/data/products.json";
6 | import Footer from "../components/Footer";
7 |
8 | const Home = () => {
9 | console.log(data);
10 | return (
11 |
12 |
21 |
22 |
30 |
39 |
40 |
41 |
47 | Women
48 |
49 |
50 |
51 |
52 |
53 |
59 | Men
60 |
61 |
62 |
63 |
64 |
65 |
71 |
72 |
73 |
81 |
88 |
94 | Kids
95 |
96 |
97 |
103 |
104 |
105 |
106 |
114 |
121 |
127 | Life
128 |
129 |
130 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
151 |
152 |
153 |
154 |
155 |
160 |
161 |
162 |
163 |
164 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
181 |
182 |
183 |
184 | {" "}
187 |
188 |
195 | MYTHERESA – LUXURY FASHION AND DESIGNER SHOPPING
196 |
197 |
207 |
212 | Mytheresa is an online shopping destination for children's, men's,
213 | and women’s luxury fashion and lifestyle design. Our edit makes it
214 | possible for you to choose from the finest selection of the world’s
215 | most sought-after designer brands such as Bottega Veneta, Givenchy,
216 | and Burberry. We pride ourselves on creating an easy-to-navigate
217 | online shopping platform while maintaining an elevated boutique-like
218 | feel.
219 |
220 |
221 | Our expert team of buyers scour the globe each season to bring you
222 | the most exquisite selection of fashion straight from the runways of
223 | New York, London, Paris and Milan. With our daily New Arrivals, we
224 | make it effortless for you to have the most coveted items first.
225 | Whether you’re looking to invest in timeless pieces from Gucci,
226 | Balenciaga, Christian Louboutin and Saint Laurent, or you want to
227 | set trends in Off-White, Acne Studios and Alanui, Mytheresa is the
228 | go-to fashion and designer website that can fulfill all your
229 | sartorial wishes. In our Life store, you'll find a range of
230 | established and emerging designers in home, lifestyle, and more,
231 | like Tom Dixon, Vitra and La DoubleJ. Our unique assortment of
232 | menswear, womenswear, kidswear and lifestyle design now makes it
233 | possible to shop for your loved ones – even your pets – all in one
234 | place.
235 |
236 |
237 | Mytheresa has a long and rich fashion heritage that spans more than
238 | 30 years. What began in the heart of Munich as a contained local
239 | boutique offering creations from international designers has now
240 | grown to become one of the most innovative luxury e-commerce
241 | companies in the world. Whether you’re paying a visit to our
242 | Mytheresa Store, browsing from your computer at home, or shopping
243 | on-the-go via our mobile app, our goal always remains the same: to
244 | provide the perfect space that caters to all your shopping desires.
245 |
246 |
251 |
252 | Mytheresa Women
253 |
254 | |
255 |
256 | Mytheresa Men
257 |
258 | |
259 |
260 | Mytheresa Kids
261 |
262 | |
263 |
264 | Mytheresa Life
265 |
266 |
267 |
268 |
271 |
272 |
273 |
274 |
275 |
276 | );
277 | };
278 |
279 | export default Home;
280 |
--------------------------------------------------------------------------------
/project/src/components/ProductDetails.jsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable react-hooks/exhaustive-deps */
2 | import {
3 | Box,
4 | Button,
5 | Center,
6 | Flex,
7 | Image,
8 | Popover,
9 | PopoverContent,
10 | PopoverTrigger,
11 | Select,
12 | Text,
13 | } from "@chakra-ui/react";
14 | import React, { useEffect, useState } from "react";
15 | import "../components_css/ProductDetails.css";
16 |
17 | import "swiper/css";
18 | import SizeChart from "../image/SizeChart.jpeg";
19 | import { useNavigate } from "react-router-dom";
20 | import Footer from "./Footer";
21 | import Carousel from "./Carousel";
22 | import data from "../assets/data/products.json";
23 | let count = 0;
24 | const ProductDetails = () => {
25 | const navigate = useNavigate();
26 | const [flag, setFlag] = useState(false);
27 |
28 | let element = JSON.parse(localStorage.getItem("element"));
29 | useEffect(() => {
30 | element = JSON.parse(localStorage.getItem("element")) || {};
31 | }, [element]);
32 | const handleAddtobag = (e) => {
33 | count++; //1
34 |
35 | if (count >= 2) {
36 | setFlag(true);
37 | } else if (count <= 1) {
38 | handlechangesize(e);
39 | }
40 | };
41 |
42 | const handlewishlist = (e) => {
43 | count++;
44 |
45 | if (count > 1) {
46 | setFlag(true);
47 |
48 | count++;
49 | } else if (count <= 1) {
50 | handlechangesize(e);
51 | }
52 | };
53 |
54 | const handleShopingBag =(el) => {
55 | fetch("https://nyresa-project-server.onrender.com/productlist", {
56 | method: "POST",
57 | headers: {
58 | "Content-Type": "application/json",
59 | },
60 | body: JSON.stringify(el),
61 | }).then((res) => res.json());
62 | navigate("/ProductList");
63 | };
64 | const handleWishlistBag = (el) => {
65 | fetch("https://nyresa-project-server.onrender.com/wishlist", {
66 | method: "POST",
67 | headers: {
68 | "Content-Type": "application/json",
69 | },
70 | body: JSON.stringify(el),
71 | }).then((res) => res.json());
72 | navigate("/wishlist");
73 | };
74 | const handlechangesize = (e) => {
75 | let value = e.target.value;
76 | localStorage.setItem("ElementSize", JSON.stringify(value));
77 | if (!value) {
78 | alert("please Select size");
79 | } else if (value) {
80 | count++;
81 | }
82 | };
83 |
84 | return (
85 |
86 |
87 |
92 |
93 | {/* {'<'} */}
94 |
103 | {/* {'>'} */}
104 |
105 |
106 |
107 | {element.title}
108 |
109 |
{element.subtitle}
110 |
111 |
112 | $ {element.discounted_price}
113 |
114 |
115 | $ {element.strike_price}
116 |
117 |
118 |
119 | {element.discount}
120 |
121 |
122 | Ratings - {element.rating}*
123 |
124 |
130 | {element.size[0]}
131 | {element.size[1]}
132 | {element.size[2]}
133 | {element.size[3]}
134 | {element.size[4]}
135 | {element.size[5]}
136 |
137 |
138 |
139 | {"> Size Chart"}
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
155 | ADD TO SHOPPING BAG
156 |
157 |
158 | {flag ? (
159 |
160 | Successfully added in the bag
161 |
162 | {element.title}
163 |
164 | {element.discounted_price}
165 | handleShopingBag(element, element.id)}
171 | >
172 | VIEW SHOPPING BAG
173 |
174 | setFlag(false)}>
175 | BACK TO SHOP
176 |
177 |
178 | ) : (
179 | ""
180 | )}
181 |
182 |
183 |
184 |
185 |
191 | ADD TO WISHLIST{" "}
192 |
198 |
199 |
200 |
201 |
202 | {flag ? (
203 |
204 | Successfully added in the Wishlist
205 |
206 | {element.title}
207 |
208 | {element.discounted_price}
209 | handleWishlistBag(element)}
216 | >
217 | VIEW WISHLIST{" "}
218 |
224 |
225 |
226 |
227 | setFlag(false)}>
228 | BACK TO SHOP
229 |
230 |
231 | ) : (
232 | ""
233 | )}
234 |
235 |
Free Shipping avaliable
236 |
237 | Product Material Details
238 | Cotton
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
251 |
256 |
261 |
262 |
263 | );
264 | };
265 |
266 | export default ProductDetails;
267 |
--------------------------------------------------------------------------------
/project/src/components/Payment/Payment.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Header from "./Header";
3 | import jcb from "./jcb.png";
4 | import masterCard from "./masterCard.jpg";
5 | import unionPay from "./unionPay.png";
6 | import visa from "./visa.png";
7 | import americanExpress from "./americanExpress.png";
8 | import dinersClub from "./dinersClub.png";
9 |
10 | import { ImCreditCard } from "react-icons/im";
11 |
12 | import {
13 | Box,
14 | SimpleGrid,
15 | Radio,
16 | RadioGroup,
17 | Stack,
18 | Grid,
19 | GridItem,
20 | Image,
21 | Input,
22 | Button,
23 | } from "@chakra-ui/react";
24 | import Footer from "./Footer";
25 | import { useNavigate } from "react-router-dom";
26 |
27 | const Payment = () => {
28 | const [value, setValue] = React.useState("1");
29 | const [number, setNumber] = React.useState("");
30 | const [name, setName] = React.useState("");
31 | const [date, setDate] = React.useState("");
32 | const [cvv, setCvv] = React.useState("");
33 | const navigate = useNavigate();
34 |
35 | const handleClick = (e) => {
36 | e.preventDefault();
37 | localStorage.setItem("number", JSON.stringify([number]));
38 | if (name === "" || number === "" || date === "" || cvv === "") {
39 | alert("Please fill in required* details");
40 | } else if (number.length !== 12) {
41 | alert("Please enter proper card details");
42 | } else {
43 | navigate("/confirm");
44 | }
45 | };
46 |
47 | console.log(name, date, number, cvv);
48 |
49 | return (
50 |
51 |
52 |
60 |
67 |
68 | PAYMENT METHOD
69 |
70 | Please select your preferred payment method for this order.
71 |
72 |
73 |
74 |
75 |
76 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | Card
92 |
93 |
94 |
95 |
96 |
97 | Immediate Shipping
98 |
99 |
100 |
101 |
102 |
103 |
104 |
109 |
110 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | Name on card *
134 |
135 | setName(e.target.value)}
138 | >
139 |
140 | Credit card number *
141 |
142 | setNumber(e.target.value)}
146 | >
147 |
148 |
149 |
160 |
161 | Expiration date *
162 |
163 |
164 | CVC/CVV *
165 |
166 |
167 |
168 |
169 |
180 |
181 | setDate(e.target.value)}
185 | >
186 |
187 |
188 | setCvv(e.target.value)}
192 | >
193 |
194 |
195 | What is this?
196 |
197 |
198 |
199 | * required fields
200 |
201 |
202 |
203 |
204 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | Paypal
218 |
219 |
220 |
221 |
222 |
223 | Immediate Shipping
224 |
225 |
226 |
227 |
228 |
229 |
230 | navigate("/delivery")}
236 | >
237 | BACK TO DELIVERY
238 |
239 |
240 |
241 |
250 | PROCEED TO CHECKOUT
251 |
252 |
253 |
254 |
255 |
264 | {" "}
265 |
266 | {" "}
267 | Please note: By clicking this button, all data listed on this page
268 | will be erased for security reasons.
269 | {" "}
270 |
271 |
272 | {" "}
273 |
274 | {" "}
275 | You can also place your order via telephone.
276 |
277 |
278 |
279 |
280 |
281 | );
282 | };
283 |
284 | export default Payment;
285 |
--------------------------------------------------------------------------------
/project/src/components/sidebar/Sidebar.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Drawer,
4 | DrawerOverlay,
5 | DrawerCloseButton,
6 | DrawerHeader,
7 | DrawerBody,
8 | DrawerContent,
9 | Text,
10 | Divider,
11 | Flex,
12 | Accordion,
13 | AccordionItem,
14 | AccordionButton,
15 | AccordionIcon,
16 | AccordionPanel,
17 | Checkbox,
18 | RadioGroup,
19 | Stack,
20 | Radio,
21 | } from "@chakra-ui/react";
22 |
23 | import { getdata } from "../../redux/products/Prodaction";
24 |
25 | import { useDispatch } from "react-redux";
26 |
27 | import "../Products.css";
28 | import { useState } from "react";
29 |
30 | const SidebarContent = ({
31 | onClick,
32 | show,
33 | dispatch,
34 | page,
35 | sort,
36 | order,
37 |
38 | category,
39 | filterbyval,
40 | updateCurrentPage,
41 |
42 |
43 | }) => {
44 |
45 |
46 |
47 | let val1 =
48 | category === "Mens"
49 | ? "Joggers"
50 | : category === "Womens"
51 | ? "Kurta"
52 | : "T-shirt";
53 | let val2 =
54 | category === "Mens"
55 | ? "Shirt"
56 | : category === "Womens"
57 | ? "Jeans"
58 | : "Sweatshirt";
59 | let val3 =
60 | category === "Mens"
61 | ? "Jeans"
62 | : category === "Womens"
63 | ? "Trousers"
64 | : "Joggers";
65 |
66 |
67 |
68 |
69 |
70 | return (
71 | <>
72 |
73 |
74 | {show === "sidebar" && (
75 |
76 | NEW ARRIVALS
77 |
78 | Current Week
79 |
80 |
81 | Previous Weeks{" "}
82 |
83 |
84 | Essentials
85 |
86 |
87 | Tailoring Edit{" "}
88 |
89 |
90 | Loungewear{" "}
91 |
92 |
93 | Cold Weather Edit{" "}
94 |
95 |
96 | The Ski Edit{" "}
97 |
98 |
99 | )}
100 |
101 |
102 |
103 |
104 |
105 |
106 | Category
107 |
108 |
109 |
110 |
111 |
112 |
113 | {
115 | filterbyval("");
116 | updateCurrentPage(1)
117 | dispatch(getdata( category ,page,"","",""));
118 |
119 | onClick();
120 | }}
121 | >
122 |
123 | All
124 |
125 |
126 | {
128 |
129 | filterbyval(val1);
130 | updateCurrentPage(1)
131 | dispatch(getdata(category, page, sort, order,val1 ));
132 |
133 | onClick();
134 | }}
135 | >
136 |
137 | {val1}
138 |
139 |
140 | {
142 |
143 | filterbyval(val2);
144 | updateCurrentPage(1)
145 | dispatch(getdata(category, page, sort, order,val2 ));
146 |
147 | onClick();
148 | }}
149 | >
150 |
151 | {val2}
152 |
153 |
154 | {
156 |
157 | filterbyval(val3);
158 | updateCurrentPage(1)
159 | dispatch(getdata(category, page, sort, order,val3 ));
160 |
161 | onClick();
162 | }}
163 | >
164 |
165 | {val3}
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | Designers
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 | Gucci
190 |
191 |
192 |
193 |
194 | Herno
195 |
196 |
197 |
198 |
199 | Kenzo
200 |
201 |
202 |
203 |
204 | Marni
205 |
206 |
207 |
208 |
209 | Tom Ford
210 |
211 |
212 |
213 |
214 | Versace
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 | Colours
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | Black
235 |
236 |
237 |
238 |
239 | Green
240 |
241 |
242 |
243 |
244 | Maroon
245 |
246 |
247 |
248 |
249 | Pink
250 |
251 |
252 |
253 |
254 | Red
255 |
256 |
257 |
258 |
259 | Golden
260 |
261 |
262 |
263 |
264 | White
265 |
266 |
267 |
268 |
269 | Yellow
270 |
271 |
272 |
273 |
274 | Multicoloured
275 |
276 |
277 |
278 |
279 | Orange
280 |
281 |
282 |
283 |
284 | Purple
285 |
286 |
287 |
288 |
289 | Grey
290 |
291 |
292 |
293 |
294 | Indigo
295 |
296 |
297 |
298 |
299 | Blue
300 |
301 |
302 |
303 |
304 | Brown
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 | Pattern
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 | Stripped
325 |
326 |
327 |
328 |
329 | Printed
330 |
331 |
332 |
333 |
334 | Plain
335 |
336 |
337 |
338 |
339 | Patterened
340 |
341 |
342 |
343 |
344 | Embellished
345 |
346 |
347 |
348 |
349 | Checked
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 | >
359 | );
360 | };
361 |
362 | const Sidebar = ({
363 | isOpen,
364 | variant,
365 | onClose,
366 | page,
367 | sort,
368 | order,
369 |
370 | category,
371 | filterbyval,
372 | updateCurrentPage
373 | }) => {
374 |
375 |
376 |
377 | const dispatch = useDispatch();
378 |
379 | return variant === "sidebar" ? (
380 |
381 |
382 | {category === "Mens"
383 | ? "Mens"
384 | : category === "Womens"
385 | ? "Womens"
386 | : "Kids"}
387 | /New Arrivals/Current Week{" "}
388 |
389 |
390 |
391 |
404 |
405 | ) : (
406 |
407 |
408 |
409 |
410 | Filter
411 |
412 |
425 |
426 |
427 |
428 |
429 | );
430 | };
431 |
432 | export default Sidebar;
433 |
--------------------------------------------------------------------------------
/project/src/pages/Social.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import {
3 | Box,
4 | Container,
5 | FormControl,
6 | Input,
7 | Text,
8 | Grid,
9 | GridItem,
10 | Checkbox,
11 | RadioGroup,
12 | HStack,
13 | Radio,
14 | Select,
15 | Link,
16 | useToast,
17 | } from "@chakra-ui/react";
18 | import { useNavigate } from "react-router-dom";
19 | import { useDispatch, useSelector } from "react-redux";
20 | import { addUser } from "../redux/social/social.actions";
21 | import { login } from "../redux/auth/auth.actions";
22 | import Footer from "../components/Footer";
23 |
24 | const initState = {
25 | initials: "",
26 | title: "",
27 | firstname: "",
28 | lastname: "",
29 | email: "",
30 | password: "",
31 | repassword: "",
32 | };
33 |
34 | const Social = () => {
35 | const { error } = useSelector((store) => store.authManager);
36 | const navigate = useNavigate();
37 |
38 | const [registerformData, setRegisterFormData] = useState(initState);
39 | const [registerformErrors, setRegisterFormErrors] = useState({});
40 |
41 | const [loginformData, setLoginFormData] = useState([]);
42 | const [loginformErrors, setLoginFormErrors] = useState({});
43 |
44 | const dispatch = useDispatch();
45 |
46 | const { isAuth } = useSelector((store) => store.authManager.data);
47 | const toast = useToast();
48 |
49 | useEffect(() => {
50 | if (isAuth) {
51 | toast({
52 | title: "Login Successful!",
53 | status: "success",
54 | duration: 2000,
55 | isClosable: true,
56 | position: "top",
57 | });
58 | navigate("/");
59 | } else {
60 | navigate("/login");
61 | }
62 | // eslint-disable-next-line react-hooks/exhaustive-deps
63 | }, [isAuth, navigate]);
64 |
65 | const validateRegister = (values) => {
66 | let errors = {};
67 | const regex = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/i;
68 | if (!values.firstname) {
69 | errors.firstname = "Firstname is required!";
70 | }
71 | if (!values.lastname) {
72 | errors.lastname = "Lastname is required!";
73 | }
74 | if (!values.email) {
75 | errors.email = "Email is required!";
76 | } else if (!regex.test(values.email)) {
77 | errors.email = "This is not a valid email format!";
78 | }
79 | if (!values.password) {
80 | errors.password = "Password is required!";
81 | } else if (values.password.length < 4) {
82 | errors.password = "Password must be more than 4 characters";
83 | } else if (values.password.length > 10) {
84 | errors.password = "Password cannot exceed 10 characters";
85 | }
86 | if (!values.repassword) {
87 | errors.repassword = "Confirm Password is required!";
88 | } else if (values.repassword.length < 4) {
89 | errors.repassword = "Password must be more than 4 characters";
90 | } else if (values.repassword.length > 10) {
91 | errors.repassword = "Password cannot exceed 10 characters";
92 | }
93 | return errors;
94 | };
95 |
96 | const handleRegisterChange = (e) => {
97 | const { value, name } = e.target;
98 | setRegisterFormData({ ...registerformData, [name]: value });
99 | };
100 |
101 | const handleRegisterSubmit = (e) => {
102 | e.preventDefault();
103 | const registerformErrors = validateRegister(registerformData);
104 | setRegisterFormErrors(registerformErrors);
105 |
106 | if (Object.keys(registerformErrors).length === 0) {
107 | dispatch(addUser(registerformData));
108 | toast({
109 | title: "Registration Successful!",
110 | description: "You can Login now.",
111 | status: "success",
112 | duration: 5000,
113 | isClosable: true,
114 | position: "top",
115 | });
116 | }
117 | };
118 |
119 | const validateLogin = (values) => {
120 | let errors = {};
121 | const regex = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/i;
122 | if (!values.email) {
123 | errors.email = "Email is required!";
124 | } else if (!regex.test(values.email)) {
125 | errors.email = "This is not a valid email format!";
126 | }
127 | if (!values.password) {
128 | errors.password = "Password is required!";
129 | } else if (values.password.length < 4) {
130 | errors.password = "Password must be more than 4 characters";
131 | } else if (values.password.length > 10) {
132 | errors.password = "Password cannot exceed 10 characters";
133 | }
134 | return errors;
135 | };
136 |
137 | const handleLoginChange = (e) => {
138 | const { value, name } = e.target;
139 | setLoginFormData({ ...loginformData, [name]: value });
140 | };
141 |
142 | const handleLoginSubmit = (e) => {
143 | e.preventDefault();
144 | const loginformErrors = validateLogin(loginformData);
145 | setLoginFormErrors(loginformErrors);
146 |
147 | if (Object.keys(loginformErrors).length === 0) {
148 | dispatch(login(loginformData));
149 | }
150 | };
151 |
152 | if (error) {
153 | toast({
154 | title: "Wrong Credentials!",
155 | description: "Try again.",
156 | status: "error",
157 | duration: 5000,
158 | isClosable: true,
159 | position: "top",
160 | });
161 | setTimeout(() => {
162 | window.location.reload();
163 | }, 500);
164 | }
165 |
166 | const { title, firstname, lastname, email, password, repassword } =
167 | registerformData;
168 |
169 | return (
170 | <>
171 |
172 |
180 | {/* Left Side */}
181 |
189 |
190 |
191 | CREATE AN ACCOUNT
192 |
193 |
194 | Please enter the following information to create your account.
195 |
196 |
319 |
320 |
321 |
322 | {/* Right Side */}
323 |
331 |
332 |
333 | ALREADY REGISTERED?
334 |
335 |
336 | If you have an account with us, please log in.
337 |
338 |
384 |
385 |
386 |
387 |
388 |
389 | >
390 | );
391 | };
392 |
393 | export default Social;
394 |
--------------------------------------------------------------------------------
/project/src/components/Confirm/Confirm.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Header from "./Header";
3 | import Product from "./Product";
4 | import Footer from "./Footer";
5 | import { Link } from "react-router-dom";
6 | import axios from "axios";
7 | import { useNavigate } from "react-router-dom";
8 |
9 | import {
10 | SimpleGrid,
11 | Box,
12 | Grid,
13 | GridItem,
14 | Textarea,
15 | Checkbox,
16 | } from "@chakra-ui/react";
17 |
18 | const getForm = () => {
19 | let form = JSON.parse(localStorage.getItem("form")) || [];
20 |
21 | return form;
22 | };
23 |
24 | const getNumber = () => {
25 | let number = JSON.parse(localStorage.getItem("number")) || [];
26 |
27 | return number;
28 | };
29 |
30 | const Confirm = () => {
31 | const [form, setForm] = React.useState([]);
32 | const [number, setNumber] = React.useState([]);
33 | const [products, setProducts] = React.useState([]);
34 | const navigate = useNavigate();
35 | let subtotal = 0;
36 |
37 | const getData = async () => {
38 | return axios
39 | .get("https://nyresa-project-server.onrender.com/productlist")
40 | .then((res) => setProducts(res.data));
41 | };
42 |
43 | const add = (total) => {
44 | subtotal = subtotal + total;
45 | };
46 |
47 | React.useEffect(() => {
48 | setForm(getForm());
49 | setNumber(getNumber());
50 | }, []);
51 |
52 | React.useEffect(() => {
53 | getData();
54 | }, []);
55 |
56 | const handlePurchase = () => {
57 | alert("Your order has been placed successfully! ");
58 | products.forEach(d=>{
59 | axios.delete(`https://nyresa-project-server.onrender.com/productlist/${d.id}`)
60 | })
61 | navigate("/")
62 | };
63 |
64 | return (
65 |
66 |
67 |
73 |
74 | ORDER REVIEW
75 |
76 | Please review your order, confirm that you have read and accept our
77 | terms and conditions, and then click "complete purchase".
78 |
79 |
80 |
81 |
86 |
87 | {" "}
88 |
89 | Due to import regulations, the carrier (DHL) may charge duties and
90 | taxes upon delivery. Kindly note that we cannot refund these fees,
91 | even if you return your items. Do you agree to these conditions?
92 | {" "}
93 |
94 |
95 |
104 | YES, I ACCEPT
105 |
106 |
107 |
108 | Please send me more information
109 |
110 |
111 |
115 |
119 |
120 |
121 |
127 |
128 |
129 | SHIPPING ADDRESS
130 |
131 |
132 | {" "}
133 |
134 | {" "}
135 | Change{" "}
136 |
137 |
138 |
139 |
140 | {form[0]}{" "}
141 |
142 | {form[1]} {form[2]}
143 | {" "}
144 |
145 |
146 | {form[6]}
147 |
148 | {form[7]} {form[8]} {" "}
149 |
150 |
151 | {form[9]}
152 |
153 |
154 | Email address {form[4]} {" "}
155 |
156 |
157 |
158 |
164 |
165 |
166 | SHIPPING METHOD
167 |
168 |
169 | {" "}
170 |
171 | {" "}
172 | Change{" "}
173 |
174 |
175 |
176 |
177 | {form[11]} $ 0.00 {" "}
178 |
179 |
180 |
186 |
187 |
188 | CLIMATE NEUTRAL OPTION
189 |
190 |
191 | {" "}
192 |
193 | {" "}
194 | Change{" "}
195 |
196 |
197 |
198 |
204 | Change your settings now to help offset the CO2 emissions of
205 | your order
206 |
207 | CO2 offsetting € 0.00
208 |
209 |
210 |
211 |
212 |
213 |
219 |
220 |
221 | BILLING ADDRESS
222 |
223 |
224 | {" "}
225 |
226 | {" "}
227 | Change{" "}
228 |
229 |
230 |
231 |
232 | {form[0]}{" "}
233 |
234 | {form[1]} {form[2]}
235 | {" "}
236 |
237 | {form[5]}
238 | {form[6]}
239 |
240 | {form[7]} {form[8]} {" "}
241 |
242 |
243 | {form[9]}
244 |
245 |
246 |
247 |
253 |
254 |
255 | PACKAGING OPTIONS
256 |
257 |
258 | {" "}
259 |
260 | {" "}
261 | Change
262 |
263 |
264 |
265 | {form[13] || form[12]}
266 |
267 |
273 |
274 |
275 | PAYMENT METHOD
276 |
277 |
278 | {" "}
279 |
280 | {" "}
281 | Change{" "}
282 |
283 |
284 |
285 |
286 | card type:
287 |
288 |
289 | Card number: xxxx-{number[0] % 10000} {" "}
290 |
291 |
292 |
293 |
294 |
295 |
296 |
300 | Product prices exclude all taxes and duties. Please note that import
301 | taxes and duties will be applied and invoiced separately by the
302 | shipping company.
303 |
304 |
305 | {products.map((product) => (
306 |
307 |
319 | {add(product.price * 1)}
320 |
321 | ))}
322 |
323 |
324 |
325 | Subtotal ${subtotal} {" "}
326 |
327 |
328 | Shipping (DHL Express) $ 0.00 {" "}
329 |
330 |
331 | {" "}
332 | Grand Total $
333 | {subtotal} {" "}
334 |
335 |
336 | VAT exception. VAT not included{" "}
337 |
338 |
339 | {" "}
340 |
352 | COMPLETE PURCHASE
353 | {" "}
354 |
355 |
356 |
357 |
362 |
363 |
364 |
365 | {" "}
366 | Try it on in the comfort of your own home {" "}
367 | 30-day return policy. {" "}
368 | Return shipping – easy and free of charge.
369 |
370 |
371 |
378 |
379 | 80 characters left
380 |
381 |
382 |
383 |
384 | Due to a high volume of orders, delays of up to 5 days may occur.
385 | We apologize for any inconvenience this may cause.
386 |
387 |
388 | By completing your order, you accept our terms and conditions, and
389 | agree to our cancellation policy.
390 |
391 |
392 |
393 |
394 |
395 |
396 | Create a user account using the information from this order
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 | From now on I will receive the Mytheresa Newsletter with
405 | selected fashion offers. If I do not wish to receive the
406 | newsletter, I can unsubscribe at any time free of charge at
407 | privacy@mytheresa.com.
408 |
409 |
410 |
411 |
412 |
413 | {" "}
414 |
415 | {" "}
416 | You can also place your order via telephone.
417 |
418 |
419 |
420 |
421 |
422 | );
423 | };
424 |
425 | export default Confirm;
426 |
--------------------------------------------------------------------------------
/project/src/components/Delivery/Delivery.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { useState } from "react";
4 | import { useNavigate } from "react-router-dom";
5 | import { Image } from "@chakra-ui/react";
6 | import {
7 | Grid,
8 | GridItem,
9 | Box,
10 | SimpleGrid,
11 | Radio,
12 | RadioGroup,
13 | Stack,
14 | Input,
15 | Select,
16 | Button,
17 | Checkbox,
18 | } from "@chakra-ui/react";
19 |
20 | import Header from "./Header";
21 | import Footer from "./Footer";
22 |
23 | const Delivery = () => {
24 | const [value, setValue] = React.useState("");
25 | const [firstName, setFirstName] = React.useState("");
26 | const [lastName, setLastName] = React.useState("");
27 | const [company, setCompany] = React.useState("");
28 | const [email, setEmail] = React.useState("");
29 | const [street, setStreet] = React.useState("");
30 | const [lineTwo, setLineTwo] = React.useState("");
31 | const [post, setPost] = React.useState("");
32 | const [city, setCity] = React.useState("");
33 | const [country, setCountry] = React.useState("");
34 | const [phone, setPhone] = React.useState("");
35 | const [dhl, setDhl] = useState("");
36 | const [mPack, setMPack] = useState("");
37 | const [ePack, setEPack] = useState("");
38 | const navigate = useNavigate();
39 |
40 | const handleClick = (e) => {
41 | e.preventDefault();
42 | localStorage.setItem(
43 | "form",
44 | JSON.stringify([
45 | value,
46 | firstName,
47 | lastName,
48 | company,
49 | email,
50 | street,
51 | lineTwo,
52 | post,
53 | city,
54 | country,
55 | phone,
56 | dhl,
57 | mPack,
58 | ePack,
59 | ])
60 | );
61 |
62 | if (
63 | value === "" ||
64 | firstName === "" ||
65 | lastName === "" ||
66 | email === "" ||
67 | street === "" ||
68 | post === "" ||
69 | country === "" ||
70 | city === "" ||
71 | phone === ""
72 | ) {
73 | alert("Prease fill in required* details");
74 | } else if (dhl === "") {
75 | alert("Plaese select DHL as shipping method");
76 | } else if (mPack === "" && ePack === "") {
77 | alert("Please select a packaging option");
78 | } else if (phone.length !== 10) {
79 | alert("Please enter correct phone number");
80 | } else {
81 | navigate("/payment");
82 | }
83 | };
84 |
85 | console.log(phone.length);
86 |
87 | return (
88 |
89 |
90 |
91 | {/*
*/}
92 |
93 |
94 |
95 |
100 |
101 |
102 | SHIPPING ADDRESS
103 |
104 |
105 | Please enter your shipping address in the form below.
106 |
107 |
108 | setValue(value)}
112 | >
113 |
114 |
115 | Ms.*
116 |
117 |
118 | Mrs.*
119 |
120 |
121 | Mr.*
122 |
123 |
124 |
125 |
126 |
127 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
261 |
268 | SHIPPING METHOD
269 |
276 | Due to a high volume of orders, delays of up to 5 days may occur.
277 | We apologize for any inconvenience this may cause.
278 |
279 |
280 |
281 |
282 |
283 | DHL
284 |
285 |
286 |
290 |
291 |
292 |
293 |
294 |
295 |
296 | setDhl(value)}
300 | >
301 |
302 |
303 | DHL EXPRESS
304 |
305 |
306 |
307 |
308 |
309 | € 0.00
310 |
311 |
312 |
313 | 2-4 business days delivery time
314 |
320 | PACKAGING OPTIONS
321 |
328 |
332 | setMPack(value)}
337 | >
338 |
339 |
340 | Mytheresa packaging
341 |
342 |
343 |
344 | Free
345 |
350 |
351 |
355 | setEPack(value)}
360 | >
361 |
362 |
363 | Eco packaging
364 |
365 |
366 |
367 | Free
368 |
373 |
374 |
375 | CLIMATE NEUTRAL OPTION
376 |
381 |
382 |
383 |
384 | Help offset the CO2 emissions of your order
385 |
386 |
387 |
388 | € 0.40
389 |
390 |
391 |
392 |
393 |
402 | PROCEED TO CHECKOUT
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
420 |
421 | copyright © 2006-2022 mytheresa.com
422 |
423 |
429 | terms of use privacy policy imprint
430 |
431 |
432 |
433 | );
434 | };
435 |
436 | export default Delivery;
437 |
--------------------------------------------------------------------------------