├── .babelrc
├── .eslintrc.json
├── public
├── favicon.ico
└── popup-bg.jpg
├── postcss.config.js
├── lib
├── sortTitles.js
├── spliceData.js
├── dbConnect.js
├── categoryList.js
├── withAuth.js
├── successEffect.js
└── querySearch.js
├── models
├── Item.js
├── order.js
├── Seller.js
├── BlogPost.js
├── Product.js
└── User.js
├── components
├── Admin
│ ├── Feed
│ │ ├── DashBorard
│ │ │ ├── Chart.js
│ │ │ ├── AdminFeed.js
│ │ │ ├── DashBorardTop.js
│ │ │ └── SingleListItem.js
│ │ ├── Product
│ │ │ ├── EditeProduct.js
│ │ │ ├── ProductFeed.js
│ │ │ └── ProductTop.js
│ │ ├── Customer
│ │ │ ├── CusTomerFeed.js
│ │ │ ├── CustomerTop.js
│ │ │ ├── CustomerSingleList.js
│ │ │ └── CustomerListItem.js
│ │ ├── FeedCommunTopHeader.js
│ │ └── Items
│ │ │ ├── ItemsTop.js
│ │ │ ├── ItemSingleList.js
│ │ │ └── ItemsFeed.js
│ ├── Header
│ │ └── RightDropDown.js
│ ├── AdminLayout.js
│ └── SidedeBar
│ │ ├── SidebarItem.js
│ │ └── AdminSidebar.js
├── Home
│ ├── MiddleAds.js
│ ├── TopNewArrival
│ │ └── TopNewArrival.js
│ ├── Categories
│ │ ├── Categories.js
│ │ └── SingleCategories.js
│ ├── Banner.js
│ ├── Features.js
│ ├── RecomendedProduct
│ │ └── RecomendedProduct.js
│ └── Modal
│ │ └── Modal.js
├── commonComponents
│ ├── MainFooter.js
│ ├── MainHeader.js
│ └── Breadcrumb.js
├── OrderDetails
│ ├── OrderDetailsTop
│ │ ├── OrderStepProgress.js
│ │ └── OrderDetailsTop.js
│ └── OrderDetailsBottom
│ │ └── OrderDetailsBottom.js
├── AboutPage
│ ├── ourHIstoy
│ │ ├── historyPreview
│ │ │ └── HistoryPreview.js
│ │ └── OurHistory.js
│ ├── ourVision
│ │ ├── VIsitionSingleLi
│ │ │ └── VisionSingleLi.js
│ │ └── OurVision.js
│ ├── AboutBanner
│ │ └── AboutBanner.js
│ ├── ourCompany
│ │ └── OurCompany.js
│ └── ourTeam
│ │ ├── SingleTeam
│ │ └── SingleTeam.js
│ │ └── OurTeam.js
├── Layout.js
├── CartPage
│ ├── CartTitleBar.js
│ └── ProductNotAvailable.js
├── Copyright.js
├── ShopGridPage
│ ├── ShopContent
│ │ ├── ShopMain
│ │ │ └── ShopMain.js
│ │ ├── ShopList
│ │ │ └── ShopList.js
│ │ └── ShopContent.js
│ └── ShopSidebar
│ │ └── ShopCategory
│ │ └── ShopCategory.js
├── CheckoutPage
│ ├── SingleChekoutOrder
│ │ └── SingleCheckoutOrder.js
│ ├── CheckOrder
│ │ └── CheckoutOrder.js
│ └── CheckoutFrom
│ │ └── CheckoutFrom.js
├── Account
│ ├── AccuntSingleCard.js
│ └── AccountInfoCard.js
├── ViewPage
│ ├── RatingStar.js
│ ├── ProductDetails.js
│ └── ProductImage.js
├── MyProductPage
│ └── NotfoundProduct.js
├── ForgetPage
│ └── ForgetFrom.js
├── MyProductTitleBar.js
├── WishListPage
│ └── WishListProductNotAvailable.js
├── FaqPage
│ ├── OrderReturnFaqData
│ │ └── OrderFaqData.js
│ ├── PaymentFaqData
│ │ └── PaymentFaqData.js
│ └── ShoppingFaqData
│ │ └── ShoppingFaqData.js
├── EditePaymentmethod
│ └── EditePaymentFrom
│ │ └── EditePaymentFrom.js
├── PaymentMethod
│ └── SinglePaymentCard
│ │ └── SinglePaymentCard.js
├── MyReviews
│ └── SingleRevies
│ │ └── SingleReviews.js
├── OrderReturn
│ └── SingleReturnOrder
│ │ └── SingleReturnOrder.js
├── ContactPage
│ ├── ContactInfo
│ │ └── ContactInfo.js
│ └── ContactForm
│ │ └── ContactForm.js
├── BlogPage
│ └── BlogPost
│ │ └── BlogPost.js
└── ReturnOrderDetails
│ └── ReturnOrderMain
│ └── ReturnOrdermain.js
├── app
└── store.js
├── next.config.js
├── pages
├── jobs.js
├── forget-password.js
├── api-status.js
├── developers.js
├── documentation.js
├── user
│ ├── my-write-review.js
│ ├── EditePayment-methods.js
│ ├── return-order-details.js
│ ├── order-complete.js
│ ├── order-details.js
│ ├── payment-methods.js
│ ├── account.js
│ ├── order-traking.js
│ ├── order-cancel.js
│ └── my-reviews.js
├── checkout.js
├── api
│ ├── blog
│ │ ├── index.js
│ │ └── [slug].js
│ ├── create-checkout-session.js
│ ├── auth
│ │ └── [...nextauth].js
│ ├── order.js
│ ├── hello
│ │ ├── [id].js
│ │ └── index.js
│ ├── productitem.js
│ ├── product
│ │ ├── index.js
│ │ └── [id].js
│ ├── wishlist.js
│ ├── user.js
│ ├── userHistory.js
│ └── webhook.js
├── _app.js
├── admin
│ ├── users.js
│ ├── index.js
│ ├── product.js
│ ├── customers.js
│ └── items.js
├── blog
│ ├── [slug].js
│ ├── announcement.js
│ └── mypost.js
├── login.js
├── contact.js
├── cart.js
├── 404.js
├── success.js
├── about.js
├── shop.js
└── index.js
├── .gitignore
├── tailwind.config.js
├── firebase.js
├── README.md
├── package.json
├── styles
├── globals.css
└── custom.css
├── slices
├── wishSlice.js
└── appSlice.js
└── permissions.json
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["next/babel"]
3 | }
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | // {
2 | // "extends": "next/core-web-vitals"
3 | // }
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devSahinur/toto-shop/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/popup-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devSahinur/toto-shop/HEAD/public/popup-bg.jpg
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/lib/sortTitles.js:
--------------------------------------------------------------------------------
1 | const sortTitles = ["Latest", "Price low to high", "Price high to low"]
2 |
3 | export default sortTitles
4 |
--------------------------------------------------------------------------------
/models/Item.js:
--------------------------------------------------------------------------------
1 | import mongoose from "mongoose"
2 |
3 | const ItemSchema = new mongoose.Schema({
4 | id: String,
5 | name: String,
6 | })
7 |
8 | module.exports = mongoose.models.Item || mongoose.model("Item", ItemSchema)
--------------------------------------------------------------------------------
/components/Admin/Feed/DashBorard/Chart.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | function Chart() {
4 | return (
5 |
25 |
26 |
27 | {/*
*/}
28 | {/* TODO: user card INformation */}
29 |
32 | {/*
33 | {/* */}
34 | {/*
35 |
36 |
*/}
37 |
38 |
39 |
40 | >
41 | );
42 | }
43 |
44 | export default withAuth(account);
45 | // export default account;
46 |
--------------------------------------------------------------------------------
/components/Home/RecomendedProduct/RecomendedProduct.js:
--------------------------------------------------------------------------------
1 | import SingleArrival from "../TopNewArrival/SingleArrival";
2 |
3 | const products = [
4 | {
5 | id: 1,
6 | title: "Guyer chair",
7 | price: 45.0,
8 | rating: 150,
9 | image: "https://i.ibb.co/2jHpJws/product1.jpg",
10 | },
11 | {
12 | id: 2,
13 | title: "Guyer chair",
14 | price: 45.0,
15 | rating: 150,
16 | image: "https://i.ibb.co/mCdRt0s/product2.jpg",
17 | },
18 | {
19 | id: 3,
20 | title: "Guyer chair",
21 | price: 45.0,
22 | rating: 150,
23 | image: "https://i.ibb.co/M8LrQyQ/product3.jpg",
24 | },
25 | {
26 | id: 4,
27 | title: "Guyer chair",
28 | price: 45.0,
29 | rating: 150,
30 | image: "https://i.ibb.co/9rn0tSy/product4.jpg",
31 | },
32 | {
33 | id: 5,
34 | title: "Guyer chair",
35 | price: 45.0,
36 | rating: 150,
37 | image: "https://i.ibb.co/tsZybpt/product5.jpg",
38 | },
39 | {
40 | id: 6,
41 | title: "Guyer chair",
42 | price: 45.0,
43 | rating: 150,
44 | image: "https://i.ibb.co/2nfH6ZX/product6.jpg",
45 | },
46 | {
47 | id: 7,
48 | title: "Guyer chair",
49 | price: 45.0,
50 | rating: 150,
51 | image: "https://i.ibb.co/xg8fwz4/product7.jpg",
52 | },
53 | {
54 | id: 8,
55 | title: "Guyer chair",
56 | price: 45.0,
57 | rating: 150,
58 | image: "https://i.ibb.co/N2C78ws/product11.jpg",
59 | },
60 | ];
61 |
62 | export const RecomendedProduct = ({ products }) => {
63 | const allProduct = products.slice(4);
64 |
65 | return (
66 |
67 |
68 | recomended for you
69 |
70 |
71 | {allProduct?.map((product) => (
72 |
73 | ))}
74 |
75 |
76 | );
77 | };
78 |
--------------------------------------------------------------------------------
/components/AboutPage/ourTeam/SingleTeam/SingleTeam.js:
--------------------------------------------------------------------------------
1 | import Image from "next/image";
2 | import Link from "next/link";
3 | import Head from "next/head";
4 |
5 | function SingleTeam({ id, image, name, status, fbLink, insLink, twiLink }) {
6 | return (
7 |
8 | {/* for fontawesome icon in Head */}
9 |
10 |
About US
11 |
12 |
13 |
14 |
15 |
16 |
17 |
24 | {/*
*/}
25 |
36 |
37 |
38 | {/* user info */}
39 |
40 |
{name}
41 |
{status}
42 |
43 |
44 | );
45 | }
46 |
47 | export default SingleTeam;
48 |
--------------------------------------------------------------------------------
/components/EditePaymentmethod/EditePaymentFrom/EditePaymentFrom.js:
--------------------------------------------------------------------------------
1 | function EditePaymentFrom() {
2 | return (
3 |
4 |
Edit Payment Method
5 |
51 |
52 | );
53 | }
54 |
55 | export default EditePaymentFrom;
56 |
--------------------------------------------------------------------------------
/components/AboutPage/ourHIstoy/OurHistory.js:
--------------------------------------------------------------------------------
1 | import HistoryPreview from "./historyPreview/HistoryPreview";
2 | import Image from "next/image";
3 |
4 | function OurHistory() {
5 | const data = [
6 | { id: 1, number: "12", text: "Years Exprience" },
7 | { id: 2, number: "20k", text: "Happy Customer" },
8 | { id: 3, number: "100%", text: "Clients Satisfaction" },
9 | ];
10 |
11 | return (
12 |
13 | {/* history left */}
14 |
15 |
our History
16 |
20 | Creative and new fashion trends collection
21 |
22 |
26 | Fashion is a potent visual marker of our times,"says Caroilne
27 | Stevenson,head of cultural and... "Trend analysis of any given era
28 | will reveal society's values and aspirataions"... The urge to creative
29 | expression runs deep
30 |
31 | {/* preview div */}
32 |
33 | {data?.map(({ id, number, text }) => (
34 |
35 | ))}
36 |
37 |
38 |
39 | {/* history right */}
40 |
41 | {/* */}
42 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default OurHistory;
54 |
--------------------------------------------------------------------------------
/pages/cart.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import CartTitleBar from "../components/CartPage/CartTitleBar";
3 | import OrderSummary from "../components/CartPage/OrderSummary";
4 | import { SingleCart } from "../components/CartPage/SingleCart";
5 | import { useSelector } from "react-redux";
6 | import { selectItems } from "../slices/appSlice";
7 | import ProductNotAvailable from "../components/CartPage/ProductNotAvailable";
8 | import MainHeader from "../components/commonComponents/MainHeader";
9 | import MainFooter from "../components/commonComponents/MainFooter";
10 |
11 | function cart() {
12 | const cartData = useSelector(selectItems);
13 |
14 | return (
15 | <>
16 |
17 |
Cart({cartData.length}) - ToTo SHOP
18 |
19 |
20 |
24 |
25 | {cartData.length ? (
26 | <>
27 |
28 |
29 |
30 |
31 |
32 | {cartData?.map((product) => (
33 |
38 | ))}
39 |
40 |
41 |
42 |
43 |
44 | >
45 | ) : (
46 |
47 | )}
48 | >
49 | );
50 | }
51 |
52 | export default cart;
53 |
--------------------------------------------------------------------------------
/components/commonComponents/Breadcrumb.js:
--------------------------------------------------------------------------------
1 | import { useRouter } from "next/router";
2 |
3 | const Breadcrumb = ({ title, second }) => {
4 | const router = useRouter();
5 | return (
6 |
7 |
router.push("/")}
9 | className="text-primary cursor-pointer text-base"
10 | >
11 |
17 |
18 |
19 |
20 |
21 |
29 |
30 |
31 |
32 |
{title}
33 | {second && (
34 | <>
35 |
36 |
44 |
49 |
50 |
51 |
{second}
52 | >
53 | )}
54 |
55 | );
56 | };
57 |
58 | export default Breadcrumb;
59 |
--------------------------------------------------------------------------------
/pages/404.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import Copyright from "../components/Copyright";
3 | import Image from "next/image";
4 | import { useRouter } from "next/router";
5 | import MainHeader from "../components/commonComponents/MainHeader";
6 | function Custom404() {
7 | const router = useRouter();
8 | return (
9 | <>
10 |
11 |
404 Error - ToTo SHOP
12 |
13 |
14 |
18 |
19 |
20 | {/*
*/}
21 | {/* main-Content */}
22 |
23 |
24 | {/* bottom containt */}
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | THE PAGE YOU'VE REQUESTED IS NOT AVAILABLE
33 |
34 |
router.push("/")}
36 | className="block w-full py-1 text-center cursor-pointer text-white bg-primary border border-primary rounded-b hover:bg-transparent hover:text-primary transition"
37 | >
38 | Back to Home
39 |
40 |
41 |
42 |
43 |
44 | >
45 | );
46 | }
47 |
48 | export default Custom404;
49 |
--------------------------------------------------------------------------------
/components/PaymentMethod/SinglePaymentCard/SinglePaymentCard.js:
--------------------------------------------------------------------------------
1 | import Image from "next/image";
2 | import { StarIcon } from "@heroicons/react/solid";
3 | import { useRouter } from "next/router";
4 |
5 | function SinglePaymentCard({
6 | id,
7 | image,
8 | method,
9 | defaultValue,
10 | lastFour,
11 | expires,
12 | }) {
13 | const router = useRouter();
14 | return (
15 |
16 | {/* div top */}
17 |
18 | {/* top left */}
19 |
20 |
21 |
22 | {/* method */}
23 |
24 |
Method
25 |
{method}
26 |
27 | {/* another one */}
28 |
29 |
Last Four
30 |
{lastFour}
31 |
32 |
33 | {/* another one */}
34 |
35 |
Expires
36 |
{expires}
37 |
38 |
39 | {/* detault value */}
40 |
41 |
Defalut
42 |
{defaultValue ? "Yes" : "No"}
43 |
44 |
45 | {/* button */}
46 |
47 | router.push("/EditePayment-methods")}
49 | className="btn-outline px-4 font-medium py-[6px]"
50 | >
51 | Edit
52 |
53 |
54 | Delete
55 |
56 |
57 |
58 |
59 | );
60 | }
61 |
62 | export default SinglePaymentCard;
63 |
--------------------------------------------------------------------------------
/pages/api/wishlist.js:
--------------------------------------------------------------------------------
1 | import dbConnect from "./../../lib/dbConnect";
2 | import User from "./../../models/User";
3 | import { getSession } from "next-auth/react";
4 |
5 | export default async function handler(req, res) {
6 | const { method } = req;
7 | const userSession = await getSession({ req });
8 |
9 | if (userSession === null) {
10 | res.status(401);
11 | } else {
12 | await dbConnect();
13 | const { user } = userSession;
14 |
15 | switch (method) {
16 | case "POST":
17 | try {
18 | const itemID = req.body.itemID;
19 | const filter = { name: user.name, email: user.email };
20 | const update = {
21 | $addToSet: {
22 | wishlist: itemID,
23 | },
24 | };
25 | await User.findOneAndUpdate(filter, update);
26 |
27 | res.status(200).json({ success: true });
28 | } catch (error) {
29 | res
30 | .status(405)
31 | .send({ error: "error, POST method for wishlist api" });
32 | }
33 | break;
34 | case "GET":
35 | try {
36 | const filter = { name: user.name, email: user.email };
37 | const data = await User.findOne(filter, "wishlist -_id");
38 |
39 | res.status(200).json(data.wishlist);
40 | } catch (error) {
41 | res.status(405).send({ error: "error, GET method for wishlist api" });
42 | }
43 | break;
44 | case "DELETE":
45 | try {
46 | const itemID = req.body.itemID;
47 | const filter = { name: user.name, email: user.email };
48 | const update = {
49 | $pull: { wishlist: itemID },
50 | };
51 |
52 | await User.findOneAndUpdate(filter, update);
53 | res.status(200).json({ success: true });
54 | } catch (error) {
55 | res
56 | .status(405)
57 | .send({ error: "error, DELETE method for wishlist api" });
58 | }
59 |
60 | default:
61 | res.status(405);
62 | break;
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/slices/wishSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const initialState = {
4 | wishList: [],
5 | currenUserWish: [],
6 | };
7 |
8 | export const wishSlice = createSlice({
9 | name: "wish",
10 | initialState,
11 | reducers: {
12 | addAllToWish: (state, action) => {
13 | state.wishList = action.payload;
14 | },
15 | addToWish: (state, action) => {
16 | const findIndex = state.wishList.findIndex(
17 | (item) => item === action.payload
18 | );
19 |
20 | if (findIndex >= 0) {
21 | return;
22 | } else {
23 | state.wishList = [...state.wishList, action.payload];
24 | }
25 | },
26 |
27 | removeSingleWish: (state, action) => {
28 | const findIndex = state.wishList.findIndex(
29 | (item) => item === action.payload
30 | );
31 | const newWish = [...state.wishList];
32 | if (findIndex >= 0) {
33 | newWish.splice(findIndex, 1);
34 | }
35 | state.wishList = newWish;
36 | },
37 |
38 | removeFromWish: (state, action) => {
39 | const findIndex = state.currenUserWish.findIndex(
40 | (item) => item._id === action.payload._id
41 | );
42 | const newWish = [...state.currenUserWish];
43 | if (findIndex >= 0) {
44 | newWish.splice(findIndex, 1);
45 | }
46 | state.currenUserWish = newWish;
47 | },
48 |
49 | addSingleWish: (state, action) => {
50 | const findTaht = state.currenUserWish.find(
51 | (wish) => wish._id === action.payload._id
52 | );
53 |
54 | if (findTaht) {
55 | return;
56 | } else {
57 | state.currenUserWish = [...state.currenUserWish, action.payload];
58 | }
59 | },
60 | },
61 | });
62 |
63 | export const {
64 | addToWish,
65 | removeFromWish,
66 | addAllToWish,
67 | addSingleWish,
68 | removeSingleWish,
69 | } = wishSlice.actions;
70 |
71 | export const selectWish = (state) => state.wish.wishList;
72 | export const selectWishAll = (state) => state.wish.currenUserWish;
73 |
74 | export default wishSlice.reducer;
75 |
--------------------------------------------------------------------------------
/pages/success.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import { CheckIcon } from "@heroicons/react/outline";
3 | import { useEffect } from "react";
4 | import { shootFireworks } from "../lib/successEffect";
5 | import MainHeader from "../components/commonComponents/MainHeader";
6 | import MainFooter from "../components/commonComponents/MainFooter";
7 | import { useRouter } from "next/router";
8 |
9 |
10 | function success() {
11 | const router = useRouter()
12 | useEffect(() => {
13 | shootFireworks();
14 | }, []);
15 | return (
16 | <>
17 |
18 |
Thanks for your order! - ToTo SHOP
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | Thanks for your order!
32 |
33 |
Check your inbox for the receipt.
34 |
35 |
36 |
37 |
38 |
router.push("user/my-order-history")}
40 | className="block w-full py-1 text-center cursor-pointer text-white bg-primary border border-primary rounded-b hover:bg-transparent hover:text-primary transition"
41 | >
42 | Go to my orders
43 |
44 |
45 |
46 | >
47 | );
48 | }
49 |
50 | export default success;
51 |
--------------------------------------------------------------------------------
/pages/api/user.js:
--------------------------------------------------------------------------------
1 | // Database
2 | import dbConnect from "./../../lib/dbConnect";
3 | import User from "./../../models/User";
4 | import Product from "./../../models/Product";
5 | import Seller from "./../../models/Seller";
6 | import { getSession } from "next-auth/react";
7 | // mongoose lib
8 | import mongoose from "mongoose";
9 |
10 | export default async function handler(req, res) {
11 | const { method } = req;
12 | const userSession = await getSession({ req });
13 | if (userSession === null) {
14 | res.status(401).json({ Website: "Login first then data will be given 😃" });
15 | } else {
16 | const { user } = userSession;
17 |
18 | switch (method) {
19 | case "GET":
20 | // Get all items that sellerId sold
21 | try {
22 | const email = user?.email;
23 | const UserData = await User.find({ email }).sort({ _id: -1 }).lean();
24 | res.status(200).json({ Login: UserData });
25 | } catch (err) {
26 | res.status(404).json({ success: false });
27 | }
28 | break;
29 | case "PUT":
30 | try {
31 | const { userId } = req.query;
32 | const data = req.body;
33 | const id = mongoose.Types.ObjectId(userId);
34 | await dbConnect();
35 | await User.findByIdAndUpdate(id, { ...data });
36 | res.status(200).json({ success: true });
37 | } catch (err) {
38 | res.status(400).json({ success: false });
39 | }
40 | break;
41 | case "DELETE":
42 | try {
43 | const userId = req.query.userId;
44 | const { sellerId } = req.body;
45 | await dbConnect();
46 | const id = mongoose.Types.ObjectId(userId);
47 | await User.findByIdAndDelete(id);
48 | if (!!sellerId) {
49 | await Product.deleteMany({ sellerId });
50 | await Seller.findOneAndDelete({ id: sellerId });
51 | }
52 | res.status(200).json({ success: true });
53 | } catch (err) {
54 | res.status(400).json({ success: false });
55 | }
56 | break;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/slices/appSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice } from "@reduxjs/toolkit";
2 |
3 | const initialState = {
4 | items: [],
5 | };
6 |
7 | export const basketSlice = createSlice({
8 | name: "basket",
9 | initialState,
10 | reducers: {
11 | addToBasket: (state, action) => {
12 | // state.items = [...state.items, action.payload];
13 | console.log(action.payload.product?._id);
14 | const findIndex = state.items.findIndex(
15 | (product) => product?.product?._id === action.payload.product?._id
16 | );
17 | let newCart = [...state.items];
18 | if (findIndex >= 0) {
19 | newCart[findIndex].quantity += 1;
20 | } else {
21 | newCart = [...state.items, action.payload];
22 | }
23 | state.items = newCart;
24 | },
25 | removeFromBasket: (state, action) => {
26 | console.log(action.payload.product?._id);
27 | const findIndex = state.items.findIndex(
28 | (product) => product?.product?._id === action.payload._id
29 | );
30 | let newCart = [...state.items];
31 | if (findIndex >= 0) {
32 | if (newCart[findIndex].quantity > 1) {
33 | newCart[findIndex].quantity -= 1;
34 | } else {
35 | newCart.splice(findIndex, 1);
36 | }
37 | }
38 | state.items = newCart;
39 | },
40 | removeFulProduct: (state, action) => {
41 | const findIndex = state.items.findIndex(
42 | (product) => product?.product?._id === action.payload._id
43 | );
44 | let newCart = [...state.items];
45 | if (findIndex >= 0) {
46 | newCart.splice(findIndex, 1);
47 | }
48 | state.items = newCart;
49 | },
50 | },
51 | });
52 |
53 | export const { addToBasket, removeFromBasket, removeFulProduct } =
54 | basketSlice.actions;
55 |
56 | // Selectors - This is how we pull information from the Global store slice
57 | export const selectItems = (state) => state.basket.items;
58 | export const selectTotal = (state) =>
59 | state.basket.items.reduce(
60 | (total, item) => total + item.quantity * item.product.price,
61 | 0
62 | );
63 |
64 | export default basketSlice.reducer;
65 |
--------------------------------------------------------------------------------
/components/MyReviews/SingleRevies/SingleReviews.js:
--------------------------------------------------------------------------------
1 | import Image from "next/image";
2 | import { StarIcon } from "@heroicons/react/solid";
3 | import { useRouter } from "next/router";
4 | function SingleReviews({
5 | id,
6 | image,
7 | orderNumber,
8 | date,
9 | ratting,
10 | total,
11 | status,
12 | titile,
13 | }) {
14 | const router = useRouter();
15 |
16 | return (
17 |
18 | {/* div top */}
19 |
20 | {/* top left */}
21 |
22 |
23 |
24 |
{titile}
25 |
${total}
26 | {/* ratting */}
27 |
28 | {ratting?.map((num,index) => (
29 |
30 | ))}
31 |
32 |
33 |
34 | {/* another one */}
35 |
36 |
Order Number
37 |
{orderNumber}
38 |
39 | {/* another one */}
40 |
41 |
Purchased
42 |
{date}
43 |
44 | {/* button */}
45 |
46 | {status ? (
47 | router.push("/my-write-review")}
49 | className="btn-outline py-2 text-sm"
50 | >
51 | Write Review
52 |
53 | ) : (
54 | Edit Review
55 | )}
56 |
57 |
58 |
59 | );
60 | }
61 |
62 | export default SingleReviews;
63 |
--------------------------------------------------------------------------------
/components/OrderReturn/SingleReturnOrder/SingleReturnOrder.js:
--------------------------------------------------------------------------------
1 | import { useRouter } from "next/router";
2 |
3 | function SingleReturnOrder({ product }) {
4 | const router = useRouter();
5 | return (
6 | <>
7 | {/* */}
8 |
9 | {/* */}
10 |
11 | {/* image */}
12 |
13 |
14 |
15 |
16 | {/* title and price */}
17 |
18 |
{product.title}
19 |
${product.price}
20 |
21 |
22 | {/* */}
23 |
24 | {/* */}
25 |
26 |
Order Number
27 |
28 | {product.orderNumbers}
29 |
30 |
31 | {/* */}
32 |
33 |
Return status
34 | {product.returnStatus ? (
35 |
36 | Successful
37 |
38 | ) : (
39 |
40 | Processing
41 |
42 | )}
43 |
44 | {/* view order */}
45 |
46 | router.push("/user/return-order-details")}
48 | className="btn-outline py-2"
49 | >
50 | View Order
51 |
52 |
53 |
54 | {/* */}
55 | >
56 | );
57 | }
58 |
59 | export default SingleReturnOrder;
60 |
--------------------------------------------------------------------------------
/components/OrderDetails/OrderDetailsBottom/OrderDetailsBottom.js:
--------------------------------------------------------------------------------
1 | function OrderDetailsBottom() {
2 | return (
3 |
4 | {/* bottom left */}
5 |
6 |
Shipping Address
7 |
8 |
Faysal Mridha
9 |
3891 Ranchview Dr.
10 |
IndurKani,Pirojpur
11 |
+8801646177169
12 |
13 |
14 | {/* bottom middle */}
15 |
16 |
Shipping Address
17 |
18 |
Faysal Mridha
19 |
3891 Ranchview Dr.
20 |
IndurKani,Pirojpur
21 |
+8801646177169
22 |
23 |
24 | {/* bottom right */}
25 |
26 |
Total Summary
27 |
28 | {/* total top */}
29 |
30 |
31 | Subtotal $50
32 |
33 |
34 | Shipping Fee $30
35 |
36 |
37 | {/* total bottomg */}
38 |
39 |
40 | Total $80
41 |
42 |
Paid by Cash on Delivery
43 |
44 |
45 |
46 |
47 | );
48 | }
49 |
50 | export default OrderDetailsBottom;
51 |
--------------------------------------------------------------------------------
/components/Admin/Feed/Items/ItemSingleList.js:
--------------------------------------------------------------------------------
1 | import {
2 | DotsHorizontalIcon,
3 | EyeIcon,
4 | PencilIcon,
5 | TrashIcon,
6 | } from "@heroicons/react/outline";
7 | import { useRouter } from "next/router";
8 | import React, { useState } from "react";
9 |
10 | function ItemSingleList({ item, setChecked, confirmDelete }) {
11 | const [dropdown, setDropDown] = useState(false);
12 |
13 | const router = useRouter();
14 |
15 | return (
16 |
17 |
setChecked(item.id)}
20 | checked={item.check}
21 | />
22 |
23 | {item?.title.length > 15
24 | ? item.title.substring(0, 15) + "..."
25 | : item.title}
26 |
27 |
{item?.brand}
28 |
$ {item?.price}
29 |
30 |
setDropDown(!dropdown)}
32 | className="h-5 cursor-pointer"
33 | />
34 |
35 | {dropdown && (
36 |
37 | {/* edite section */}
38 |
40 | router.push(`/admin/product?name=Edite Product&id=${item?._id}`)
41 | }
42 | className="flex items-center space-x-4 px-2 py-1 border-b cursor-pointer"
43 | >
44 |
45 |
Edit
46 |
47 | {/* Delete */}
48 |
confirmDelete(item?._id)}
50 | className="flex items-center space-x-4 px-2 py-1 cursor-pointer"
51 | >
52 |
53 |
Delete
54 |
55 |
56 | )}
57 |
58 |
59 | );
60 | }
61 |
62 | export default ItemSingleList;
63 |
--------------------------------------------------------------------------------
/components/ViewPage/ProductImage.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import "react-inner-image-zoom/lib/InnerImageZoom/styles.css";
3 | import InnerImageZoom from "react-inner-image-zoom";
4 |
5 | export const ProductImage = ({ product }) => {
6 | const [mainImg, setMainImg] = useState(product.image[0]);
7 |
8 | return (
9 |
10 |
11 | {/*
*/}
12 |
13 |
14 |
15 |
setMainImg(product.image[0])}>
16 |
22 |
23 |
setMainImg(product.image[1])}>
24 |
30 |
31 |
setMainImg(product.image[2])}>
32 |
38 |
39 |
setMainImg(product.image[3])}>
40 |
46 |
47 |
setMainImg(product.image[4])}>
48 |
54 |
55 |
56 |
57 | );
58 | };
59 |
--------------------------------------------------------------------------------
/pages/api/userHistory.js:
--------------------------------------------------------------------------------
1 | import dbConnect from "./../../lib/dbConnect";
2 | import User from "./../../models/User";
3 | import { getSession } from "next-auth/react";
4 |
5 | export default async function handler(req, res) {
6 | const { method } = req;
7 | const userSession = await getSession({ req });
8 | const { user } = userSession;
9 |
10 | if (userSession === null) {
11 | res.status(200);
12 | } else {
13 | const { user } = userSession;
14 | await dbConnect();
15 | switch (method) {
16 | case "GET":
17 | try {
18 | const data = await User.findOne(
19 | { name: user.name, email: user.email },
20 | "purchaseHistory -_id"
21 | );
22 | res.status(200).json(data.purchaseHistory);
23 | } catch (error) {
24 | res
25 | .status(400)
26 | .send({ error: "error, GET method for purchaseHistory api" });
27 | }
28 | break;
29 | case "POST":
30 | try {
31 | const filter = { name: user.name, email: user.email };
32 | const update = { $push: { purchaseHistory: req.body } };
33 |
34 | await User.findOneAndUpdate(filter, update);
35 |
36 | res.status(200).json({ success: true });
37 | } catch (error) {
38 | res
39 | .status(400)
40 | .send({ error: "error, POST method for purchaseHistory api" });
41 | }
42 | break;
43 | case "PUT":
44 | try {
45 | const filter = {
46 | name: user.name,
47 | email: user.email,
48 | "purchaseHistory.itemID": req.body,
49 | };
50 | const update = {
51 | $set: {
52 | "purchaseHistory.$.isRating": true,
53 | },
54 | };
55 |
56 | await User.findOneAndUpdate(filter, update);
57 |
58 | res.status(200).json();
59 | } catch (error) {
60 | res
61 | .status(400)
62 | .send({ error: "error, POST method for purchaseHistory api" });
63 | }
64 | break;
65 | default:
66 | res.status(400);
67 | break;
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/pages/about.js:
--------------------------------------------------------------------------------
1 | import AboutBanner from "../components/AboutPage/AboutBanner/AboutBanner";
2 | import { HomeIcon } from "@heroicons/react/solid";
3 | import OurHistory from "../components/AboutPage/ourHIstoy/OurHistory";
4 | import OurVision from "../components/AboutPage/ourVision/OurVision";
5 | import OurTeam from "../components/AboutPage/ourTeam/OurTeam";
6 | import OurCompany from "../components/AboutPage/ourCompany/OurCompany";
7 | import Head from "next/head";
8 | import MainFooter from "../components/commonComponents/MainFooter";
9 | import MainHeader from "../components/commonComponents/MainHeader";
10 |
11 | function about() {
12 | return (
13 | <>
14 |
15 |
About Us - ToTo SHOP
16 |
17 |
18 |
19 |
23 |
27 |
28 |
29 |
33 |
34 |
35 |
36 |
41 | {/*
*/}
42 | {/* main-Content */}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | >
51 | );
52 | }
53 |
54 | export default about;
55 |
--------------------------------------------------------------------------------
/pages/user/order-traking.js:
--------------------------------------------------------------------------------
1 | // import SingleOrderHistory from "../../components/OrderHistory/SingleOrderHistory/SingleOrderHistory";
2 | import withAuth from "../../lib/withAuth";
3 | import MainFooter from "../../components/commonComponents/MainFooter";
4 | import UserSidebar from "../../components/commonComponents/UserSidebar";
5 | import MainHeader from "../../components/commonComponents/MainHeader";
6 |
7 |
8 | const orderHistory = [
9 | {
10 | id: 1,
11 | image: [
12 | "https://i.ibb.co/kDYYgSr/tv.png",
13 | "https://i.ibb.co/kDYYgSr/tv.png",
14 | ],
15 | orderNumber: "23E34R13",
16 | date: "01 March 2021",
17 | quantity: 3,
18 | total: 120,
19 | status: false,
20 | },
21 | {
22 | id: 2,
23 | image: [
24 | "https://i.ibb.co/fDCywKw/iphone-12.png",
25 | "https://i.ibb.co/fDCywKw/iphone-12.png",
26 | ],
27 | orderNumber: "23E34R13",
28 | date: "01 March 2021",
29 | quantity: 3,
30 | total: 120,
31 | status: false,
32 | },
33 | {
34 | id: 3,
35 | image: [
36 | "https://i.ibb.co/dMJPPb8/headphone-1-1.png",
37 | "https://i.ibb.co/dMJPPb8/headphone-1-1.png",
38 | ],
39 | orderNumber: "23E34R13",
40 | date: "01 March 2021",
41 | quantity: 3,
42 | total: 120,
43 | status: false,
44 | },
45 | ];
46 |
47 | function OrderTrack() {
48 | return (
49 | <>
50 |
51 |
52 |
53 |
54 | {/* {orderHistory?.map(
55 | ({ id, image, orderNumber, date, quantity, total, status }) => (
56 |
66 | )
67 | )} */}
68 |
69 |
70 |
71 | >
72 | );
73 | }
74 |
75 | export default withAuth(OrderTrack);
76 |
--------------------------------------------------------------------------------
/components/Admin/Feed/Items/ItemsFeed.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import ItemsBottom from "./ItemsBottom";
3 | import ItemsTop from "./ItemsTop";
4 |
5 | function ItemsFeed({ products }) {
6 | const [filterShow, setFilterShow] = useState(false);
7 |
8 | return (
9 |
10 |
11 | {/* TODO: filter content */}
12 | {filterShow && (
13 |
14 | {/* content wrapper */}
15 |
16 | {/* FIXME: single content */}
17 |
18 | Name
19 |
20 |
21 |
22 | Category
23 |
28 | Select
29 | Bedroom
30 | Sofa
31 | Office
32 | Outdoor
33 | Mattress
34 | Dinings
35 |
36 |
37 |
38 | {/* Price */}
39 |
40 | Price
41 |
46 |
47 |
48 |
49 | )}
50 |
51 |
52 | );
53 | }
54 |
55 | export default ItemsFeed;
56 |
--------------------------------------------------------------------------------
/components/Admin/SidedeBar/AdminSidebar.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import {
3 | HomeIcon,
4 | ShoppingCartIcon,
5 | TableIcon,
6 | UserIcon,
7 | XIcon,
8 | } from "@heroicons/react/outline";
9 | import SidebarItem from "./SidebarItem";
10 |
11 | function AdminSidebar({ showSidebar, setShowSidebar }) {
12 | const [sidebars, setSidebars] = useState([
13 | {
14 | id: 1,
15 | Icon: TableIcon,
16 | active: true,
17 | route: "/admin",
18 | text: "Dshborard",
19 | },
20 | {
21 | id: 2,
22 | Icon: UserIcon,
23 | active: false,
24 | route: "/admin/customers",
25 | text: "Customers",
26 | },
27 | {
28 | id: 3,
29 | Icon: ShoppingCartIcon,
30 | active: false,
31 | route: "/admin/items",
32 | text: "Items",
33 | },
34 | {
35 | id: 4,
36 | Icon: HomeIcon,
37 | active: false,
38 | route: "/",
39 | text: "Home",
40 | },
41 | ]);
42 |
43 | const selectSingleItem = (id) => {
44 | const findIndex = sidebars.findIndex((item) => item.id === id);
45 | let newSidebars = [...sidebars];
46 | newSidebars.map((item) => {
47 | return (item.active = false);
48 | });
49 | if (findIndex >= 0) {
50 | newSidebars[findIndex].active = true;
51 | setSidebars(newSidebars);
52 | }
53 | };
54 |
55 | return (
56 |
61 | {/* Sidebar Wrapper */}
62 |
63 |
64 | {sidebars?.map((item) => (
65 |
70 | ))}
71 |
72 | {/* colseicon */}
73 |
setShowSidebar(false)}
75 | className="absolute top-4 right-5 cursor-pointer text-white transform hover:scale-125 transition-all ease-in"
76 | >
77 |
78 |
79 |
80 |
81 | );
82 | }
83 |
84 | export default AdminSidebar;
85 |
--------------------------------------------------------------------------------
/pages/user/order-cancel.js:
--------------------------------------------------------------------------------
1 | // import SingleOrderHistory from "../../components/OrderHistory/SingleOrderHistory/SingleOrderHistory";
2 | import withAuth from "../../lib/withAuth";
3 | import MainFooter from "../../components/commonComponents/MainFooter";
4 | import UserSidebar from "../../components/commonComponents/UserSidebar";
5 | import MainHeader from "../../components/commonComponents/MainHeader";
6 |
7 |
8 | const orderHistory = [
9 | {
10 | id: 1,
11 | image: [
12 | "https://i.ibb.co/kDYYgSr/tv.png",
13 | "https://i.ibb.co/kDYYgSr/tv.png",
14 | ],
15 | orderNumber: "23E34R13",
16 | date: "01 March 2021",
17 | quantity: 3,
18 | total: 120,
19 | status: false,
20 | },
21 | {
22 | id: 2,
23 | image: [
24 | "https://i.ibb.co/fDCywKw/iphone-12.png",
25 | "https://i.ibb.co/fDCywKw/iphone-12.png",
26 | ],
27 | orderNumber: "23E34R13",
28 | date: "01 March 2021",
29 | quantity: 3,
30 | total: 120,
31 | status: false,
32 | },
33 | {
34 | id: 3,
35 | image: [
36 | "https://i.ibb.co/dMJPPb8/headphone-1-1.png",
37 | "https://i.ibb.co/dMJPPb8/headphone-1-1.png",
38 | ],
39 | orderNumber: "23E34R13",
40 | date: "01 March 2021",
41 | quantity: 3,
42 | total: 120,
43 | status: false,
44 | },
45 | ];
46 |
47 | function OrderCancel() {
48 | return (
49 | <>
50 |
51 |
52 |
53 |
54 | {/* {orderHistory?.map(
55 | ({ id, image, orderNumber, date, quantity, total, status }) => (
56 |
66 | )
67 | )} */}
68 |
69 |
70 |
71 | >
72 | );
73 | }
74 |
75 | export default withAuth(OrderCancel);
76 |
--------------------------------------------------------------------------------
/permissions.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "service_account",
3 | "project_id": "toto-shopbd",
4 | "private_key_id": "ddd0084a6dabd68332f2f72b36910296913ed1ea",
5 | "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC35T/XbVOr4R56\n+wsIfpvkK6PHqlkHBm93sM6XucJwH1GJhX5KJNCkf1hdbtJ7m1zRSBdN16opfjBQ\nQqBU5qyetTm52PWgMY7ClJUKIfAjDsOCEUyTBEMrYww4x3Qh8YD7lDU5GhpFYv7n\nMgkTHhDvAXo5+vbuThk5jTPStB1Xa/e6n2s/WBHebo6C3NX2SI3XmVKtigEkxcQQ\nQqjxrS7dT2rn3D6lo4hL0sQxguWvyXNMeMwC5o0ZF4m/g6k3JpLrr4rlGNDodNNR\nctQ3wHpIu4u0ZY/1/j8C6r8pmLR5a2VerFg95YvmnvCWSwj+HWdZLQgFD3yKgAKU\nKawJxrqVAgMBAAECggEACu24F06jOhP5GoBoVbMmgw8X3uIQA+OdRLzwbiJnPIAT\n+asCCBh7gMcjonvXTOq8/5/76I+gSHJ8Hwzyl9EUoaLuAQ40fLZtQEGRwOYm7gJu\n2oA6L4OBlWa/v3EVBP5j9q+GYTQcqxJ4yRcXZHg1M+r/z0nLmnpwM9QhKAy1sK/7\nXffdBxqCEZMsqOkoZO/oiNPS/suMdWG3wqzy89YuV077t5rsKCav7xrzrSeyiQx0\nST8rcbCCScfFy2juNBz/JfeXPG/y2naZPUEJZri4p3HNKbPrbouIdZgM9CM7JGR3\nE4YWcEwKz1BiCuaBPVvMnrGeAeBcsqRHx7gKD02I0QKBgQDf25ODWWtDs12pty1/\nSsQ/AP1b7mjThPJPEim7dIfeUGCALrXsRnvAueu59mi0om3a51e8WTG5XQvqQVnO\n49GwDGc4SAQvgwu2xm8XxwMVSjk53Wz0u/PRZhoC7SYdobek9Ln2c87hBSwyQCG2\nrV2CW+CG65mlBwalu36kHy/q8QKBgQDSTMRLN7TkHc42T6Ho4QibXWWZzBeEB8QA\nUDI5olcCyw8n0CEg2yoTEuur+/HOA7Zxv9KEr+eJ81pQECqzKg6FoyQG01xru9kZ\n7GyMSwDGgmooMya9V7hMgmhrYF+CYEwlxPziftAmLqa6gXDw6cxV0ImzoSJ1hu0i\nSArMA6ih5QKBgQCRmz1D/nGqw4x0y9UoKvWjFX22wkgk7SC/Fc1XRODrVdSvC7MB\nUIdGQKh3eTN56v0RmdCTjmCtdTw+zusfi0fk/uxUy2MNlGuWI1Q3Xxc+Td0TKleo\niGh7F7JrnN1iAMJ25UfgaktySe8JcHV9YR6loCVXHP//O6azPlWNY0vDwQKBgQCE\ngQQJVJ8wQCtnAwPEJM30foN+xR5n/TCc9eq/b68dPm5dKoFFH3JCNGCzq3ou0R4K\nS8/L9L2RqPhVi+ormystPp57gn8wDlr7P4EhYDyr1w4mKByXnoasBlrelQl4r04r\nWhPwbfCerjQ1PUu5L8akp1GsEbIRlSMiv3u2EfQVlQKBgFXIOT/UFUM6eNLsICsi\nq11GgSxQw2xqoW/jIR1XOd9S01/kiiNqa5hVmkR0fRo9HbP4NEK18ZsxYWyhbyK8\nOIAepwwOKLFEkh2n7MQu1T/GelufzEW+QpOVKyn50mm9420a+snV5mAsLZS2QJnV\ndXEjuAxRP5Mw/Lz0jWqNczig\n-----END PRIVATE KEY-----\n",
6 | "client_email": "firebase-adminsdk-38atr@toto-shopbd.iam.gserviceaccount.com",
7 | "client_id": "112997756964080878347",
8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9 | "token_uri": "https://oauth2.googleapis.com/token",
10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-38atr%40toto-shopbd.iam.gserviceaccount.com"
12 | }
13 |
--------------------------------------------------------------------------------
/styles/custom.css:
--------------------------------------------------------------------------------
1 | #scrollBarHide::-webkit-scrollbar {
2 | width: 0;
3 | }
4 | .slick-slider::-webkit-scrollbar {
5 | width: 0;
6 | }
7 | /* .custom_modal {
8 | display: flex;
9 | align-items: center;
10 | justify-content: center;
11 | height: 100%;
12 | width: 100%;
13 | z-index: 70;
14 |
15 | } */
16 |
17 | .animation {
18 | animation: fadeIn 3s;
19 | }
20 |
21 | @keyframes fadeIn {
22 | from {
23 | opacity: 0;
24 | }
25 | to {
26 | opacity: 1;
27 | }
28 | }
29 |
30 | /* animatin for the sidebar */
31 | .animationSidebar {
32 | animation: tranfromSidebar 0.7s;
33 | }
34 |
35 | @keyframes tranfromSidebar {
36 | from {
37 | opacity: 0;
38 | transform: translateY(300px);
39 | }
40 | to {
41 | opacity: 1;
42 | transform: translateY(0px);
43 | }
44 | }
45 |
46 | .animateHomeSidebar {
47 | animation: tranLateSidebar 0.3s;
48 | }
49 |
50 | @keyframes tranLateSidebar {
51 | from {
52 | opacity: 0;
53 | transform: translateX(-300px);
54 | }
55 | to {
56 | opacity: 1;
57 | transform: translateX(0px);
58 | }
59 | }
60 |
61 | .animationFadein {
62 | animation: FadeinDropDown 0.3s;
63 | }
64 |
65 | @keyframes FadeinDropDown {
66 | from {
67 | opacity: 0;
68 | transform: translateY(300px);
69 | }
70 | to {
71 | opacity: 1;
72 | transform: translateY(0px);
73 | }
74 | }
75 |
76 | .borderRight::after {
77 | content: "";
78 | position: absolute;
79 | top: 0;
80 | left: 0;
81 | background: #8984e4;
82 | width: 5px;
83 | height: 100%;
84 | }
85 |
86 | .CustomCallsMenu {
87 | position: fixed;
88 | z-index: 80;
89 | width: 100%;
90 | height: 100%;
91 | background: rgb(0 0 0 / 98%);
92 | color: white !important;
93 | display: block !important;
94 | animation: fadeInfromRight 0.7s;
95 | transition: all ease-in-out;
96 | top: 0;
97 | }
98 |
99 | @keyframes fadeInfromRight {
100 | from {
101 | opacity: 0;
102 | transform: translateX(-300px);
103 | }
104 | to {
105 | opacity: 1;
106 | transform: translateX(0px);
107 | }
108 | }
109 |
110 | .fadeAtTop {
111 | animation: fadeTop 0.5s;
112 | }
113 |
114 | @keyframes fadeTop {
115 | from {
116 | opacity: 0;
117 | transform: translateY(-300px);
118 | }
119 | to {
120 | opacity: 1;
121 | transform: translateY(0px);
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/pages/shop.js:
--------------------------------------------------------------------------------
1 | import ShopSidebar from "../components/ShopGridPage/ShopSidebar/ShopSidebar";
2 | import ShopContent from "../components/ShopGridPage/ShopContent/ShopContent";
3 | import querySearch from "../lib/querySearch";
4 | import spliceData from "../lib/spliceData";
5 | import Head from "next/head";
6 | import MainHeader from "../components/commonComponents/MainHeader";
7 | import MainFooter from "../components/commonComponents/MainFooter";
8 |
9 | const itemsPerPage = 20; // Number of Card per page (for pagination)
10 |
11 | function ShopGrid({ keyword, totalItems, sortby, currentItems, category }) {
12 | return (
13 | <>
14 |
15 |
16 | {keyword} - Buy {keyword} at Best Price in Bangladesh |
17 | www.totoshop.tech
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | >
35 | );
36 | }
37 |
38 | export default ShopGrid;
39 |
40 | export async function getServerSideProps(context) {
41 | const keyword = context.query.keyword ? context.query.keyword : "";
42 | const category = context.query.category ? context.query.category : "";
43 | const minprice = context.query.minprice ? context.query.minprice : "";
44 | const maxprice = context.query.maxprice ? context.query.maxprice : "";
45 | const sortby = context.query.sort ? context.query.sort : "Latest";
46 | const data = await querySearch(keyword, category, minprice, maxprice, sortby);
47 |
48 | const dataConvert = JSON.parse(JSON.stringify(data));
49 | // Paginate session
50 | const page = context.query.page ? context.query.page : "1";
51 | const currentItems = spliceData(dataConvert, page, itemsPerPage);
52 | const totalItems = dataConvert.length;
53 |
54 | return {
55 | props: {
56 | keyword,
57 | category,
58 | currentItems,
59 | sortby,
60 | totalItems,
61 | },
62 | };
63 | }
64 |
--------------------------------------------------------------------------------
/pages/user/my-reviews.js:
--------------------------------------------------------------------------------
1 | import SingleReviews from "../../components/MyReviews/SingleRevies/SingleReviews";
2 | import withAuth from "../../lib/withAuth";
3 | import MainFooter from "../../components/commonComponents/MainFooter";
4 | import UserSidebar from "../../components/commonComponents/UserSidebar";
5 | import MainHeader from "../../components/commonComponents/MainHeader";
6 |
7 |
8 | const orderHistory = [
9 | {
10 | id: 1,
11 | image: "https://i.ibb.co/GcHqRGD/x-box.png",
12 | titile: "Xbox One Wireless Controll",
13 | orderNumber: "23E34R13",
14 | date: "01 March 2021",
15 | ratting: [],
16 | quantity: 3,
17 | total: 120,
18 | status: false,
19 | },
20 | {
21 | id: 2,
22 | image: "https://i.ibb.co/sWxtXxc/bag-2.png",
23 | titile: "Herschel Leather Duffle Bag",
24 | orderNumber: "23E34R13",
25 | date: "01 March 2021",
26 | ratting: [1, 2, 3, 4, 5],
27 | quantity: 3,
28 | total: 120,
29 | status: true,
30 | },
31 | {
32 | id: 3,
33 | image: "https://i.ibb.co/dMJPPb8/headphone-1-1.png",
34 | titile: "Sound Intone I65 Earphone",
35 | ratting: [1, 2, 3, 4, 5],
36 | orderNumber: "23E34R13",
37 | date: "01 March 2021",
38 | quantity: 3,
39 | total: 120,
40 | status: false,
41 | },
42 | ];
43 |
44 | function OrderHistory() {
45 | return (
46 | <>
47 |
48 |
49 |
50 |
51 | {orderHistory?.map(
52 | ({
53 | id,
54 | image,
55 | orderNumber,
56 | date,
57 | ratting,
58 | total,
59 | status,
60 | titile,
61 | quantity,
62 | }) => (
63 |
75 | )
76 | )}
77 |
78 |
79 |
80 | >
81 | );
82 | }
83 |
84 | export default withAuth(OrderHistory);
85 |
--------------------------------------------------------------------------------
/components/AboutPage/ourVision/OurVision.js:
--------------------------------------------------------------------------------
1 | import Image from "next/image";
2 | import { LinkIcon } from "@heroicons/react/solid";
3 | import VisionSingleLi from "./VIsitionSingleLi/VisionSingleLi";
4 |
5 | function OurVision() {
6 | return (
7 |
8 | {/* vision section left image */}
9 |
10 | {/* */}
11 |
17 |
18 |
19 | {/* vision section right */}
20 |
21 |
our VIsion
22 |
26 | our vision is simple - we exist to accelerate customers' progress
27 |
28 |
32 | We design and delever our customers' degital transformation by
33 | bringing together their vision with our industry knowledge and deep
34 | technologcal expertise. We design and delever our customers' degital
35 | transformmation
36 |
37 | {/* ul li */}
38 |
39 |
43 |
47 |
51 |
55 |
59 |
60 |
61 |
62 | );
63 | }
64 |
65 | export default OurVision;
66 |
--------------------------------------------------------------------------------
/pages/api/webhook.js:
--------------------------------------------------------------------------------
1 | import { buffer } from "micro";
2 | import * as admin from "firebase-admin";
3 |
4 | //Secure connection to FIREBASE from the backend
5 | const serviceAccount = require("../../permissions.json");
6 | const app = !admin.apps.length
7 | ? admin.initializeApp({
8 | credential: admin.credential.cert(serviceAccount),
9 | })
10 | : admin.app();
11 |
12 | //Establish connection to stripe
13 | const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY);
14 |
15 | // dbConnect
16 | import dbConnect from "./../../lib/dbConnect";
17 | // Model
18 | import Order from "../../models/order";
19 |
20 | const endpointSecret = process.env.STRIPE_SIGNING_SECRET;
21 |
22 | const fulfillOrder = async (session) => {
23 | console.log("Fulfilling order ", session);
24 | await dbConnect();
25 | await Order.create({
26 | id: session.id,
27 | amount: session.amount_total / 100,
28 | amount_shipping: session.total_details.amount_shipping / 100,
29 | images: JSON.parse(session.metadata.images),
30 | email: session.metadata.email,
31 | });
32 |
33 | return app
34 | .firestore()
35 | .collection("users")
36 | .doc(session.metadata.email)
37 | .collection("orders")
38 | .doc(session.id)
39 | .set({
40 | amount: session.amount_total / 100,
41 | amount_shipping: session.total_details.amount_shipping / 100,
42 | images: JSON.parse(session.metadata.images),
43 | timestamp: admin.firestore.FieldValue.serverTimestamp(),
44 | })
45 | .then(() => {
46 | console.log(`Success: order ${session.id} had been added to the DB`);
47 | });
48 | };
49 |
50 | export default async (req, res) => {
51 | if (req.method === "POST") {
52 | const requestBuffer = await buffer(req);
53 | const payload = requestBuffer.toString();
54 | const sig = req.headers["stripe-signature"];
55 | let event;
56 |
57 | try {
58 | event = stripe.webhooks.constructEvent(payload, sig, endpointSecret);
59 | } catch (err) {
60 | console.log(`ERROR: ${err.message}`);
61 | return res.status(400).send(`Webhook error: ${err.message}`);
62 | }
63 | //Handle checkout
64 | if (event.type === "checkout.session.completed") {
65 | const session = event.data.object;
66 |
67 | return fulfillOrder(session)
68 | .then(() => res.status(200))
69 | .catch((err) => res.status(400).send(`Webhook Error: ${err.message}`));
70 | }
71 | }
72 | };
73 |
74 | export const config = {
75 | api: {
76 | bodyParser: false,
77 | extraResolver: true,
78 | },
79 | };
80 |
--------------------------------------------------------------------------------
/components/Admin/Feed/DashBorard/SingleListItem.js:
--------------------------------------------------------------------------------
1 | import {
2 | ChatIcon,
3 | DocumentIcon,
4 | DotsHorizontalIcon,
5 | ExclamationIcon,
6 | EyeIcon,
7 | PencilIcon,
8 | TrashIcon,
9 | } from "@heroicons/react/outline";
10 | import React, { useState } from "react";
11 |
12 | function SingleListItem({ item }) {
13 | const [dropdown, setDropdown] = useState(false);
14 |
15 | return (
16 |
17 |
{item?.date}
18 |
19 | {/* customer */}
20 |
21 |
22 | {item?.name}
23 |
24 |
25 | {/* amount due */}
26 |
27 |
28 | $ {item?.amount}
29 |
30 |
31 |
32 |
setDropdown(!dropdown)}
34 | className="h-5 cursor-pointer"
35 | />
36 |
37 | {dropdown && (
38 |
39 | {/* view */}
40 |
44 | {/* send invoice */}
45 |
46 |
47 |
Send Invoice
48 |
49 | {/* chat */}
50 |
51 |
52 |
Mark as sent
53 |
54 | {/* clone invoice */}
55 |
56 |
57 |
Clone Invoice
58 |
59 | {/* delete */}
60 |
64 |
65 | )}
66 |
67 |
68 | );
69 | }
70 |
71 | export default SingleListItem;
72 |
--------------------------------------------------------------------------------
/components/ShopGridPage/ShopContent/ShopList/ShopList.js:
--------------------------------------------------------------------------------
1 | import SingleShopItem from "./SingleShopItem";
2 |
3 | const products = [
4 | {
5 | id: 1,
6 | title: "Guyer chair",
7 | price: 45.0,
8 | rating: 150,
9 | image: "https://i.ibb.co/2jHpJws/product1.jpg",
10 | hot: true,
11 | details:
12 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
13 | },
14 | {
15 | id: 2,
16 | title: "Guyer chair",
17 | price: 45.0,
18 | rating: 150,
19 | image: "https://i.ibb.co/mCdRt0s/product2.jpg",
20 | details:
21 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
22 | },
23 | {
24 | id: 3,
25 | title: "Guyer chair",
26 | price: 45.0,
27 | rating: 150,
28 | image: "https://i.ibb.co/M8LrQyQ/product3.jpg",
29 | details:
30 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
31 | },
32 | {
33 | id: 4,
34 | title: "Guyer chair",
35 | price: 45.0,
36 | rating: 150,
37 | image: "https://i.ibb.co/9rn0tSy/product4.jpg",
38 | details:
39 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
40 | },
41 | {
42 | id: 5,
43 | title: "Guyer chair",
44 | price: 45.0,
45 | rating: 150,
46 | image: "https://i.ibb.co/tsZybpt/product5.jpg",
47 | details:
48 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
49 | },
50 | {
51 | id: 6,
52 | title: "Guyer chair",
53 | price: 45.0,
54 | rating: 150,
55 | image: "https://i.ibb.co/2nfH6ZX/product6.jpg",
56 | details:
57 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
58 | },
59 | {
60 | id: 7,
61 | title: "Guyer chair",
62 | price: 45.0,
63 | rating: 150,
64 | image: "https://i.ibb.co/xg8fwz4/product7.jpg",
65 | details:
66 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
67 | },
68 | {
69 | id: 8,
70 | title: "Guyer chair",
71 | price: 45.0,
72 | rating: 150,
73 | image: "https://i.ibb.co/N2C78ws/product11.jpg",
74 | details:
75 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit massa enim.",
76 | },
77 | ];
78 |
79 | function ShopMain({ currentItems }) {
80 | return (
81 |
82 | {currentItems.map((product) => (
83 |
88 | ))}
89 |
90 | );
91 | }
92 |
93 | export default ShopMain;
94 |
--------------------------------------------------------------------------------
/components/OrderDetails/OrderDetailsTop/OrderDetailsTop.js:
--------------------------------------------------------------------------------
1 | import OrderSingleRetunCard from "./OrderSingleRetunCard";
2 | import OrderStepProgress from "./OrderStepProgress";
3 |
4 | const orderReturn = [
5 | {
6 | id: 1,
7 | title: "Sound Intone 165 EarPhone",
8 | image: "https://i.ibb.co/D5kM6Hb/headphone-3.png",
9 | price: "50",
10 | quantity: 1,
11 | returnOrder: true,
12 | date: "24 Sep 2021",
13 | available: false,
14 | },
15 | ];
16 |
17 | function OrderDetailsTop() {
18 | return (
19 |
20 |
Order Details
21 | {/* details top */}
22 |
23 |
24 |
Sold By
25 | Rafcart
26 |
27 | {/* another one */}
28 |
29 |
Order Number
30 | 789ER4S324
31 |
32 | {/* another one */}
33 |
34 |
Shipped Date
35 | 01 March 2021
36 |
37 |
Write A Review
38 |
39 | {/* step progress bar */}
40 |
41 |
42 |
43 |
44 | {/* thank oyour cart */}
45 |
46 |
23 Jul 2021.18.56
47 |
48 | Your package has been delivered. Thank you for shopping at RAFCART!
49 |
50 |
51 | {/* order Single card */}
52 |
53 | {orderReturn?.map(
54 | ({
55 | id,
56 | title,
57 | image,
58 | available,
59 | price,
60 | quantity,
61 | returnOrder,
62 | date,
63 | }) => (
64 |
75 | )
76 | )}
77 |
78 |
79 | );
80 | }
81 |
82 | export default OrderDetailsTop;
83 |
--------------------------------------------------------------------------------
/pages/index.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import Banner from "../components/Home/Banner";
3 | import Features from "../components/Home/Features";
4 | import { Categories } from "../components/Home/Categories/Categories";
5 | import { TopNewArrival } from "../components/Home/TopNewArrival/TopNewArrival";
6 | import { MiddleAds } from "../components/Home/MiddleAds";
7 | import { RecomendedProduct } from "../components/Home/RecomendedProduct/RecomendedProduct";
8 | import { useEffect, useState } from "react";
9 | import Modal from "../components/Home/Modal/Modal";
10 | import MainHeader from "../components/commonComponents/MainHeader";
11 | import MainFooter from "../components/commonComponents/MainFooter";
12 |
13 | export default function Home({ products }) {
14 | const [showModal, setShowModal] = useState();
15 |
16 | useEffect(() => {
17 | setTimeout(() => {
18 | const modalData = window.sessionStorage.getItem("showModal");
19 | setShowModal(modalData);
20 | }, 5000);
21 | }, []);
22 |
23 | return (
24 | <>
25 |
26 |
ToTo SHOP - Online Shopping Website
27 |
28 |
29 |
33 |
37 |
41 |
42 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | {/* Modal Show */}
58 |
59 | {showModal &&
}
60 |
61 | {/* {!showModal &&
} */}
62 |
63 | >
64 | );
65 | }
66 |
67 | export async function getServerSideProps() {
68 | const res = await fetch(`${process.env.HOST}/api/product`);
69 | const data = await res.json();
70 |
71 | return {
72 | props: {
73 | products: data.data,
74 | },
75 | };
76 | }
77 |
--------------------------------------------------------------------------------
/components/Home/Modal/Modal.js:
--------------------------------------------------------------------------------
1 | import { XIcon } from "@heroicons/react/outline";
2 | import Image from "next/image";
3 |
4 | function Modal({ setShowModal }) {
5 | const dontShow = () => {
6 | window.sessionStorage.setItem("showModal", false);
7 | };
8 | return (
9 |
13 |
14 | {/* Icon */}
15 |
setShowModal(false)}
17 | className="h-4 md:h-6 absolute top-3 right-3 transform hover:scale-125 hover:text-primary transition-all ease-in cursor-pointer"
18 | />
19 |
20 |
21 |
27 |
28 |
29 |
30 |
31 | GET 30% OFF
32 |
33 |
34 | Subscribe to the newsiettier to recive updates about new products
35 |
36 |
37 | {/* searchbar */}
38 |
39 |
44 |
48 | Subscribe
49 |
50 |
51 |
52 | {/* check button */}
53 |
54 |
59 |
60 | Do not show this again
61 |
62 |
63 |
64 |
65 | {/* backgroundimage */}
66 |
67 |
68 | );
69 | }
70 |
71 | export default Modal;
72 |
--------------------------------------------------------------------------------
/components/ContactPage/ContactInfo/ContactInfo.js:
--------------------------------------------------------------------------------
1 | import {
2 | LocationMarkerIcon,
3 | PhoneIcon,
4 | MailIcon,
5 | } from "@heroicons/react/solid";
6 |
7 | function ContactInfo() {
8 | return (
9 |
10 | {/* div top */}
11 |
12 |
26 | {/* div middle */}
27 |
28 |
29 | HOURS OF OPERATION
30 |
31 |
32 |
33 | Staurday 12.00 PM
34 |
35 |
36 | Sunday 12.00 PM
37 |
38 |
39 | Monday 12.00 PM
40 |
41 |
42 | Tuesday 12.00 PM
43 |
44 |
45 | Wednesday 12.00 PM
46 |
47 |
48 | Thursday 12.00 PM
49 |
50 |
51 | Friday 12.00 PM
52 |
53 |
54 |
55 |
56 | {/* div bottom */}
57 |
58 |
62 | CAREERS
63 |
64 |
65 | If you are interesting in emplyment opportunities at ToToShop. Please
66 | email us :{" "}
67 |
68 | info@totoshop.tech
69 |
70 |
71 |
72 |
73 | );
74 | }
75 |
76 | export default ContactInfo;
77 |
--------------------------------------------------------------------------------
/components/ContactPage/ContactForm/ContactForm.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 |
3 | function ContactForm() {
4 | const [lname, setLName] = useState("");
5 | const [email, setEmail] = useState("");
6 | const [subject, setSubject] = useState("");
7 | const [message, setMessage] = useState("");
8 |
9 | const submitHandler = (e) => {
10 | e.preventDefault();
11 | alert("yo");
12 | };
13 |
14 | return (
15 |
16 |
17 | Leave us a message
18 |
19 |
20 | Use the form below to get in touch with the sales team
21 |
22 |
82 |
83 | );
84 | }
85 |
86 | export default ContactForm;
87 |
--------------------------------------------------------------------------------
/components/BlogPage/BlogPost/BlogPost.js:
--------------------------------------------------------------------------------
1 | import { HeartIcon as HeartIconFilled } from "@heroicons/react/solid";
2 | import { ChatIcon, HeartIcon, ShareIcon } from "@heroicons/react/outline";
3 | import { useSession } from "next-auth/react";
4 | import Image from "next/image";
5 | import { useState } from "react";
6 | import Link from "next/link";
7 | import moment from 'moment';
8 |
9 | function BlogPost({ post }) {
10 | const { data: session } = useSession();
11 |
12 | const [comment, setComment] = useState("");
13 | const [comments, setComments] = useState([]);
14 | const [likes, setLikes] = useState([]);
15 | const [hasLiked, setHasLiked] = useState(false);
16 |
17 | return (
18 | <>
19 |
20 | {/* post caption */}
21 |
22 |
{post.title}
23 |
24 | {/* post image */}
25 |
26 |
27 |
33 |
34 |
35 | {/* fotter */}
36 |
37 | {/* fotter left */}
38 |
39 |
40 |
45 |
46 |
{post.userName}
47 |
about 6 hour ago
48 |
49 |
50 | {/* right */}
51 |
52 | {/* like */}
53 |
54 |
55 | {/* {post.like.length} */}
56 |
57 | {/* comment */}
58 |
59 |
60 | {/* {post.comment.length} */}
61 |
62 |
63 | {/* shere */}
64 |
65 |
66 | 0
67 |
68 |
69 |
70 |
71 |
72 | >
73 | );
74 | }
75 |
76 | export default BlogPost;
77 |
--------------------------------------------------------------------------------
/components/AboutPage/ourTeam/OurTeam.js:
--------------------------------------------------------------------------------
1 | import SingleTeam from "./SingleTeam/SingleTeam";
2 | import Slider from "react-slick";
3 | import "slick-carousel/slick/slick.css";
4 | import "slick-carousel/slick/slick-theme.css";
5 |
6 | function OurTeam() {
7 | // const data=[
8 | // {id:1,image:'/img/team-1.jpg',name:'Jane Cooper',status:'Founder',fbLink:'#',insLink:'#',twiLink:'#'},
9 | // {id:2,image:'/img/team-2.jpg',name:'Esther Howard',status:'Team Leader',fbLink:'#',insLink:'#',twiLink:'#'},
10 | // {id:3,image:'/img/team-3.jpg',name:'Kristin Wastson',status:'Senior Officer',fbLink:'#',insLink:'#',twiLink:'#'},
11 | // {id:4,image:'/img/team-4.jpg',name:'Ariene McCoy',status:'Marketing Officer',fbLink:'#',insLink:'#',twiLink:'#'},
12 | // ]
13 |
14 | const data = [
15 | {
16 | id: 1,
17 | image: "https://i.ibb.co/827zNs3/team-1.jpg",
18 | name: "Jane Cooper",
19 | status: "Founder",
20 | fbLink: "#",
21 | insLink: "#",
22 | twiLink: "#",
23 | },
24 | {
25 | id: 2,
26 | image: "https://i.ibb.co/tYQgkjT/team-2.jpg",
27 | name: "Esther Howard",
28 | status: "Team Leader",
29 | fbLink: "#",
30 | insLink: "#",
31 | twiLink: "#",
32 | },
33 | {
34 | id: 3,
35 | image: "https://i.ibb.co/W24xZvB/team-3.jpg",
36 | name: "Kristin Wastson",
37 | status: "Senior Officer",
38 | fbLink: "#",
39 | insLink: "#",
40 | twiLink: "#",
41 | },
42 | {
43 | id: 4,
44 | image: "https://i.ibb.co/Bzy1w0F/team-4.jpg",
45 | name: "Ariene McCoy",
46 | status: "Marketing Officer",
47 | fbLink: "#",
48 | insLink: "#",
49 | twiLink: "#",
50 | },
51 | ];
52 |
53 | const settings = {
54 | dots: false,
55 | infinite: false,
56 | speed: 600,
57 | slidesToShow: 4,
58 | slidesToScroll: 4,
59 | autoplay: true,
60 | responsive: [
61 | {
62 | breakpoint: 900,
63 | settings: {
64 | slidesToShow: 2,
65 | slidesToScroll: 2,
66 | },
67 | },
68 | ],
69 | };
70 |
71 | return (
72 |
73 |
74 | Meet with our team
75 |
76 |
77 |
82 | {data?.map(({ id, image, name, status, fbLink, insLink, twiLink }) => (
83 |
93 | ))}
94 |
95 |
96 | );
97 | }
98 |
99 | export default OurTeam;
100 |
--------------------------------------------------------------------------------
/components/Admin/Feed/Customer/CustomerListItem.js:
--------------------------------------------------------------------------------
1 | import { DotsHorizontalIcon } from "@heroicons/react/outline";
2 | import React, { useState } from "react";
3 | import CustomerSingleList from "./CustomerSingleList";
4 |
5 | function CustomerListItem() {
6 | const [customerList, setCustomerList] = useState([
7 | {
8 | id: 1,
9 | name: "Faysal",
10 | phone: "01646177169",
11 | amount: "135.00",
12 | date: "2022/03/07",
13 | check: false,
14 | },
15 | {
16 | id: 2,
17 | name: "Faysal",
18 | phone: "01646177169",
19 | amount: "135.00",
20 | date: "2022/03/07",
21 | check: true,
22 | },
23 | {
24 | id: 90,
25 | name: "Faysal",
26 | phone: "01646177169",
27 | amount: "135.00",
28 | date: "2022/03/07",
29 | check: false,
30 | },
31 | ]);
32 | const [allCheck, setAllCheck] = useState(false);
33 |
34 | const setChecked = (id) => {
35 | const findIndex = customerList.findIndex((item) => item.id === id);
36 |
37 | let NewCustomerList = [...customerList];
38 |
39 | if (findIndex >= 0) {
40 | if (NewCustomerList[findIndex].check) {
41 | // alert("already checked");
42 | setAllCheck(false);
43 |
44 | NewCustomerList[findIndex].check = false;
45 | } else {
46 | setAllCheck(false);
47 |
48 | NewCustomerList[findIndex].check = true;
49 | }
50 | }
51 | setCustomerList(NewCustomerList);
52 | };
53 |
54 | const checkAll = () => {
55 | let NewCustomerList = [...customerList];
56 |
57 | if (allCheck) {
58 | setAllCheck(false);
59 | NewCustomerList?.map((item) => (item.check = false));
60 | setCustomerList(NewCustomerList);
61 | } else {
62 | setAllCheck(true);
63 |
64 | NewCustomerList?.map((item) => (item.check = true));
65 | setCustomerList(NewCustomerList);
66 | }
67 | };
68 |
69 | return (
70 |
71 | {/* top Header */}
72 |
73 |
74 |
Name
75 |
76 | phone
77 |
78 |
79 | Amount Due
80 |
81 |
82 | Added on
83 |
84 |
85 |
86 |
87 | {/* all the lisht */}
88 |
89 | {/* there we map */}
90 | {customerList?.map((item) => (
91 |
96 | ))}
97 |
98 |
99 | );
100 | }
101 |
102 | export default CustomerListItem;
103 |
--------------------------------------------------------------------------------
/components/CheckoutPage/CheckOrder/CheckoutOrder.js:
--------------------------------------------------------------------------------
1 | import { useRouter } from "next/router";
2 | import SingleCheckoutOrder from "../SingleChekoutOrder/SingleCheckoutOrder";
3 |
4 | const product = [
5 | {
6 | id: 1,
7 | title: "Beigh Knitted Shoes",
8 | size: "M",
9 | quantity: "1",
10 | price: "84.00",
11 | },
12 | {
13 | id: 2,
14 | title: "Beigh Knitted Shoes",
15 | size: "L",
16 | quantity: "2",
17 | price: "84.00",
18 | },
19 | {
20 | id: 3,
21 | title: "Beigh Knitted Shoes",
22 | size: "Red",
23 | quantity: "1",
24 | price: "84.00",
25 | },
26 | ];
27 |
28 | function CheckoutOrder() {
29 | const router = useRouter()
30 | return (
31 |
32 |
33 |
34 | Your Order
35 |
36 |
37 | {/* products */}
38 |
39 |
40 | Product
41 |
42 |
43 | {/* single chekoutorder product */}
44 |
45 | {product?.map(({ id, title, size, quantity, price }) => (
46 |
54 | ))}
55 |
56 | {/* subtotal */}
57 |
58 |
Subtotal
59 | $140.00
60 |
61 | {/* shipping */}
62 |
63 |
Shipping
64 | Free
65 |
66 | {/* Total */}
67 |
68 | Total
69 | $140.00
70 |
71 | {/* agree to our */}
72 |
73 |
78 |
79 | Agree to our{" "}
80 | terms & conditions
81 |
82 |
83 |
84 |
85 | router.push('success')} className="btn py-2 w-full uppercase font-medium">
86 | Place Order
87 |
88 |
89 |
90 |
91 | );
92 | }
93 |
94 | export default CheckoutOrder;
95 |
--------------------------------------------------------------------------------
/components/ShopGridPage/ShopContent/ShopContent.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import ShopMain from "./ShopMain/ShopMain";
3 | import ShopTopNav from "./ShopNavTop/ShopTopNav";
4 | import ShopList from "../ShopContent/ShopList/ShopList";
5 |
6 | function ShopContent({ currentItems }) {
7 | const [listView, setListView] = useState(false);
8 | // const [pagenation,setPagenation] = useState()
9 |
10 | return (
11 |
12 |
13 |
14 | {/* render the view */}
15 |
16 | {listView ? (
17 |
18 | ) : (
19 |
20 | )}
21 |
22 | {/* pagenation */}
23 |
85 |
86 |
87 | );
88 | }
89 |
90 | export default ShopContent;
91 |
--------------------------------------------------------------------------------
/components/CheckoutPage/CheckoutFrom/CheckoutFrom.js:
--------------------------------------------------------------------------------
1 | function CheckoutFrom() {
2 | return (
3 |
74 | );
75 | }
76 |
77 | export default CheckoutFrom;
78 |
--------------------------------------------------------------------------------
/components/ReturnOrderDetails/ReturnOrderMain/ReturnOrdermain.js:
--------------------------------------------------------------------------------
1 | import OrderSingleRetunCard from "../../OrderDetails/OrderDetailsTop/OrderSingleRetunCard";
2 |
3 | function ReturnOrdermain() {
4 | return (
5 |
6 |
Return Request
7 | {/* details top */}
8 |
9 | {/* details single top */}
10 |
11 |
Sold By
12 | RAFCART
13 |
14 | {/* order NUmber */}
15 |
16 |
Order Number
17 | 789ER4S324
18 |
19 |
20 | {/* single card */}
21 |
30 | {/* payment method */}
31 |
32 |
33 |
Payment Method
34 |
35 |
36 | {/* flex col */}
37 |
Refund By Credit Card
38 |
39 |
40 | Money will be return your Credit Card That you used for purchased
41 |
42 |
43 | {/* Select shipment optioni */}
44 |
45 |
46 | Select Shipment Option
47 |
48 |
49 |
50 |
Courier Pick UP
51 |
52 | {/* another one */}
53 |
57 |
58 | {/* input box or textarea */}
59 |
60 |
Additional Information (optional)
61 |
67 |
68 |
69 | {/* check box */}
70 |
71 |
72 |
73 | I have Read and accepted the{" "}
74 | Return Policy of RAFCART
75 |
76 |
77 | {/* button */}
78 |
79 |
80 | Submit
81 |
82 |
83 |
84 | );
85 | }
86 |
87 | export default ReturnOrdermain;
88 |
--------------------------------------------------------------------------------