├── tripBook.com
├── public
│ ├── ind.jpeg
│ ├── applogo.png
│ ├── favicon.ico
│ └── vercel.svg
├── next.config.js
├── components
│ ├── searchBox
│ │ ├── searchBox.module.css
│ │ └── searchBox.js
│ ├── backgroundImg
│ │ ├── bgComponent.module.css
│ │ └── bgComponent.js
│ ├── DatePicker.js
│ ├── Filters.js
│ ├── explore
│ │ ├── slideShow.module.css
│ │ ├── connectTravellers.js
│ │ ├── slideShow.js
│ │ └── nextTrip.js
│ ├── pre_loader
│ │ ├── loadingScreen.js
│ │ └── loadingText.module.css
│ ├── SearchForm.js
│ ├── navbarSection
│ │ ├── navbar.module.css
│ │ ├── draverNav.js
│ │ └── navbar.js
│ ├── SearchCard.js
│ └── Footer.jsx
├── db.connect.js
├── pages
│ ├── api
│ │ ├── user
│ │ │ ├── index.js
│ │ │ ├── signup
│ │ │ │ ├── index.js
│ │ │ │ └── dealer.js
│ │ │ ├── refresh.js
│ │ │ └── signin.js
│ │ └── property
│ │ │ ├── index.js
│ │ │ └── [id].js
│ ├── _app.js
│ ├── flights.js
│ ├── carrental.js
│ ├── addproperty.js
│ ├── listproperty.js
│ ├── signin.js
│ ├── signup.js
│ ├── property
│ │ ├── index.js
│ │ └── [id]
│ │ │ ├── index.js
│ │ │ └── info.js
│ └── index.js
├── models
│ ├── user.model.js
│ └── property.model.js
├── .gitignore
├── middlewares
│ └── tokenVerify.js
├── context
│ ├── AuthContextProvider.js
│ └── GuestContext.js
├── package.json
└── styles
│ └── globals.css
└── README.md
/tripBook.com/public/ind.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityabarshilia/TripBook/HEAD/tripBook.com/public/ind.jpeg
--------------------------------------------------------------------------------
/tripBook.com/public/applogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityabarshilia/TripBook/HEAD/tripBook.com/public/applogo.png
--------------------------------------------------------------------------------
/tripBook.com/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityabarshilia/TripBook/HEAD/tripBook.com/public/favicon.ico
--------------------------------------------------------------------------------
/tripBook.com/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: false,
4 | }
5 |
6 | module.exports = nextConfig
7 |
--------------------------------------------------------------------------------
/tripBook.com/components/searchBox/searchBox.module.css:
--------------------------------------------------------------------------------
1 | .searchformStyles{
2 | display: flex;
3 | justify-content: space-between;
4 | gap: 20px;
5 | border:5px solid red
6 | }
--------------------------------------------------------------------------------
/tripBook.com/db.connect.js:
--------------------------------------------------------------------------------
1 | import mongoose from "mongoose";
2 |
3 | export const connect = async () => {
4 | if(mongoose.connection.readyState[0]) return;
5 | mongoose.connect(process.env.MONGODB_URI);
6 | };
--------------------------------------------------------------------------------
/tripBook.com/components/backgroundImg/bgComponent.module.css:
--------------------------------------------------------------------------------
1 | .bgImg {
2 | background-image: url("https://r-xx.bstatic.com/xdata/images/xphoto/2880x750/183939625.jpeg?k=f06b6ea8458f9377cc1293e39f6b3218d13c4a6576d61d51b989438e667d68fc&o=");
3 | /* width: 100%;
4 | height: 900px; */
5 | background-size: 100% 100%;
6 | }
7 |
8 | .textOnImg {
9 | /* border: 2px solid greenyellow; */
10 | margin-top: 5%;
11 | }
12 |
--------------------------------------------------------------------------------
/tripBook.com/components/DatePicker.js:
--------------------------------------------------------------------------------
1 | import { useContext } from "react";
2 | import { DateRangePicker } from "rsuite";
3 | import "rsuite/dist/rsuite.css";
4 | import { GuestContext } from "../context/GuestContext";
5 |
6 | const Datepicker = () => {
7 | const { date, setDate } = useContext(GuestContext);
8 | console.log(date)
9 | return
10 | }
11 |
12 | export default Datepicker;
--------------------------------------------------------------------------------
/tripBook.com/pages/api/user/index.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../db.connect";
2 | // import { UserModel } from "../../../models/user.model";
3 |
4 | export default async function handler(req, res) {
5 | // const { method } = req;
6 |
7 | try {
8 | await connect();
9 | } catch (e) {
10 | console.log(e);
11 | }
12 |
13 | try {
14 | // const products = await UserModel.find({});
15 | res.status(200).send("awdawdawawd");
16 | } catch (e) {
17 | res.status(400).send(e.message);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tripBook.com/models/user.model.js:
--------------------------------------------------------------------------------
1 | import { model, Schema, models } from "mongoose";
2 |
3 | const UserSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | },
8 | email: {
9 | type: String,
10 | required: true,
11 | unique: true,
12 | },
13 | password: {
14 | type: String,
15 | required: true,
16 | },
17 | role: {
18 | type: String,
19 | enum: ["user", "dealer"],
20 | },
21 | });
22 |
23 | const UserModel = models.user || model("user", UserSchema);
24 | export { UserModel };
--------------------------------------------------------------------------------
/tripBook.com/.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 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 | .pnpm-debug.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/tripBook.com/components/Filters.js:
--------------------------------------------------------------------------------
1 | import { Checkbox, Text } from "@chakra-ui/react";
2 |
3 | const FilterBox = ({type, setFilter}) => {
4 |
5 | return (
6 | setFilter(target.name)} m="5px">
7 |
8 | {
9 | type === "Rating" ? ("> 9 Rating")
10 | : type === "Reviews" ? ("> 50 Reviews")
11 | : type === "Price" ? ("< 6000 Price")
12 | : null
13 | }
14 |
15 |
16 | );
17 | };
18 |
19 | export default FilterBox;
20 |
--------------------------------------------------------------------------------
/tripBook.com/pages/api/property/index.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../db.connect";
2 | import { PropertyModel } from "../../../models/property.model";
3 |
4 | export default async function handler(req, res) {
5 | const { method } = req;
6 |
7 | try {
8 | await connect();
9 | } catch (e) {
10 | console.log(e);
11 | }
12 |
13 | if (method === "POST") {
14 | try {
15 | const properties = await PropertyModel.create(req.body);
16 | res
17 | .status(201)
18 | .send({ message: "property added successfully", properties });
19 | } catch (e) {
20 | res.status(400).send(e.message);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tripBook.com/middlewares/tokenVerify.js:
--------------------------------------------------------------------------------
1 | import jwt from "jsonwebtoken";
2 |
3 | const verify = (req,res,next) => {
4 | const { token } = req.headers;
5 |
6 | if (token) {
7 | jwt.verify(token, process.env.tsec, function(err, verified) {
8 | if (err) {
9 | return res.status(401).json({"error": true, "message": 'Unauthorized access. Login and try again' });
10 | }
11 | req.verified = verified;
12 | next();
13 | });
14 | } else {
15 | return res.status(403).send({
16 | "error": true,
17 | "message": 'Please login'
18 | });
19 | }
20 | }
21 |
22 | export default verify;
--------------------------------------------------------------------------------
/tripBook.com/context/AuthContextProvider.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from "react";
2 | import { createContext, useState } from "react";
3 |
4 | export const AuthContext = createContext();
5 |
6 | function getInitialState() {
7 | const initState = localStorage.getItem("authData")
8 | return initState ? JSON.parse(initState) : ""
9 | }
10 |
11 | const AuthContextProvider = ({ children }) => {
12 | const [auth, setAuth] = useState("");
13 |
14 | useEffect(() => {
15 | setAuth(getInitialState);
16 | },[]);
17 |
18 | useEffect(() => {
19 | localStorage.setItem("authData", JSON.stringify(auth));
20 | }, [auth]);
21 | return (
22 |
23 | {children}
24 |
25 | );
26 | };
27 |
28 | export default AuthContextProvider;
--------------------------------------------------------------------------------
/tripBook.com/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tripbook.com",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@chakra-ui/icons": "^2.0.13",
13 | "@chakra-ui/react": "^2.4.3",
14 | "@emotion/react": "^11.10.5",
15 | "@emotion/styled": "^11.10.5",
16 | "argon2": "^0.30.2",
17 | "axios": "^1.2.1",
18 | "framer-motion": "^7.7.2",
19 | "jsonwebtoken": "^8.5.1",
20 | "mongoose": "^6.8.0",
21 | "next": "13.0.6",
22 | "react": "18.2.0",
23 | "react-dom": "18.2.0",
24 | "react-icons": "^4.7.1",
25 | "react-simple-image-slider": "^2.4.1",
26 | "react-slideshow-image": "^4.1.1",
27 | "rsuite": "^5.23.2"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tripBook.com/components/explore/slideShow.module.css:
--------------------------------------------------------------------------------
1 | /* .mainBox{
2 | border: 5px solid plum;
3 | } */
4 |
5 | /* @media all and (min-width: 401px) and (max-width: 750px){
6 | .Home_carousel_item_Third1{
7 | display: grid;
8 | grid-template-columns: repeat(3,1fr);
9 | gap: 4%;
10 | }
11 | .Home_Featured_Brands_Item1 div:last-child{
12 | position: relative;
13 | font-size: 80%;
14 | }
15 |
16 | .Home_carousel_item_Third1{
17 | margin-bottom: 10%;
18 | }
19 | }
20 |
21 |
22 | @media all and (min-width: 280px) and (max-width: 400px){
23 | .Home_carousel_item_Third1{
24 | display: grid;
25 | grid-template-columns: repeat(2,1fr);
26 | gap: 4%;
27 | padding-bottom: 5%;
28 | margin-bottom: 8%;
29 | }
30 | .Home_Featured_Brands_Item1 div:last-child{
31 | font-size: 50%;
32 | }
33 | } */
--------------------------------------------------------------------------------
/tripBook.com/models/property.model.js:
--------------------------------------------------------------------------------
1 | import { model, Schema, models } from "mongoose";
2 |
3 | const PropertySchema = new Schema({
4 | redirecturl: {
5 | type: String,
6 | },
7 | imagescr: {
8 | type: String,
9 | required: true
10 | },
11 | title: {
12 | type: String,
13 | required: true
14 | },
15 | summary: {
16 | type: String,
17 | },
18 | city: {
19 | type: String,
20 | required: true
21 | },
22 | TravelText: {
23 | type: String,
24 | },
25 | TravelText2: {
26 | type: String,
27 | },
28 | rating: {
29 | type: Number,
30 | },
31 | ratingStatus: {
32 | type: String,
33 | },
34 | reviews: {
35 | type: Number,
36 | },
37 | price: {
38 | type: Number,
39 | }
40 | });
41 |
42 | const PropertyModel = models.property || model("property", PropertySchema);
43 | export { PropertyModel };
--------------------------------------------------------------------------------
/tripBook.com/pages/api/user/signup/index.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../../db.connect";
2 | import { UserModel } from "../../../../models/user.model";
3 | import argon2id from "argon2";
4 |
5 | export default async function handler(req, res) {
6 | const { method } = req;
7 | const { name, email, password } = req.body;
8 | try {
9 | await connect();
10 | } catch (e) {
11 | console.log(e);
12 | }
13 |
14 | if (method === "POST") {
15 | try {
16 | const check = await UserModel.findOne({ email });
17 | if (check)
18 | return res
19 | .status(400)
20 | .send({ message: "User with provided email already exists" });
21 |
22 | const hash = await argon2id.hash(password);
23 | const user = await UserModel.create({ name, email, password: hash, role: "user" });
24 | res.status(201).send({ message: "User Created", user });
25 | } catch (e) {
26 | res.status(400).send(e.message);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tripBook.com/pages/api/user/signup/dealer.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../../db.connect";
2 | import { UserModel } from "../../../../models/user.model";
3 | import argon2id from "argon2";
4 |
5 | export default async function handler(req, res) {
6 | const { method } = req;
7 | const { name, email, password } = req.body;
8 | try {
9 | await connect();
10 | } catch (e) {
11 | console.log(e);
12 | }
13 |
14 | if (method === "POST") {
15 | try {
16 | const check = await UserModel.findOne({ email });
17 | if (check)
18 | return res
19 | .status(400)
20 | .send({ message: "User with provided email already exists" });
21 |
22 | const hash = await argon2id.hash(password);
23 | const user = await UserModel.create({ name, email, password: hash, role: "dealer" });
24 | res.status(201).send({ message: "Dealer Created", user });
25 | } catch (e) {
26 | res.status(400).send(e.message);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tripBook.com/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/tripBook.com/components/pre_loader/loadingScreen.js:
--------------------------------------------------------------------------------
1 | import { Center } from "@chakra-ui/react";
2 | import React from "react"
3 | import styles from "./loadingText.module.css"
4 |
5 |
6 | const LoadingScreen = () => {
7 | return (
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 | };
28 |
29 | export default LoadingScreen;
--------------------------------------------------------------------------------
/tripBook.com/pages/api/user/refresh.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../db.connect";
2 | import { UserModel } from "../../../models/user.model";
3 | import jwt from "jsonwebtoken";
4 |
5 | export default async function handler(req, res) {
6 | const { method } = req;
7 | try {
8 | await connect();
9 | } catch (e) {
10 | console.log(e);
11 | }
12 |
13 | if (method === "POST") {
14 | let verifiedUser;
15 | const { refreshToken } = req.body;
16 | if (!refreshToken) return res.status(401).send("Unauthorized access");
17 |
18 | try {
19 | jwt.verify(refreshToken, process.env.rtsec, function (err, verified) {
20 | if (err) {
21 | return res
22 | .status(401)
23 | .json({ error: true, message: "Please relogin" });
24 | }
25 |
26 | verifiedUser = verified;
27 | console.log(verifiedUser);
28 | });
29 | const user = await UserModel.findOne({ _id: verifiedUser.id });
30 |
31 | const token = jwt.sign(
32 | { id: user._id, name: user.name, role: user.role },
33 | process.env.tsec,
34 | {
35 | expiresIn: process.env.tl,
36 | }
37 | );
38 |
39 | return res.status(200).send({ token: token });
40 | } catch (e) {
41 | res.status(404).send(e.message);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/tripBook.com/components/backgroundImg/bgComponent.js:
--------------------------------------------------------------------------------
1 | import { Box, Container, Heading, Text } from "@chakra-ui/react";
2 | import styles from "../backgroundImg/bgComponent.module.css";
3 | function BgComponent({ heading, subHeading }) {
4 | return (
5 | <>
6 |
12 |
13 |
19 |
20 |
25 | {heading}
26 |
27 |
28 |
29 |
33 | {subHeading}
34 |
35 |
36 |
37 |
38 |
39 | >
40 | );
41 | }
42 |
43 | export default BgComponent;
44 |
--------------------------------------------------------------------------------
/tripBook.com/pages/api/property/[id].js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../db.connect";
2 | import { PropertyModel } from "../../../models/property.model";
3 |
4 | export default async function handler(req, res) {
5 | const { method } = req;
6 | const { id } = req.query;
7 |
8 | try {
9 | await connect();
10 | } catch (e) {
11 | console.log(e);
12 | }
13 |
14 | if (method === "DELETE") {
15 | try {
16 | const property = await PropertyModel.findOneAndDelete({ _id: id });
17 | res.status(200).send({ message: "Deleted", property });
18 | } catch (e) {
19 | res.status(400).send(e.message);
20 | }
21 | }
22 |
23 | if (method === "PUT") {
24 | try {
25 | const property = await PropertyModel.findOneAndReplace(
26 | { _id: id },
27 | req.body,
28 | { new: true }
29 | );
30 | res.status(200).send({ message: "Replaced", property });
31 | } catch (e) {
32 | res.status(400).send(e.message);
33 | }
34 | }
35 |
36 | if (method === "PATCH") {
37 | try {
38 | const property = await PropertyModel.findOneAndUpdate(
39 | { _id: id },
40 | req.body,
41 | { new: true }
42 | );
43 | res.status(200).send({ message: "Updated", property });
44 | } catch (e) {
45 | res.status(400).send(e.message);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/tripBook.com/pages/_app.js:
--------------------------------------------------------------------------------
1 | import '../styles/globals.css'
2 | import { ChakraProvider } from '@chakra-ui/react';
3 | import AuthContextProvider from '../context/AuthContextProvider';
4 | import Footer from '../components/Footer';
5 | import React ,{ useState , useEffect } from "react"
6 | import LoadingScreen from '../components/pre_loader/loadingScreen';
7 | // import {ToastContainer} from 'react-nextjs-toast';
8 | import GuestContextProvider from "../context/GuestContext";
9 |
10 |
11 | function MyApp({ Component, pageProps }) {
12 |
13 | // *********************************pre loader start************************************
14 |
15 | const [loading, setLoading] = useState(false);
16 |
17 | useEffect(() => {
18 | setTimeout(() => {
19 | setLoading(true);
20 | },2000);
21 | }, []);
22 | // *********************************pre loader end************************************
23 |
24 |
25 | return (
26 | <>
27 | {loading?
28 | (
29 |
30 |
31 |
32 | {/* */}
33 |
34 |
35 |
36 | ):( )
37 | }
38 | >
39 | )
40 | }
41 |
42 | export default MyApp;
43 |
--------------------------------------------------------------------------------
/tripBook.com/context/GuestContext.js:
--------------------------------------------------------------------------------
1 |
2 | import { createContext, useState } from "react";
3 |
4 | export const GuestContext = createContext();
5 |
6 |
7 | const GuestContextProvider = ({ children }) => {
8 | const [adult, setAdult] = useState(0);
9 | const [childrens, setchildrens] = useState(0);
10 | const [room, setroom] = useState(0);
11 | const handleIncre = () => {
12 | setAdult((prev) => prev + 1);
13 | };
14 |
15 | const handledec = () => {
16 | setAdult((prev) => prev - 1);
17 | };
18 | const handlechildrenIncre = () => {
19 | setchildrens((prev) => prev + 1);
20 | };
21 | const handlechildrenDec = () => {
22 | setchildrens((prev) => prev - 1);
23 | };
24 | const handleroomIncre = () => {
25 | setroom((prev) => prev + 1);
26 | };
27 | const handleroomDec = () => {
28 | setroom((prev) => prev - 1);
29 | };
30 |
31 | const [date, setDate] = useState([
32 | new Date('2022-02-01 01:00:00'),
33 | new Date('2022-02-06 14:00:00')
34 | ]);
35 |
36 |
37 | return (
38 |
51 | {children}
52 |
53 | );
54 | };
55 |
56 | export default GuestContextProvider;
--------------------------------------------------------------------------------
/tripBook.com/pages/api/user/signin.js:
--------------------------------------------------------------------------------
1 | import { connect } from "../../../db.connect";
2 | import { UserModel } from "../../../models/user.model";
3 | import argon2id from "argon2";
4 | import jwt from "jsonwebtoken";
5 |
6 | export default async function handler(req, res) {
7 | const { method } = req;
8 | const { email, password } = req.body;
9 | try {
10 | await connect();
11 | } catch (e) {
12 | console.log(e);
13 | }
14 |
15 | if (method === "POST") {
16 | try {
17 | const user = await UserModel.findOne({ email });
18 | if (user) {
19 | if (!(await argon2id.verify(user.password, password))) {
20 | return res.status(401).send({ message: "Invalid password" });
21 | }
22 |
23 | const token = jwt.sign(
24 | { id: user._id, name: user.name, role: user.role },
25 | process.env.TSEC,
26 | {
27 | expiresIn: process.env.TL,
28 | }
29 | );
30 |
31 | const refreshToken = jwt.sign(
32 | { id: user._id, name: user.name, role: user.role },
33 | process.env.RTSEC,
34 | {
35 | expiresIn: process.env.RTL,
36 | }
37 | );
38 |
39 | const response = {
40 | status: "Logged in",
41 | token: token,
42 | refreshToken: refreshToken,
43 | };
44 |
45 | res.status(200).send(response);
46 | } else {
47 | return res.status(401).send({ message: "User not found" });
48 | }
49 | } catch (e) {
50 | res.status(400).send(e.message);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/tripBook.com/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | .image_icon {
10 | color: rgb(236, 55, 0);
11 | opacity: .5;
12 | }
13 |
14 | .image_icon:hover {
15 | cursor: pointer;
16 | font-size: 24.2px;
17 | }
18 |
19 | .date_picker{
20 | width: 100%;
21 | height: 100%;
22 | }
23 |
24 | .rs-picker-toggle{
25 | height: 100%;
26 | }
27 |
28 | .authlinks {
29 | width: 60px;
30 | height: 40px;
31 | background-position: 50%;
32 | background-repeat: no-repeat;
33 | border-radius: 3px;
34 | }
35 |
36 | /* .slide-container{
37 | border: 3px solid yellow;
38 | } */
39 |
40 | /* .slidingCont{
41 | border: 3px solid rgb(218, 22, 229);
42 | } */
43 |
44 |
45 | /* @media all and (min-width: 401px) and (max-width: 750px){
46 | .each-slide{
47 | display: grid;
48 | grid-template-columns: repeat(3,1fr);
49 | gap: 4%;
50 | }
51 | .Home_Featured_Brands_Item1 div:last-child{
52 | position: relative;
53 | font-size: 80%;
54 | }
55 |
56 | .Home_carousel_item_Third1{
57 | margin-bottom: 10%;
58 | }
59 | }
60 |
61 |
62 | @media all and (min-width: 280px) and (max-width: 400px){
63 | .each-slide{
64 | display: grid;
65 | grid-template-columns: repeat(2,1fr);
66 | gap: 4%;
67 | padding-bottom: 5%;
68 | margin-bottom: 8%;
69 | }
70 | .Home_Featured_Brands_Item1 div:last-child{
71 | font-size: 50%;
72 | }
73 | } */
--------------------------------------------------------------------------------
/tripBook.com/components/SearchForm.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | Checkbox,
5 | FormControl,
6 | FormLabel,
7 | Input,
8 | InputGroup,
9 | InputLeftElement,
10 | Text,
11 | VStack,
12 | NumberInput,
13 | NumberInputField,
14 | NumberInputStepper,
15 | NumberIncrementStepper,
16 | NumberDecrementStepper,
17 | } from "@chakra-ui/react";
18 | import Link from "next/link";
19 | import { useState } from "react";
20 |
21 | import { BsSearch } from "react-icons/bs";
22 | import Datepicker from "./DatePicker";
23 |
24 | const SearchForm = () => {
25 |
26 | const [inputData , setInputData] = useState("");
27 |
28 | return (
29 |
30 |
31 | Search
32 |
33 |
34 | Destination/property name:
35 |
36 | } />
37 | setInputData(target.value)} type="text" placeholder="Where are you going" />
38 |
39 | Check-in - Check-out
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | Entire homes & apartments
51 | I'm travelling for work
52 |
53 |
54 |
55 |
56 | Search
57 |
58 |
59 |
60 |
61 | );
62 | };
63 |
64 | export default SearchForm;
65 |
--------------------------------------------------------------------------------
/tripBook.com/components/explore/connectTravellers.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Img, Text, SimpleGrid, Stack, Box } from "@chakra-ui/react";
3 |
4 | function ConnectWithtravellers() {
5 | const data = [
6 | {
7 | caption: "Genuius",
8 | property: "mandloi, you're at Genius Level 1 in our programme",
9 | image:
10 | "https://cf.bstatic.com/static/img/communities/cover-photo/300x300/united-states-of-america/ba24465763ee132be84ce7c3e07d80096374e9d7.jpg",
11 | numbers: "343,321 travellers",
12 | },
13 | {
14 | caption: "10% discounts",
15 | property: "Enjoy discounts at participating properties",
16 | image:
17 | "https://cf.bstatic.com/static/img/communities/cover-photo/300x300/india/e4f4cf85c7a3c87ad369dc3da2a7774957dae913.jpg",
18 | numbers: "123,933 travellers",
19 | },
20 | {
21 | caption: "15% discounts",
22 | property: "Complete 5 stays to unlock Genius Level 2 program",
23 | image:
24 | "https://cf.bstatic.com/static/img/communities/cover-photo/300x300/travel-discussions/f43b42664bbf44f174b44c64fd71440b4af56888.jpg",
25 | numbers: "111,433 travellers",
26 | },
27 | {
28 | caption: "Free breakfasts",
29 | property: "Complete 5 stays to unlock Genius Level 2",
30 | image:
31 | "https://cf.bstatic.com/static/img/communities/communities-index/photo-300x300/592ac5a7bbd5433c1aba6f1afdea794e572c9a69.png",
32 | numbers: "132,433 travellers",
33 | },
34 | ];
35 |
36 | return (
37 |
38 | {data &&
39 | data.map((elem ,i) => (
40 |
41 |
42 |
43 | {elem.caption}
47 | {elem.property}
48 | {elem.numbers}
49 |
50 |
51 | ))}
52 |
53 | );
54 | }
55 |
56 | export default ConnectWithtravellers;
--------------------------------------------------------------------------------
/tripBook.com/pages/flights.js:
--------------------------------------------------------------------------------
1 | import { Slideshow } from "../components/explore/slideShow";
2 | import Navbar from "../components/navbarSection/navbar";
3 | import SearchBox from "../components/searchBox/searchBox";
4 |
5 | function flights() {
6 | const stay = [
7 | {
8 | caption: "Genuius",
9 | property: "mandloi, you're at Genius Level 1 in our loyalty programme",
10 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/286659200.webp?k=9206fc9239b3e4538c22d04b85213d6d5e6257015022de8a37effd956fcde4b6&o=&s=1",
11 | },
12 | {
13 | caption: "10% discounts",
14 | property: "Enjoy discounts at participating properties worldwide",
15 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/280950287.webp?k=b984c542b8b1a2ee0e019e4491da338a85b660caa10c5e1197225c5f3052d629&o=&s=1",
16 | },
17 | {
18 | caption: "15% discounts",
19 | property: "Complete 5 stays to unlock Genius Level 2",
20 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/132452060.webp?k=8448bab55c87dbb42ab7c6643fbbce542124c908f63f6b36dc3cdc859e60cb0a&o=&s=1",
21 | },
22 | {
23 | caption: "Free breakfasts",
24 | property: "Complete 5 stays to unlock Genius Level 2",
25 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/187855604.webp?k=bbb45aa5b540c7608ea3af52d92b95a215df9af831dd3ae0e4c4cce501e28b1b&o=&s=1",
26 | },
27 | {
28 | caption: "Free room upgrades",
29 | property: "Complete 5 stays to unlock Genius Level 2",
30 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/178421525.webp?k=262301cdcbef1d33942bb02607906eafdee8dde3106ac5732966a206baeebb04&o=&s=1",
31 | },
32 | ];
33 |
34 | return (
35 |
36 |
37 |
38 |
44 |
45 |
51 |
52 | );
53 | }
54 |
55 | export default flights;
56 |
--------------------------------------------------------------------------------
/tripBook.com/pages/carrental.js:
--------------------------------------------------------------------------------
1 | import { Slideshow } from "../components/explore/slideShow";
2 | import Navbar from "../components/navbarSection/navbar";
3 | import SearchBox from "../components/searchBox/searchBox";
4 |
5 | function carRental() {
6 | const stay = [
7 | {
8 | caption: "Genuius",
9 | property: "mandloi, you're at Genius Level 1 in our loyalty programme",
10 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/286659200.webp?k=9206fc9239b3e4538c22d04b85213d6d5e6257015022de8a37effd956fcde4b6&o=&s=1",
11 | },
12 | {
13 | caption: "10% discounts",
14 | property: "Enjoy discounts at participating properties worldwide",
15 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/280950287.webp?k=b984c542b8b1a2ee0e019e4491da338a85b660caa10c5e1197225c5f3052d629&o=&s=1",
16 | },
17 | {
18 | caption: "15% discounts",
19 | property: "Complete 5 stays to unlock Genius Level 2",
20 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/132452060.webp?k=8448bab55c87dbb42ab7c6643fbbce542124c908f63f6b36dc3cdc859e60cb0a&o=&s=1",
21 | },
22 | {
23 | caption: "Free breakfasts",
24 | property: "Complete 5 stays to unlock Genius Level 2",
25 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/187855604.webp?k=bbb45aa5b540c7608ea3af52d92b95a215df9af831dd3ae0e4c4cce501e28b1b&o=&s=1",
26 | },
27 | {
28 | caption: "Free room upgrades",
29 | property: "Complete 5 stays to unlock Genius Level 2",
30 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/178421525.webp?k=262301cdcbef1d33942bb02607906eafdee8dde3106ac5732966a206baeebb04&o=&s=1",
31 | },
32 | ];
33 |
34 | return (
35 |
36 |
37 |
38 |
44 |
45 |
51 |
52 | );
53 | }
54 |
55 | export default carRental;
56 |
--------------------------------------------------------------------------------
/tripBook.com/components/explore/slideShow.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Slide } from "react-slideshow-image";
3 | import "react-slideshow-image/dist/styles.css";
4 | import Link from "next/link";
5 | import { Box, Button, Image, Text } from "@chakra-ui/react";
6 |
7 | export const Slideshow = ({ image, no, tag, subTag }) => {
8 | return (
9 |
15 |
22 |
29 | {tag}
30 |
31 | {subTag}
32 |
33 | {image.map((slideImage, index) => (
34 |
39 |
45 |
49 |
50 |
60 | {slideImage.caption}
61 | {slideImage.property}
62 |
63 |
73 |
77 | {slideImage.caption}
78 |
79 |
80 |
81 |
82 |
83 | ))}
84 |
85 |
86 |
87 | );
88 | };
89 |
--------------------------------------------------------------------------------
/tripBook.com/components/navbarSection/navbar.module.css:
--------------------------------------------------------------------------------
1 | .imgLink {
2 | text-decoration: none;
3 | color: white;
4 | }
5 |
6 | .authDiv {
7 | display: flex;
8 | /* border: 2px solid rgb(240, 21, 240); */
9 | width: 50%;
10 | justify-content: space-around;
11 | }
12 |
13 | .authButton {
14 | background-color: white;
15 | color: rgb(51, 51, 236);
16 | text-align: center;
17 | padding: 2%;
18 | height: 32px;
19 | }
20 |
21 | .authLink {
22 | border-radius: 10px;
23 | font-size: 15px;
24 | }
25 | .authLink:hover {
26 | text-decoration: none;
27 | color: black;
28 | }
29 | .uniqueButton {
30 | /* height: 20%; */
31 | background-color: #004cb8;
32 | border-radius: 10px;
33 | border: 1px solid rgb(249, 243, 243);
34 | color: rgb(241, 239, 239);
35 | padding: 8px;
36 | text-align: center;
37 |
38 | text-decoration: none;
39 | font-weight: 600;
40 | font-size: 15px;
41 | }
42 | .uniqueButton:hover {
43 | color: white;
44 | background-color: #022c66;
45 | text-decoration: none;
46 | }
47 |
48 | .navRow2 {
49 | display: flex;
50 | text-decoration: none;
51 | justify-content: center;
52 | color: white;
53 | padding: 12px;
54 | border-radius: 20px;
55 | margin: auto;
56 | gap: 3px;
57 |
58 | /* border: 2px solid red; */
59 | /* font-weight: bold; */
60 | }
61 |
62 | .navRow2:hover {
63 | background-color: #03275a;
64 | color: white;
65 | text-decoration: none;
66 | }
67 |
68 | .navRow2One {
69 | display: flex;
70 | text-decoration: none;
71 | color: white;
72 | justify-content: center;
73 | border: 1px solid white;
74 | padding: 12px;
75 | border-radius: 20px;
76 | gap: 3px;
77 | }
78 | .navRow2One:hover {
79 | color: white;
80 | background-color: #022c66;
81 | text-decoration: none;
82 | }
83 |
84 | .iconsStyles1 {
85 | width: 22px;
86 | height: 22px;
87 | /* border: 1px solid rgb(236, 17, 17); */
88 | }
89 | .iconsStyles {
90 | width: 25px;
91 | height: 22px;
92 | }
93 |
94 | .smallScreen {
95 | display: none;
96 | }
97 |
98 | .navRow2s {
99 | text-decoration: none;
100 | display: flex;
101 | justify-content: center;
102 | color: black;
103 | padding: 10px;
104 | border-radius: 10px;
105 | margin: auto;
106 | gap: 10px;
107 | /* border: 1px solid rgb(236, 17, 17); */
108 | }
109 |
110 | .navRow2s:hover {
111 | box-shadow: 4px 4px 7px red;
112 | cursor: pointer;
113 | }
114 |
115 | .stackBox {
116 | /* border: 2px solid yellow; */
117 | margin-top: 12px;
118 | }
119 |
120 |
121 | @media only screen and (max-width: 650px) {
122 | .stackBox {
123 | display: none;
124 | }
125 | .smallScreen {
126 | display: flex;
127 | }
128 |
129 | .logosize {
130 | display: flex;
131 | justify-content: space-between;
132 | width: 100px;
133 | margin-top: 6px;
134 | }
135 | .smallnavbutton {
136 | width: 30%;
137 | }
138 | }
139 |
140 | @media only screen and (max-width: 855px) {
141 | .stackBox {
142 | display: none;
143 | }
144 | .smallScreen {
145 | display: flex;
146 | }
147 | .logosize {
148 | display: flex;
149 | justify-content: space-between;
150 | width: 100px;
151 | margin-top: 6px;
152 | }
153 | .smallnavbutton {
154 | width: 120px;
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/tripBook.com/components/navbarSection/draverNav.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Drawer,
4 | DrawerBody,
5 | DrawerFooter,
6 | DrawerHeader,
7 | DrawerOverlay,
8 | DrawerContent,
9 | DrawerCloseButton,
10 | useDisclosure,
11 | Box,
12 | Button,
13 | HStack,
14 | } from "@chakra-ui/react";
15 |
16 | import styles from "./navbar.module.css";
17 | import Link from "next/link";
18 | import { QuestionIcon, Icon } from "@chakra-ui/icons";
19 |
20 | import {
21 | IoAirplaneOutline,
22 | IoBedOutline,
23 | IoCarOutline,
24 | IoCarSportOutline,
25 | IoFlowerOutline,
26 | } from "react-icons/io5";
27 | import { RiCommunityLine } from "react-icons/ri";
28 |
29 | function DraverNav() {
30 | const { isOpen, onOpen, onClose } = useDisclosure();
31 | const btnRef = React.useRef();
32 |
33 | return (
34 | <>
35 |
44 | Explore-more
45 |
46 |
52 |
53 |
54 |
55 |
60 | Create your account & Explore
61 |
62 |
63 |
64 |
65 |
66 | Stays
67 |
68 |
69 |
70 |
71 | Flights
72 |
73 |
74 |
75 |
76 | Flights + Hotel
77 |
78 |
79 |
80 |
81 | Car rentals
82 |
83 |
84 |
85 |
86 | Attractions
87 |
88 |
89 |
90 |
91 | Airport taxis
92 |
93 |
94 |
95 |
96 |
97 |
98 | Register
99 |
100 |
101 |
102 |
103 | Sign in
104 |
105 |
106 |
107 |
108 | >
109 | );
110 | }
111 |
112 | export default DraverNav;
113 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # strong-cover-1612
2 |
3 |
4 | TripBook.com
5 |
6 | TripBook is a Next.JS project
7 |
8 |
9 |
10 |
11 | 🖥️ Tech Stack
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | It’s a group project where we've used Next.JS to make the TripBook.com with our creativity along with frontend and backend integration
25 | its Fully Responsive booking web application that allows you to book hotels, flights and car rental. In this website you can filter, sort hotels by price, rating and reviews.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ## 🚀 User Features
37 | - Login and Signup User Account
38 | - Sorting Based on Price, Rating and Reviews
39 | - Hotels Page
40 | - Flight Page
41 | - car rental page
42 | - SignIn/SignUp
43 | - Checkout page
44 |
45 |
46 |
47 | ## Glimpses of TripBook.com 🙈 :
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | ## Getting Started
76 |
77 | This project was built using NextJS, Chakra UI, MongoDB. It is an e-commerce web application and for running on your local environment you should follow these guidelines.
78 |
79 |
80 |
81 |
82 | ## Available Scripts
83 |
84 | In the project directory, you can run:
85 |
86 | ### `npm run dev`
87 |
88 | Runs the app in the development mode.\
89 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
90 |
91 | The page will reload when you make changes.\
92 | You may also see any lint errors in the console.
93 |
94 | ### `npm test`
95 |
96 | Launches the test runner in the interactive watch mode.\
97 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
98 |
99 | ### `npm run build`
100 |
101 | Builds the app for production to the `build` folder.\
102 | It correctly bundles React in production mode and optimizes the build for the best performance.
103 |
104 | The build is minified and the filenames include the hashes.\
105 | Your app is ready to be deployed!
106 |
107 |
108 |
109 |
110 | ### Tools used on this project
111 |
112 | - Visual Studio Code
113 | - MongoDB Atlas (Online hosting of data)
114 |
115 |
116 |
117 |
118 | ## Show your support
119 |
120 | Give a ⭐️ if you like this project!
121 |
122 |
--------------------------------------------------------------------------------
/tripBook.com/pages/addproperty.js:
--------------------------------------------------------------------------------
1 | import {
2 | Button,
3 | Flex,
4 | FormControl,
5 | FormLabel,
6 | Heading,
7 | Input,
8 | Stack,
9 | Image,
10 | Box,
11 | useToast
12 | } from '@chakra-ui/react';
13 | import axios from 'axios';
14 | import Link from 'next/link';
15 | import { useEffect, useState } from 'react';
16 | import { BsQuestionCircle } from 'react-icons/bs'
17 | import { CgProfile } from 'react-icons/cg'
18 | // import { toast,} from 'react-nextjs-toast'
19 | import LoadingScreen from '../components/pre_loader/loadingScreen';
20 |
21 |
22 |
23 | const AddProperty=()=> {
24 |
25 | const [loading, setLoading] = useState(false);
26 |
27 | const toast = useToast();
28 |
29 | useEffect(() => {
30 | setLoading(true);
31 | }, []);
32 |
33 | const [title, setTitle] = useState("");
34 | const [imagescr, setImagescr] = useState("");
35 | const [city, setCity] = useState("");
36 |
37 |
38 | const postProp = async() => {
39 | const res = await axios.post(`/api/property`, {title, imagescr, city});
40 | toast({
41 | title: "Property added successful👍",
42 | status: "success",
43 | duration: 3400,
44 | isClosable: true,
45 | position: "top",
46 | });
47 | setTitle("");
48 | setImagescr("");
49 | setCity("");
50 | console.log(res.data);
51 | }
52 |
53 | return (
54 | <>
55 | {loading?(<>
56 |
57 |
58 |
59 |
62 | Help
67 |
68 |
69 |
70 |
71 | Add your property details
72 |
73 | Image Url
74 | setImagescr(target.value)} type="url" />
75 |
76 |
77 | Name
78 | setTitle(target.value)} type="text" />
79 |
80 |
81 | City
82 | setCity(target.value)} type="text" />
83 |
84 |
85 | postProp()} colorScheme={'blue'} variant={'solid'}>
86 | Add your property
87 |
88 |
89 | Back to home
90 |
91 |
92 |
93 |
94 |
95 |
96 |
103 |
104 | >):( )
105 | }
106 | >
107 | );
108 | }
109 | export default AddProperty;
--------------------------------------------------------------------------------
/tripBook.com/components/SearchCard.js:
--------------------------------------------------------------------------------
1 | import {
2 | Flex,
3 | Text,
4 | Button,
5 | Image,
6 | Link,
7 | Box,
8 | HStack,
9 | Center,
10 | } from "@chakra-ui/react";
11 | import { useEffect, useState } from "react";
12 | import { AiFillStar, AiFillLike } from "react-icons/ai";
13 | import { BsHeart } from "react-icons/bs";
14 | import LoadingScreen from "./pre_loader/loadingScreen";
15 | import NextLink from 'next/link'
16 |
17 | const SearchCard = ({
18 | id,
19 | title,
20 | TravelText,
21 | TravelText1,
22 | TravelText2_o,
23 | TravelText_2,
24 | TravelText2,
25 | price,
26 | reviews,
27 | rating,
28 | ratingStatus,
29 | imagescr,
30 | city,
31 | }) => {
32 |
33 | const [loading, setLoading] = useState(false);
34 |
35 | useEffect(() => {
36 | setLoading(true);
37 | }, []);
38 |
39 | return (
40 | <>
41 | {loading?(
42 |
51 |
55 |
56 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
75 | {title}
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | {city}
85 |
86 |
87 | Show on map
88 |
89 |
90 | { TravelText ? TravelText : ""}
91 |
92 |
93 | {/* {TravelText ? TravelText : ""} */}
94 |
95 | {TravelText1 ? TravelText1 : ""}
96 | {TravelText2 ? TravelText2 : ""}
97 | {TravelText2_o ? TravelText2_o : ""}
98 | {TravelText_2 ? TravelText_2 : ""}
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | {ratingStatus}
107 |
108 | {reviews ? reviews : 0} reviews
109 |
110 |
111 |
120 | {rating}
121 |
122 |
123 | Price/day ₹ {price}
124 |
125 | ):( )
126 | }
127 | >
128 | );
129 | };
130 |
131 | export default SearchCard;
132 |
--------------------------------------------------------------------------------
/tripBook.com/components/pre_loader/loadingText.module.css:
--------------------------------------------------------------------------------
1 | #wifi_loader {
2 | --background: #62abff;
3 | --front-color: #4f29f0;
4 | --back-color: #c3c8de;
5 | --text-color: #414856;
6 | width: 64px;
7 | height: 64px;
8 | border-radius: 50px;
9 | position: relative;
10 | display: flex;
11 | justify-content: center;
12 | align-items: center;
13 | margin-top: 15rem;
14 | }
15 |
16 | #wifi_loader svg {
17 | position: absolute;
18 | display: flex;
19 | justify-content: center;
20 | align-items: center;
21 | }
22 |
23 | #wifi_loader svg circle {
24 | position: absolute;
25 | fill: none;
26 | stroke-width: 6px;
27 | stroke-linecap: round;
28 | stroke-linejoin: round;
29 | transform: rotate(-100deg);
30 | transform-origin: center;
31 | }
32 |
33 | #wifi_loader svg circle.back {
34 | stroke: var(--back-color);
35 | }
36 |
37 | #wifi_loader svg circle.front {
38 | stroke: var(--front-color);
39 | }
40 |
41 | #wifi_loader svg.circle_outer {
42 | height: 86px;
43 | width: 86px;
44 | }
45 |
46 | #wifi_loader svg.circle_outer circle {
47 | stroke-dasharray: 62.75 188.25;
48 | }
49 |
50 | #wifi_loader svg.circle_outer circle.back {
51 | animation: circle_outer135 1.8s ease infinite 0.3s;
52 | }
53 |
54 | #wifi_loader svg.circle_outer circle.front {
55 | animation: circle_outer135 1.8s ease infinite 0.15s;
56 | }
57 |
58 | #wifi_loader svg.circle_middle {
59 | height: 60px;
60 | width: 60px;
61 | }
62 |
63 | #wifi_loader svg.circle_middle circle {
64 | stroke-dasharray: 42.5 127.5;
65 | }
66 |
67 | #wifi_loader svg.circle_middle circle.back {
68 | animation: circle_middle6123 1.8s ease infinite 0.25s;
69 | }
70 |
71 | #wifi_loader svg.circle_middle circle.front {
72 | animation: circle_middle6123 1.8s ease infinite 0.1s;
73 | }
74 |
75 | #wifi_loader svg.circle_inner {
76 | height: 34px;
77 | width: 34px;
78 | }
79 |
80 | #wifi_loader svg.circle_inner circle {
81 | stroke-dasharray: 22 66;
82 | }
83 |
84 | #wifi_loader svg.circle_inner circle.back {
85 | animation: circle_inner162 1.8s ease infinite 0.2s;
86 | }
87 |
88 | #wifi_loader svg.circle_inner circle.front {
89 | animation: circle_inner162 1.8s ease infinite 0.05s;
90 | }
91 |
92 | #wifi_loader .text {
93 | position: absolute;
94 | bottom: -40px;
95 | display: flex;
96 | justify-content: center;
97 | align-items: center;
98 | text-transform: lowercase;
99 | font-weight: 600;
100 | font-size: 20px;
101 | letter-spacing: 0.2px;
102 | }
103 |
104 | #wifi_loader .text::before, #wifi_loader .text::after {
105 | content: attr(data-text);
106 | }
107 |
108 | #wifi_loader .text::before {
109 | color: var(--text-color);
110 | }
111 |
112 | #wifi_loader .text::after {
113 | color: var(--front-color);
114 | animation: text-animation76 3.6s ease infinite;
115 | position: absolute;
116 | left: 0;
117 | }
118 |
119 | @keyframes circle_outer135 {
120 | 0% {
121 | stroke-dashoffset: 25;
122 | }
123 |
124 | 25% {
125 | stroke-dashoffset: 0;
126 | }
127 |
128 | 65% {
129 | stroke-dashoffset: 301;
130 | }
131 |
132 | 80% {
133 | stroke-dashoffset: 276;
134 | }
135 |
136 | 100% {
137 | stroke-dashoffset: 276;
138 | }
139 | }
140 |
141 | @keyframes circle_middle6123 {
142 | 0% {
143 | stroke-dashoffset: 17;
144 | }
145 |
146 | 25% {
147 | stroke-dashoffset: 0;
148 | }
149 |
150 | 65% {
151 | stroke-dashoffset: 204;
152 | }
153 |
154 | 80% {
155 | stroke-dashoffset: 187;
156 | }
157 |
158 | 100% {
159 | stroke-dashoffset: 187;
160 | }
161 | }
162 |
163 | @keyframes circle_inner162 {
164 | 0% {
165 | stroke-dashoffset: 9;
166 | }
167 |
168 | 25% {
169 | stroke-dashoffset: 0;
170 | }
171 |
172 | 65% {
173 | stroke-dashoffset: 106;
174 | }
175 |
176 | 80% {
177 | stroke-dashoffset: 97;
178 | }
179 |
180 | 100% {
181 | stroke-dashoffset: 97;
182 | }
183 | }
184 |
185 | @keyframes text-animation76 {
186 | 0% {
187 | clip-path: inset(0 100% 0 0);
188 | }
189 |
190 | 50% {
191 | clip-path: inset(0);
192 | }
193 |
194 | 100% {
195 | clip-path: inset(0 0 0 100%);
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/tripBook.com/pages/listproperty.js:
--------------------------------------------------------------------------------
1 | import { Box, Button, Flex, Image, Text } from "@chakra-ui/react";
2 | import { CgProfile } from "react-icons/cg";
3 | import { VscDebugRestartFrame } from "react-icons/vsc";
4 | import { BsQuestionCircle } from "react-icons/bs";
5 | import Link from "next/link";
6 | import LoadingScreen from "../components/pre_loader/loadingScreen";
7 | import { useEffect, useState } from "react";
8 |
9 | const ListProperty = () => {
10 |
11 | const [loading, setLoading] = useState(false);
12 |
13 | useEffect(() => {
14 | setLoading(true);
15 | }, []);
16 |
17 | return (
18 | <>
19 | {loading?
20 | (
21 |
22 |
29 |
30 |
31 |
32 |
33 |
41 | Help {" "}
42 |
43 |
44 |
45 |
46 |
47 | List your property on Booking.com and start welcoming guests in no
48 | time!
49 |
50 |
51 | To get started, choose the type of property you want to list on
52 | Booking.com
53 |
54 |
55 |
63 |
75 | Quick start
76 |
77 |
84 |
85 | Hotel, B&Bs, and more
86 |
87 |
88 |
89 | Furnished and self-catering accommodation, where guests rent the
90 | entire place.
91 |
92 |
93 |
94 |
101 | List your property
102 |
103 |
104 |
105 |
113 | Go Back
114 |
115 |
116 |
117 |
118 |
119 | ):( )}
120 | >
121 | );
122 | };
123 |
124 | export default ListProperty;
125 |
--------------------------------------------------------------------------------
/tripBook.com/pages/signin.js:
--------------------------------------------------------------------------------
1 | import {
2 | VStack,
3 | Box,
4 | Input,
5 | Text,
6 | FormControl,
7 | FormLabel,
8 | Link,
9 | Heading,
10 | Flex,
11 | } from "@chakra-ui/react";
12 | import axios from "axios";
13 | import { useRouter } from "next/router";
14 | import { useContext, useEffect, useState } from "react";
15 | import { BsGithub } from "react-icons/bs";
16 | import Navbar from "../components/navbarSection/navbar";
17 | import { AuthContext } from "../context/AuthContextProvider";
18 |
19 | const Signin = () => {
20 | const [email, setEmail] = useState("");
21 | const [password, setPassword] = useState("");
22 | const router = useRouter();
23 | const { auth, setAuth } = useContext(AuthContext);
24 |
25 | const reset = () => {
26 | setEmail("");
27 | setPassword("");
28 | };
29 |
30 | const signinReq = async () => {
31 | const res = await axios.post("/api/user/signin", {
32 | email,
33 | password,
34 | });
35 | console.log(res.data);
36 | if (res.data) {
37 | setAuth({ ...auth, isAuth: res.data });
38 | reset();
39 | router.push("/");
40 | }
41 | };
42 |
43 | useEffect(() => {
44 | if (auth.isReg)setEmail(auth.isReg.email);
45 | }, [auth]);
46 |
47 | return (
48 |
49 |
50 |
51 |
58 | Sign in to your account
59 |
60 |
61 |
62 |
63 |
64 | Email
65 |
66 | setEmail(target.value)}
68 | value={email}
69 | mb="15px"
70 | type="email"
71 | placeholder="Type in your email address"
72 | />
73 |
74 | Password
75 |
76 | setPassword(target.value)}
78 | value={password}
79 | mb="15px"
80 | type="password"
81 | placeholder="Type in your password"
82 | />
83 | signinReq()}
85 | mb="15px"
86 | fontSize="14px"
87 | color="white"
88 | type="submit"
89 | cursor="pointer"
90 | value="Continue with email"
91 | bg="#003B95"
92 | fontWeight="500"
93 | _hover={{ bg: "#265cad" }}
94 | />
95 |
96 |
97 | By signing in or creating an account, you agree with our{" "}
98 |
103 | terms and privacy policy.
104 | {" "}
105 |
106 |
107 |
108 | Or connect with
109 |
110 |
111 |
116 |
121 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | Don’t have an account yet?{" "}
136 |
141 | Sign up here!
142 | {" "}
143 |
144 |
145 | All rights reserved. Copyright (2006 - 2022) - Booking.com™
146 |
147 |
148 |
149 | );
150 | };
151 |
152 | export default Signin;
153 |
--------------------------------------------------------------------------------
/tripBook.com/components/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Box, Button, Grid, Image, Input, Text } from "@chakra-ui/react"
3 |
4 |
5 | const Footer = () => {
6 | return (
7 |
8 | {/* *****************************************************footer Section 1 start********************************************************** */}
9 |
10 |
11 | Save time, save money!
12 | Sign up and we'll send the best deals to you
13 |
14 |
15 | Subscribe
16 |
17 |
18 |
19 | {/* *****************************************************footer Section 1 end********************************************************** */}
20 |
21 | List your property
22 |
23 |
24 | Mobile version
25 | Manage your bookings
26 | Customer service help
27 | Become an affiliate
28 | Booking.com for Business
29 |
30 |
31 |
32 | {/* *****************************************************footer Section 2 end********************************************************** */}
33 |
34 |
35 |
36 | Countries
37 | Regions
38 | Cities
39 | Districts
40 | Airports
41 | Hotels
42 | Places of interest
43 |
44 |
45 | Homes
46 | Apartments
47 | Resorts
48 | Villas
49 | Hotels
50 | B&Bs
51 | Guest houses
52 |
53 |
54 | Unique places to stay
55 | All destinations
56 | Discover
57 | Reviews
58 | Unpacked: Travel articles
59 | ravel Communities
60 | Seasonal and holiday deals
61 |
62 |
63 | Car hire
64 | Flight finder
65 | Restaurant reservations
66 |
67 |
68 | Coronavirus (COVID-19) FAQs
69 | About Booking.com
70 | Customer Service help
71 | Partner help
72 | Careers
73 | Sustainability
74 | Safety resource centre
75 | Investor relations
76 | Terms & Conditions
77 | Partner dispute
78 | How we work
79 |
80 |
81 |
82 | {/* *****************************************************footer Section 3 end********************************************************** */}
83 |
84 |
85 | Extranet login
86 |
87 | {/* *****************************************************footer Section 4 end********************************************************** */}
88 |
89 | {/* *****************************************************footer Section 5 start********************************************************** */}
90 |
91 | Booking.com is part of Booking Holdings Inc., the world leader in online travel and related services.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | {/* *****************************************************footer Section 5 end********************************************************** */}
105 |
106 | )
107 | }
108 |
109 | export default Footer
110 |
--------------------------------------------------------------------------------
/tripBook.com/pages/signup.js:
--------------------------------------------------------------------------------
1 | import {
2 | VStack,
3 | Box,
4 | Input,
5 | Text,
6 | FormControl,
7 | FormLabel,
8 | Link,
9 | Heading,
10 | Flex,
11 | } from "@chakra-ui/react";
12 | import { useContext, useState } from "react";
13 | import { useRouter } from "next/router";
14 |
15 | import { BsGithub } from "react-icons/bs";
16 | import axios from "axios";
17 | import { AuthContext } from "../context/AuthContextProvider";
18 | import Navbar from "../components/navbarSection/navbar";
19 |
20 | const Signup = () => {
21 | const [name, setName] = useState("");
22 | const [email, setEmail] = useState("");
23 | const [password, setPassword] = useState("");
24 | const router = useRouter();
25 | const { auth, setAuth } = useContext(AuthContext);
26 |
27 | const reset = () => {
28 | setName("");
29 | setEmail("");
30 | setPassword("");
31 | };
32 |
33 | const signupUserReq = async () => {
34 | const res = await axios.post("/api/user/signup", {
35 | name,
36 | email,
37 | password,
38 | });
39 | console.log(res.data);
40 | if (res.data.user) {
41 | setAuth({ ...auth, isReg: res.data.user });
42 | console.log(auth)
43 | reset();
44 | router.push("/signin");
45 | }
46 | };
47 |
48 | const signupDealerReq = async () => {
49 | const res = await axios.post("/api/user/signup/dealer", {
50 | name,
51 | email,
52 | password,
53 | });
54 | console.log(res.data);
55 | if (res.data.user) {
56 | setAuth({ ...auth, isReg: res.data.user });
57 | console.log(auth)
58 | reset();
59 | router.push("/signin");
60 | }
61 | };
62 |
63 | return (
64 | <>
65 |
66 |
67 |
68 |
75 | Create an account
76 |
77 |
78 |
79 |
80 |
81 | Name
82 |
83 | setName(target.value)}
85 | mb="15px"
86 | type="text"
87 | placeholder="Type in your first and last name"
88 | />
89 |
90 | Email
91 |
92 | setEmail(target.value)}
94 | mb="15px"
95 | type="email"
96 | placeholder="Type in your email address"
97 | />
98 |
99 | Password
100 |
101 | setPassword(target.value)}
103 | mb="15px"
104 | type="password"
105 | placeholder="Type in your password"
106 | />
107 | signupUserReq()}
109 | mb="15px"
110 | fontSize="14px"
111 | color="white"
112 | type="submit"
113 | cursor="pointer"
114 | value="Signup as a user"
115 | bg="#003B95"
116 | fontWeight="500"
117 | _hover={{ bg: "#265cad" }}
118 | />
119 | signupDealerReq()}
121 | mb="15px"
122 | fontSize="14px"
123 | color="white"
124 | type="submit"
125 | cursor="pointer"
126 | value="Signup as a dealer"
127 | bg="#003B95"
128 | fontWeight="500"
129 | _hover={{ bg: "#265cad" }}
130 | />
131 |
132 |
133 | By signing in or creating an account, you agree with our{" "}
134 |
139 | terms and privacy policy.
140 | {" "}
141 |
142 |
143 |
144 | Or connect with
145 |
146 |
147 |
152 |
157 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | Are you already registered?{" "}
172 |
177 | Log in here
178 | {" "}
179 |
180 |
181 | All rights reserved. Copyright (2006 - 2022) - Booking.com™
182 |
183 |
184 |
185 | >
186 |
187 | );
188 | };
189 |
190 | export default Signup;
191 |
--------------------------------------------------------------------------------
/tripBook.com/pages/property/index.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Button,
4 | Flex,
5 | Text,
6 | Menu,
7 | MenuButton,
8 | MenuList,
9 | MenuItemOption,
10 | MenuOptionGroup,
11 | } from "@chakra-ui/react";
12 |
13 | import { BiChevronDown } from "react-icons/bi";
14 | import FilterBox from "../../components/Filters";
15 | import SearchCard from "../../components/SearchCard";
16 | import SearchForm from "../../components/SearchForm";
17 | import { useRouter } from "next/router";
18 |
19 | import { useEffect, useState } from "react";
20 | import Navbar from "../../components/navbarSection/navbar";
21 | import { connect } from "../../db.connect";
22 | import { PropertyModel } from "../../models/property.model";
23 |
24 | const Property = ({ data }) => {
25 | const router = useRouter();
26 | const { city } = router.query;
27 | const [sort, setSort] = useState("TopPicks");
28 | const [filter, setFilter] = useState("");
29 | const filters = ["Rating", "Reviews", "Price"];
30 |
31 | useEffect(() => {
32 | router.push({
33 | pathname: "/property",
34 | query: { city: city, filterBy: filter }
35 | });
36 | },[filter])
37 |
38 | useEffect(() => {
39 | router.push({
40 | pathname: "/property",
41 | query: { city: city, sortBy: sort},
42 | });
43 | }, [sort]);
44 |
45 | return (
46 | <>
47 |
48 |
55 |
56 |
57 |
58 |
59 |
60 | Filter by:
61 |
62 |
63 | Popular filters
64 | {filters.map((el, i) => (
65 |
66 | ))}
67 |
68 |
69 |
70 |
75 |
76 | {city}: {data.length} properties found
77 |
78 |
79 | }
87 | >
88 | Sort By: {sort}
89 |
90 |
91 | {
93 | setSort(value);
94 | }}
95 | defaultValue="Top picks"
96 | type="radio"
97 | >
98 | Our top picks
99 |
100 |
101 | Rating (Highest)
102 |
103 |
104 | Rating (Lowest)
105 |
106 |
107 | Top reviewed
108 |
109 | Low Price
110 | High Price
111 |
112 |
113 |
114 | {data.map((el) => (
115 |
131 | ))}
132 |
133 |
134 | >
135 | );
136 | };
137 |
138 | export const getServerSideProps = async (context) => {
139 | const { city, sortBy, filterBy } = context.query;
140 |
141 | try {
142 | await connect();
143 | } catch (e) {
144 | console.log(e);
145 | }
146 |
147 | let properties = await PropertyModel.find({ city });
148 |
149 | if (sortBy) {
150 | switch (sortBy) {
151 | case "TopReviewed":
152 | case "TopPicks":
153 | {
154 | properties = await PropertyModel.find({ city }).sort({
155 | reviews: -1,
156 | });
157 |
158 | break;
159 | }
160 |
161 | case "HighestRating": {
162 | properties = await PropertyModel.find({ city }).sort({
163 | rating: -1,
164 | });
165 |
166 | break;
167 | }
168 |
169 | case "LowestRating": {
170 | properties = await PropertyModel.find({ city }).sort({ rating: 1 });
171 |
172 | break;
173 | }
174 |
175 | case "LowPrice": {
176 | properties = await PropertyModel.find({ city }).sort({
177 | price: 1,
178 | });
179 |
180 | break;
181 | }
182 |
183 | case "HighPrice": {
184 | properties = await PropertyModel.find({ city }).sort({
185 | price: -1,
186 | });
187 |
188 | break;
189 | }
190 |
191 | default:
192 | break;
193 | }
194 | }
195 |
196 | if(filterBy){
197 | switch(filterBy){
198 | case "Price" : {
199 | properties = await PropertyModel.find({$and:[{city}, {price: { $lte: 6000}}]}).sort();
200 |
201 | break;
202 | }
203 |
204 | case "Reviews" : {
205 | properties = await PropertyModel.find({$and:[{city}, {reviews: { $gte: 50}}]});
206 |
207 | break;
208 | }
209 |
210 | case "Rating" : {
211 | properties = await PropertyModel.find({$and:[{city}, {rating: { $gte: 9}}]});
212 |
213 | break;
214 | }
215 |
216 | default:
217 | break;
218 | }
219 | }
220 |
221 |
222 | return {
223 | props: {
224 | data: JSON.parse(JSON.stringify(properties)),
225 | },
226 | };
227 | };
228 |
229 | export default Property;
230 |
--------------------------------------------------------------------------------
/tripBook.com/components/navbarSection/navbar.js:
--------------------------------------------------------------------------------
1 | import styles from "./navbar.module.css";
2 | import Link from "next/link";
3 | import { Icon } from "@chakra-ui/icons";
4 | import jwt from "jsonwebtoken";
5 |
6 | import {
7 | IoAirplaneOutline,
8 | IoBedOutline,
9 | IoCarOutline,
10 | IoCarSportOutline,
11 | IoFlowerOutline,
12 | } from "react-icons/io5";
13 | import { RiCommunityLine } from "react-icons/ri";
14 | import {
15 | Avatar,
16 | Box,
17 | Button,
18 | Container,
19 | Flex,
20 | HStack,
21 | Image,
22 | useToast,
23 | } from "@chakra-ui/react";
24 | import DraverNav from "./draverNav";
25 | import { AuthContext } from "../../context/AuthContextProvider";
26 | import { useContext } from "react";
27 | import { useRouter } from "next/router";
28 | let TSEC = "hello";
29 |
30 | function Navbar() {
31 | const toast = useToast();
32 | const { auth, setAuth } = useContext(AuthContext);
33 | const router = useRouter();
34 |
35 |
36 | const SignoutReq = () => {
37 | setAuth({ ...auth, isAuth: "" });
38 | router.push("/");
39 | };
40 |
41 | const checkToken = () => {
42 | if (!auth.isAuth) {
43 | return router.push("/signin");
44 | } else {
45 | const check = jwt.verify(
46 | auth.isAuth.token,
47 | TSEC,
48 | (err, verified) => {
49 | if (err) {
50 | console.log(err);
51 | toast({
52 | title: "Sessioned timed out!",
53 | description: "Please relogin.",
54 | status: "error",
55 | duration: 3400,
56 | isClosable: true,
57 | position: "top",
58 | });
59 | return router.push("/signin");
60 | } else {
61 | if (verified.role === "dealer") {
62 | console.log(verified.role);
63 | return router.push("/listproperty");
64 | } else {
65 | router.push("/");
66 | toast({
67 | title: "You're not a dealer.",
68 | description: "Please login as a dealer",
69 | status: "warning",
70 | duration: 3400,
71 | isClosable: true,
72 | position: "top",
73 | });
74 | }
75 | }
76 | }
77 | );
78 | }
79 | };
80 |
81 | return (
82 | <>
83 | {/* */}
84 |
85 |
92 |
100 |
101 |
102 |
106 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | INR
121 |
122 |
123 |
124 |
125 |
134 |
135 |
136 |
137 | {" "}
138 |
139 |
140 |
141 | checkToken()}
143 | colorScheme="blue"
144 | >
145 | List your property
146 |
147 |
148 | {auth.isAuth ? (
149 | <>
150 | SignoutReq()}
152 | className={styles.authLink}
153 | >
154 | Sign out
155 |
156 |
157 | >
158 | ) : (
159 | <>
160 |
161 | Register
162 |
163 |
164 |
165 | Sign in
166 |
167 | >
168 | )}
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
180 |
181 |
182 |
183 | Stays
184 |
185 |
186 |
187 |
188 | Flights
189 |
190 |
191 |
192 |
193 | Flights + Hotel
194 |
195 |
196 |
197 |
198 | Car rentals
199 |
200 |
201 |
202 |
203 | Attractions
204 |
205 |
206 |
207 |
208 | Airport taxis
209 |
210 |
211 |
212 |
213 |
214 | >
215 | );
216 | }
217 |
218 | export default Navbar;
219 |
--------------------------------------------------------------------------------
/tripBook.com/components/searchBox/searchBox.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Input,
4 | InputGroup,
5 | InputLeftElement,
6 | Text,
7 | Button,
8 | Popover,
9 | PopoverTrigger,
10 | PopoverContent,
11 | PopoverHeader,
12 | PopoverBody,
13 | PopoverArrow,
14 | PopoverCloseButton,
15 | Portal,
16 | } from "@chakra-ui/react";
17 | import { SearchIcon } from "@chakra-ui/icons";
18 | import { useContext, useState } from "react";
19 | import DatePicker from "../DatePicker";
20 | import Link from "next/link";
21 | import { GuestContext } from "../../context/GuestContext";
22 |
23 | const SearchBox = () => {
24 | const [inputData , setInputData] = useState("");
25 | return (
26 | <>
27 |
42 |
43 |
49 | Find your next stay
50 |
51 |
56 | Search low prices on hotels, homes and much more...
57 |
58 |
59 |
60 |
84 |
85 | }
88 | />
89 | setInputData(target.value)}
96 | />
97 |
98 |
99 |
100 |
101 | {/* */}
102 |
103 |
104 |
121 | Search
122 |
123 |
124 |
125 |
126 | >
127 | );
128 | };
129 | export default SearchBox;
130 |
131 | function Pop() {
132 | const {
133 | adult,
134 | handleIncre,
135 | handledec,
136 | childrens,
137 | handlechildrenIncre,
138 | handlechildrenDec,
139 | room,
140 | handleroomIncre,
141 | handleroomDec,
142 | } = useContext(GuestContext);
143 |
144 | return (
145 |
146 |
147 |
163 | {adult} adults
164 | {childrens} children
165 | {room} rooms
166 |
167 |
168 |
169 |
170 |
171 | Header
172 |
173 |
174 | Adult
175 |
181 | -
182 |
183 | {adult}
184 |
189 | +
190 |
191 |
192 |
193 | Children
194 |
200 | -
201 |
202 | {childrens}
203 |
208 | +
209 |
210 |
211 |
212 | Room
213 |
219 | -
220 |
221 | {room}
222 |
227 | +
228 |
229 |
230 |
231 |
232 |
233 | );
234 | }
235 |
--------------------------------------------------------------------------------
/tripBook.com/components/explore/nextTrip.js:
--------------------------------------------------------------------------------
1 | import { Box, Text } from "@chakra-ui/react";
2 | export const Nextrip = () => {
3 | return (
4 | <>
5 |
11 |
17 | Get inspiration for your next trip
18 |
19 |
20 |
31 |
41 |
48 |
62 | Europe's best but less obvious group holiday spots
63 |
64 |
77 | The best place in europe for an idyllic late-summer escape with
78 | friends.
79 |
80 |
81 |
82 |
91 |
98 |
104 | The USA’s 9 most beautiful beaches
105 |
106 |
111 | The finest stretches of sand to be found in North America.
112 |
113 |
114 |
115 |
116 |
117 |
139 |
155 |
162 |
176 | 48 hours in Paris, France
177 |
178 |
190 | The perfect 2-day itinerary for visiting The City of Light.
191 |
192 |
193 |
194 |
213 |
220 |
226 | The 9 most beautiful cities for autumn travel
227 |
228 |
234 | From soaking in Seoul’s hot springs to tucking into sticky
235 | cinnamon rolls in Montreal.
236 |
237 |
238 |
239 |
256 |
257 |
270 | Top 5 US cities to celebrate Labor Day Weekend
271 |
272 |
285 | Leave summer with no regrets when you head to these cities for
286 | Labor Day Weekend.
287 |
288 |
289 |
290 |
291 |
292 | >
293 | );
294 | };
295 |
--------------------------------------------------------------------------------
/tripBook.com/pages/property/[id]/index.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | Text,
4 | Breadcrumb,
5 | BreadcrumbItem,
6 | BreadcrumbLink,
7 | Button,
8 | Flex,
9 | Image,
10 | Accordion,
11 | AccordionItem,
12 | AccordionButton,
13 | AccordionIcon,
14 | AccordionPanel,
15 | } from "@chakra-ui/react";
16 | import { ChevronRightIcon } from "@chakra-ui/icons";
17 | import { HiStar, HiShare } from "react-icons/hi";
18 | import { AiFillLike, AiOutlineHeart } from "react-icons/ai";
19 | import { BsTags } from "react-icons/bs";
20 | import { VscLocation } from "react-icons/vsc";
21 | import React, { useEffect, useState } from "react";
22 | import SearchForm from "../../../components/SearchForm";
23 | import { useRouter } from "next/router";
24 | import Link from "next/link";
25 | import Navbar from "../../../components/navbarSection/navbar";
26 | import LoadingScreen from "../../../components/pre_loader/loadingScreen";
27 | import { PropertyModel } from "../../../models/property.model";
28 | import { connect } from "../../../db.connect";
29 |
30 | const HotelDetails = ({ data }) => {
31 |
32 | const [loading, setLoading] = useState(false);
33 |
34 | useEffect(() => {
35 | setLoading(true);
36 | }, []);
37 |
38 | const { query } = useRouter();
39 | const { id } = query;
40 | console.log(id)
41 |
42 | return (
43 |
44 | {/* ********************************************************************************************* */}
45 | { loading?
46 | <>
47 |
48 |
49 |
50 |
51 |
52 |
53 | Coronavirus (COVID-19) Support
54 |
55 |
56 |
57 |
58 |
59 | Get the travel advice you need. Read more about possible travel
60 | restrictions before you go.
61 |
62 |
63 |
64 |
65 |
66 | }
69 | >
70 |
71 | Home
72 |
73 |
74 |
75 | List of properties
76 |
77 |
78 |
79 | HotelDetails
80 |
81 |
82 |
83 |
84 | {/* ********************************************************************************************* */}
85 |
86 |
87 |
93 |
94 | {" "}
95 |
96 |
97 | We Price Match
98 | {" "}
99 |
100 |
101 |
102 |
107 |
113 | Info & prices
114 |
115 |
121 | Facilities
122 |
123 |
129 | House rules
130 |
131 | {`Guest Reviews ${"(rating)"}`}
137 |
138 |
139 |
144 |
145 | Hotel
146 |
147 |
148 |
149 |
150 | {" "}
151 |
158 | {" "}
159 |
160 |
161 |
168 | Great for two travellers
169 |
170 |
171 |
172 |
180 |
181 |
182 |
183 | Reserve
184 |
185 |
186 |
187 |
188 |
189 |
190 | {data.title}
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | {/* ********************************************************************************************* */}
207 |
216 |
217 | {data.TravelText2}
218 |
219 | {
220 | "Placed in the heart of Goa’s Port City just 4 km away from Dabolim Airport, La-Paz Gardens Beacon Hotel - Vasco da Gama Goa provides well appointed rooms with free WiFi access. It also houses a spacious outdoor pool and sauna facilities."
221 | }
222 |
223 |
224 | {
225 | "Rooms are furnished with air-conditioning, a seating area, a desk, a fan, a flat-screen TV with satellite channels and a minibar. Hot/cold shower facilities and free toiletries are included in an en suite bathroom."
226 | }
227 |
228 |
229 | {
230 | "Enjoy a good workout at the fitness centre or indulge in a game of table tennis while a 24-hour front desk can assist with car rentals, laundry/ironing services, currency exchange and room service."
231 | }
232 |
233 |
234 | {
235 | "Couples particularly like the location — they rated it 8.0 for a two-person trip."
236 | }
237 |
238 |
239 |
240 | {
241 | "La-Paz Gardens Beacon Hotel - Vasco da Gama Goa has been welcoming Booking.com guests since 2 Jan 2013."
242 | }
243 |
244 |
245 | {"Most popular facilities"}
246 |
247 |
248 |
249 | {"ATM and Currency Exchange:"}
250 |
251 | Need cash? There's an ATM machine and a currency exchange service at
252 | this property.{" "}
253 |
254 |
255 |
256 |
257 | {"Property highlights"}
258 |
259 |
260 |
261 | {"Top location: Highly rated by recent guests (8.0)"}
262 |
263 |
264 | {"Breakfast info"}
265 |
266 | {"Buffer"}
267 |
268 |
269 |
270 |
276 | Reserve
277 |
278 |
279 |
280 | Save the property
281 |
282 |
283 |
284 |
285 | ) >:( )
286 |
287 | }
288 |
289 | );
290 | };
291 |
292 | export const getServerSideProps = async (context) => {
293 | const { id } = context.query;
294 |
295 | try {
296 | await connect();
297 | } catch (e) {
298 | console.log(e);
299 | }
300 |
301 | const property = await PropertyModel.findOne({ _id: id });
302 |
303 | return {
304 | props: {
305 | data: JSON.parse(JSON.stringify(property)),
306 | },
307 | };
308 | };
309 |
310 | export default HotelDetails;
311 |
--------------------------------------------------------------------------------
/tripBook.com/pages/property/[id]/info.js:
--------------------------------------------------------------------------------
1 | import {
2 | Box,
3 | HStack,
4 | VStack,
5 | Text,
6 | Divider,
7 | Stack,
8 | Image,
9 | FormLabel,
10 | Input,
11 | Select,
12 | Textarea,
13 | Button,
14 | SimpleGrid,
15 | Center,
16 | useToast
17 | } from "@chakra-ui/react";
18 | import { MdOutlineCreditCardOff } from "react-icons/md";
19 | import { IoCheckmarkDone } from "react-icons/io5";
20 | import { MdOutlineLocalParking } from "react-icons/md";
21 | import { MdOutlineRestaurant } from "react-icons/md";
22 | import { MdLocalAirport } from "react-icons/md";
23 | import { useRouter } from "next/router";
24 | import { FaSwimmingPool } from "react-icons/fa";
25 | import Navbar from "../../../components/navbarSection/navbar";
26 | import { useContext, useEffect, useState } from "react";
27 | import { GuestContext } from "../../../context/GuestContext";
28 | import Link from "next/link";
29 | import LoadingScreen from "../../../components/pre_loader/loadingScreen";
30 | import { PropertyModel } from "../../../models/property.model";
31 | import { connect } from "../../../db.connect";
32 | export default function Info({ data }) {
33 | const { date, adult, childrens, room } = useContext(GuestContext);
34 | let CheckIn = date[0].toString().split(" ");
35 | let CheckOut = date[1].toString().split(" ");
36 | console.log(CheckIn, CheckOut);
37 |
38 | const { query } = useRouter();
39 | const { id } = query;
40 | const toast = useToast();
41 |
42 | const [name, setName] = useState("");
43 | const [email, setEmail] = useState("");
44 | const [email1, setEmail1] = useState("");
45 | const [guestName, setGuestName] = useState("");
46 | const [request, setRequest] = useState("");
47 | const [floor, setFloor] = useState("");
48 | const [guest, setGuest] = useState("");
49 | const [loading, setLoading] = useState(false);
50 | useEffect(() => {
51 | setLoading(true);
52 | }, []);
53 |
54 | function callSubmit() {
55 | if (
56 | name === "" ||
57 | email === "" ||
58 | email1 === "" ||
59 | guestName === "" ||
60 | request === ""
61 | ) {
62 | return toast({
63 | title: "Please fill all the required fields.",
64 | description: " All fields are mandatory.",
65 | status: "warning",
66 | duration: 3400,
67 | isClosable: true,
68 | });
69 | }
70 | toast({
71 | title: "Booking Succesfull.",
72 | description: "Enjoy our stay!",
73 | status: "success",
74 | duration: 3400,
75 | isClosable: true,
76 | });
77 | setName("");
78 | setEmail("");
79 | setEmail1("");
80 | setGuestName("");
81 | setRequest("");
82 | setGuest("");
83 | setFloor("");
84 | }
85 |
86 | return (
87 | <>
88 | {loading?(<>
89 |
90 |
91 |
92 |
98 |
99 |
100 |
101 | Your booking details
102 |
103 |
104 |
105 |
106 |
107 | Check-in
108 |
109 |
110 | {CheckIn[0] +
111 | " " +
112 | CheckIn[1] +
113 | " " +
114 | CheckIn[2] +
115 | " " +
116 | CheckIn[3]}
117 |
118 | {CheckIn[4]}
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | Check-out
128 |
129 |
130 | {CheckOut[0] +
131 | " " +
132 | CheckOut[1] +
133 | " " +
134 | CheckOut[2] +
135 | " " +
136 | CheckOut[3]}
137 |
138 | {CheckOut[4]}
139 |
140 |
141 |
142 |
143 | Total length of stay:
144 |
145 |
146 | {CheckOut[2] - CheckIn[2]} Days
147 |
148 |
149 |
150 |
151 |
152 | You selected:
153 |
154 |
155 | Deluxe Double or Twin Room with Balcony
156 |
157 |
164 | Change your selection
165 |
166 |
167 |
168 |
169 |
176 | Price Breakdown
177 |
178 | {adult} Adults {" "} (Price x {adult})
179 |
180 |
181 | {childrens} Children {" "} (No extra charge!)
182 |
183 |
184 | {room} Room(s) {" "} (Price x {room})
185 |
186 |
187 |
188 |
189 | ₹{" "}
190 | {data.price *
191 | adult *
192 | (childrens / 2) *
193 | room *
194 | (CheckOut[2] - CheckIn[2])}
195 |
196 |
202 | No Surprises! Final price.
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 | {/* 2nd vstack */}
211 |
217 | {/* 1st stack */}
218 |
219 |
220 |
221 |
222 |
223 | Hotel
224 |
225 |
226 | {data.title}
227 |
228 | {data.city}
229 |
230 |
231 |
232 |
233 | Parking
234 |
235 |
236 |
237 |
238 | Restaurant
239 |
240 |
241 |
242 |
243 | Airport
244 |
245 |
246 |
247 |
248 |
249 | Swimming
250 |
251 |
252 |
253 |
254 |
255 | {/* 2nd Stack starts*/}
256 |
257 |
258 |
259 | Good to know:
260 |
261 |
262 |
263 | No credit card needed!
264 |
265 |
266 | {/* react icons */}
267 |
268 | Free cancellation until 23:59 on 13 December 2022
269 |
270 |
271 |
272 | No payment needed today. You'll pay when you stay.
273 |
274 |
275 |
276 | {/* 3rd stack */}
277 |
284 |
285 |
286 | {" "}
287 | Enter your details
288 |
289 |
290 | Almost done! Just fill in the * required info
291 |
292 |
293 |
294 |
295 | Full name *
296 | setName(e.target.value)}
299 | h={"33px"}
300 | w={{ base: "74%", md: "55%", lg: "65%" }}
301 | placeholder="Enter your full name"
302 | bgColor={"white"}
303 | />
304 | Email Address *
305 | setEmail(e.target.value)}
308 | bgColor={"white"}
309 | h={"33px"}
310 | w={{ base: "74%", md: "55%", lg: "65%" }}
311 | placeholder="Enter your email address"
312 | />
313 |
314 |
315 | Confirm Email Address *
316 |
317 | setEmail1(e.target.value)}
320 | bgColor={"white"}
321 | h={"33px"}
322 | w={{ base: "74%", md: "55%", lg: "65%" }}
323 | placeholder="Enter your email address"
324 | />
325 |
326 |
327 |
328 | Guests:
329 |
330 |
331 | setGuest(e.target.value)}
334 | bgColor={"white"}
335 | placeholder="1"
336 | fontSize={"15px"}
337 | height={"32px"}
338 | w={"70px"}
339 | >
340 | 2
341 | 3
342 | 4
343 |
344 |
345 |
346 | Full guest name *
347 |
348 | setGuestName(e.target.value)}
351 | bgColor={"white"}
352 | w={{ base: "74%", md: "55%", lg: "65%" }}
353 | placeholder="Please enter full guest name"
354 | h={"33px"}
355 | />
356 |
357 |
358 |
359 | Floor preference
360 |
361 |
362 | setFloor(e.target.value)}
366 | bgColor={"white"}
367 | placeholder="No preference"
368 | fontSize={"15px"}
369 | height={"39px"}
370 | >
371 | High floor
372 | Ground floor
373 |
374 |
375 |
376 |
377 | {/* 4th stack */}
378 |
384 |
390 |
391 | Special requests
392 |
393 |
394 | Special requests cannot be guaranteed – but the property will do
395 | its best to meet your needs. You can always make a special
396 | request after your booking is complete!
397 |
398 |
399 |
400 | Please write your requests in English or Hindi.
401 |
402 |
411 |
412 |
413 |
417 | Submit
418 |
419 |
420 |
423 | Home
424 | {" "}
425 |
426 |
427 |
428 |
429 |
430 | > ):( )}
431 | >
432 | );
433 | }
434 |
435 | export const getServerSideProps = async (context) => {
436 | const { id } = context.query;
437 |
438 | try {
439 | await connect();
440 | } catch (e) {
441 | console.log(e);
442 | }
443 |
444 | const property = await PropertyModel.findOne({ _id: id });
445 |
446 | return {
447 | props: {
448 | data: JSON.parse(JSON.stringify(property)),
449 | },
450 | };
451 | }
452 |
--------------------------------------------------------------------------------
/tripBook.com/pages/index.js:
--------------------------------------------------------------------------------
1 | import BgComponent from "../components/backgroundImg/bgComponent";
2 | import { Slideshow } from "../components/explore/slideShow";
3 | import SearchBox from "../components/searchBox/searchBox";
4 | import { Box, Button, Image, Text } from "@chakra-ui/react";
5 | import { Nextrip } from "../components/explore/nextTrip";
6 | import ConnectWithtravellers from "../components/explore/connectTravellers";
7 | import Navbar from "../components/navbarSection/navbar";
8 | function Stay() {
9 | // { slideImages, slide, travel, stay }
10 | // console.log(travel);
11 | const slideImages = [
12 | {
13 | url: "https://cf.bstatic.com/xdata/images/region/square250/49646.webp?k=b7f38878b9164ee38e0b99c4d4646dbea76b7bf4add8464b1aa75e4c9d0efc6e&o=",
14 | caption: "goa",
15 | property: "5,242 properties",
16 | },
17 | {
18 | url: "https://cf.bstatic.com/xdata/images/city/square250/971346.webp?k=40eeb583a755f2835f4dcb6900cdeba2a46dc9d50e64f2aa04206f5f6fce5671&o=",
19 | caption: "Mumbai",
20 | property: "1,652 properties",
21 | },
22 | {
23 | url: "https://cf.bstatic.com/xdata/images/city/square250/684765.webp?k=3f7d20034c13ac7686520ac1ccf1621337a1e59860abfd9cbd96f8d66b4fc138&o=",
24 | caption: "delhi",
25 | property: "2,912 properties",
26 | },
27 | {
28 | url: "https://cf.bstatic.com/xdata/images/city/square250/684682.webp?k=30cf9de93f2a0f87eed7d2d0d9b3e6eccd5dcf3a4b68b4e0151c0800ddc84af7&o=",
29 | caption: "Lonavala",
30 | property: "751 properties",
31 | },
32 | {
33 | url: "https://cf.bstatic.com/xdata/images/city/square250/684534.webp?k=d1fe86c22f2433f4e2dda14ddcbe80feb024b0fb30305e5684a1241fba5d4cff&o=",
34 | caption: "Banglore",
35 | property: "2,039 properties",
36 | },
37 | {
38 | url: "https://cf.bstatic.com/xdata/images/city/square250/684657.webp?k=66dc5035b43e9bb86b756e381e4fec2558064af4a63a8af17836725a854c03ee&o=",
39 | caption: "Jaipur",
40 | property: "1,558 properties",
41 | },
42 | {
43 | url: "https://cf.bstatic.com/xdata/images/city/square250/684769.webp?k=146b18e42b9eb74078f2e80e07e573e8dbac879208b86bae451f99882f566a99&o=",
44 | caption: "Pondicherry",
45 | property: "651 properties",
46 | },
47 | {
48 | url: "https://cf.bstatic.com/xdata/images/city/square250/684938.webp?k=9d07ff707ce59768769b5e9a5381a4c705d921209dafd8fd0e2f1a6acdf0c68a&o=",
49 | caption: "Udaipur",
50 | property: "816 properties",
51 | },
52 | {
53 | url: "https://cf.bstatic.com/xdata/images/region/square250/68606.webp?k=4b43b9128b79beaab4ca2e8c038ddf5709b0b90608afbca222cfbe08fabda7d2&o=",
54 | caption: "North Goa",
55 | property: "3,903 properties",
56 | },
57 | {
58 | url: "https://cf.bstatic.com/xdata/images/city/square250/684919.webp?k=0a73fce29109503c055e288c413d9a1c5bd66fdb26f01c1438e8017b0b64b42f&o=",
59 | caption: "Ooty",
60 | property: "470 properties",
61 | },
62 | ];
63 |
64 | const slide = [
65 | {
66 | url: "https://q-xx.bstatic.com/xdata/images/xphoto/300x240/57584488.jpeg?k=d8d4706fc72ee789d870eb6b05c0e546fd4ad85d72a3af3e30fb80ca72f0ba57&o=",
67 |
68 | caption: "Hotels",
69 | property: "892,472 hotels",
70 | },
71 | {
72 | url: "https://q-xx.bstatic.com/xdata/images/hotel/300x240/119467716.jpeg?k=f3c2c6271ab71513e044e48dfde378fcd6bb80cb893e39b9b78b33a60c0131c9&o=",
73 | caption: "Apartments",
74 | property: "926,012 apartments",
75 | },
76 | {
77 | url: "https://r-xx.bstatic.com/xdata/images/xphoto/300x240/45450084.jpeg?k=f8c2954e867a1dd4b479909c49528531dcfb676d8fbc0d60f51d7b51bb32d1d9&o=",
78 | caption: "Resorts",
79 | property: "18,252 resorts",
80 | },
81 | {
82 | url: "https://q-xx.bstatic.com/xdata/images/hotel/300x240/100235855.jpeg?k=5b6e6cff16cfd290e953768d63ee15f633b56348238a705c45759aa3a81ba82b&o=",
83 | caption: "Villas",
84 | property: "482,715 villas",
85 | },
86 | {
87 | url: "https://r-xx.bstatic.com/xdata/images/xphoto/300x240/45450074.jpeg?k=7039b03a94f3b99262c4b3054b0edcbbb91e9dade85b6efc880d45288a06c126&o=",
88 | caption: "Cottages",
89 | property: "158,612 cottages",
90 | },
91 | {
92 | url: "https://q-xx.bstatic.com/xdata/images/xphoto/300x240/45450090.jpeg?k=52f6b8190edb5a9c91528f8e0f875752ce55a6beb35dc62873601e57944990e4&o=",
93 | caption: "Glamping",
94 | property: "14,004 glamping sites",
95 | },
96 | {
97 | url: "https://q-xx.bstatic.com/xdata/images/xphoto/300x240/45450058.jpeg?k=2449eb55e8269a66952858c80fd7bdec987f9514cd79d58685651b7d6e9cdfcf&o=",
98 | caption: "Serviced apartments",
99 | property: "35,899 serviced apartments",
100 | },
101 | {
102 | url: "https://r-xx.bstatic.com/xdata/images/xphoto/300x240/45450113.jpeg?k=76b3780a0e4aacb9d02ac3569b05b3c5e85e0fd875287e9ac334e3b569f320c7&o=",
103 | caption: "Holiday homes",
104 | property: "482,715 holiday homes",
105 | },
106 | ];
107 |
108 | const travel = [
109 | {
110 | caption: "Genuius",
111 | property: "mandloi, you're at Genius Level 1 in our loyalty programme",
112 | url: "https://cf.bstatic.com/xdata/images/xphoto/800x640/140040902.jpg?k=cc640a6bf0d56605d51d2efd34e35408aa55daab0b586be469fe7f9b6ed76518&o=",
113 | },
114 | {
115 | caption: "10% discounts",
116 | property: "Enjoy discounts at participating properties worldwide",
117 | url: "https://cf.bstatic.com/xdata/images/xphoto/800x640/140041070.jpg?k=93264b873c5d521f0c7dea5b7c20bab417016f80f68fb4e962020cbedc7e0ec8&o=",
118 | },
119 | {
120 | caption: "15% discounts",
121 | property: "Complete 5 stays to unlock Genius Level-2 limited time offer",
122 | url: "https://cf.bstatic.com/xdata/images/xphoto/800x640/140041021.jpg?k=50ca96e9a096248007c928276d12e5dad282fd03e2ea1823fda7a760db536763&o=",
123 | },
124 | {
125 | caption: "Free breakfasts",
126 | property: "Complete 5 stays to unlock Genius Level 2 limited time offer",
127 | url: "https://cf.bstatic.com/xdata/images/xphoto/800x640/140052024.jpg?k=b8f74619b3aec947be473a2cf34007c61c2d04cf75d0c0341f743fd221340b7e&o=",
128 | },
129 | {
130 | caption: "Free room upgrades",
131 | property: "Complete 5 stays to unlock Genius Level 2 limited time offer",
132 | url: "https://cf.bstatic.com/xdata/images/xphoto/800x640/140050120.jpg?k=beffc8d06a6e85cdde5efe2afee5629446aa3f5196827172d4fdc507b2fcae34&o=",
133 | },
134 | ];
135 |
136 | const stay = [
137 | {
138 | caption: "Genuius",
139 | property: "mandloi, you're at Genius Level 1 in our loyalty programme",
140 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/286659200.webp?k=9206fc9239b3e4538c22d04b85213d6d5e6257015022de8a37effd956fcde4b6&o=&s=1",
141 | },
142 | {
143 | caption: "10% discounts",
144 | property: "Enjoy discounts at participating properties worldwide",
145 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/280950287.webp?k=b984c542b8b1a2ee0e019e4491da338a85b660caa10c5e1197225c5f3052d629&o=&s=1",
146 | },
147 | {
148 | caption: "15% discounts",
149 | property: "Complete 5 stays to unlock Genius Level 2 limited time offer",
150 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/132452060.webp?k=8448bab55c87dbb42ab7c6643fbbce542124c908f63f6b36dc3cdc859e60cb0a&o=&s=1",
151 | },
152 | {
153 | caption: "Free breakfasts",
154 | property: "Complete 5 stays to unlock Genius Level 2",
155 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/187855604.webp?k=bbb45aa5b540c7608ea3af52d92b95a215df9af831dd3ae0e4c4cce501e28b1b&o=&s=1",
156 | },
157 | {
158 | caption: "Free room upgrades",
159 | property: "Complete 5 stays to unlock Genius Level 2",
160 | url: "https://cf.bstatic.com/xdata/images/hotel/square600/178421525.webp?k=262301cdcbef1d33942bb02607906eafdee8dde3106ac5732966a206baeebb04&o=&s=1",
161 | },
162 | ];
163 |
164 | return (
165 |
166 |
167 | <>
168 |
169 |
170 |
174 |
175 |
183 |
198 |
199 |
210 | Save 15% or more{" "}
211 |
212 |
222 | This summer, make your dream trip a reality. Book and stay for less
223 | before 30 Sep 2022
224 |
225 |
246 | Explore deals
247 |
248 |
249 |
250 |
251 | {/* Explore India Slider */}
252 |
253 |
259 |
260 | {/* grid section */}
261 |
262 |
263 |
272 |
282 |
294 | {" "}
295 |
301 | New Delhi
302 |
303 |
311 |
312 |
313 |
314 |
322 |
334 | {" "}
335 |
341 | Agra
342 |
343 |
351 |
352 |
353 |
354 |
355 |
356 |
365 |
377 | {" "}
378 |
384 | Agra
385 |
386 |
394 |
395 |
396 |
404 |
416 |
422 | Varanasi
423 |
424 |
432 |
433 |
434 |
442 |
454 | {" "}
455 |
461 | Mumbai
462 |
463 |
471 |
472 |
473 |
474 |
475 |
476 | {/*Browse by property type section*/}
477 |
478 |
479 |
480 | {/* travel Arround Asia */}
481 |
482 |
488 |
489 | {/* Stay at our top unique properties */}
490 |
491 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
514 | Connect with other travelers
515 |
516 |
517 |
518 |
519 | >
520 | );
521 | }
522 |
523 | export default Stay;
524 |
525 | //we can use this if we want to use data from deployed server
526 |
527 | // export const getStaticProps = async () => {
528 | // const res1 = await fetch(
529 | // "https://web-database-pravin.onrender.com/slideImages"
530 | // );
531 |
532 | // const dataSlideImage = await res1.json();
533 |
534 | // const res2 = await fetch("https://web-database-pravin.onrender.com/slide");
535 |
536 | // const dataSlide = await res2.json();
537 |
538 | // const res3 = await fetch("https://web-database-pravin.onrender.com/travel");
539 |
540 | // const dataTravel = await res3.json();
541 |
542 | // const res4 = await fetch("https://web-database-pravin.onrender.com/stay");
543 |
544 | // const dataStay = await res4.json();
545 |
546 | // return {
547 | // props: {
548 | // slideImages: dataSlideImage,
549 | // slide: dataSlide,
550 | // travel: dataTravel,
551 | // stay: dataStay,
552 | // },
553 | // };
554 | // };
555 |
--------------------------------------------------------------------------------