= (data) => {
86 | if (step !== STEPS.PRICE) {
87 | return onNext();
88 | }
89 |
90 | setIsLoading(true);
91 |
92 | axios
93 | .post("/api/listings", data)
94 | .then(() => {
95 | toast.success("Listing created!");
96 | router.refresh();
97 | reset();
98 | setStep(STEPS.CATEGORY);
99 | rentModal.onClose();
100 | })
101 | .catch(() => {
102 | toast.error("Something went wrong.");
103 | })
104 | .finally(() => {
105 | setIsLoading(false);
106 | });
107 | };
108 |
109 | const actionLabel = useMemo(() => {
110 | if (step === STEPS.PRICE) {
111 | return "Create";
112 | }
113 |
114 | return "Next";
115 | }, [step]);
116 |
117 | const secondaryActionLabel = useMemo(() => {
118 | if (step === STEPS.CATEGORY) {
119 | return undefined;
120 | }
121 |
122 | return "Back";
123 | }, [step]);
124 |
125 | let bodyContent = (
126 |
127 | {description == "" ? (
128 |
132 | ) : (
133 |
137 | )}
138 |
139 |
149 | {categories.map((item) => (
150 |
151 | {
153 | setCustomValue("category", category);
154 | setDescription(item.description);
155 | }}
156 | selected={category === item.label}
157 | label={item.label}
158 | icon={item.icon}
159 | />
160 |
161 | ))}
162 |
163 |
164 | );
165 |
166 | if (step === STEPS.LOCATION) {
167 | bodyContent = (
168 |
169 |
173 | setCustomValue("location", value)}
176 | />
177 |
178 |
179 | );
180 | }
181 |
182 | if (step === STEPS.INFO) {
183 | bodyContent = (
184 |
185 |
189 | setCustomValue("itemCount", value)}
191 | value={itemCount}
192 | title="Units"
193 | subtitle="How many units of item can you rent?"
194 | />
195 |
196 |
197 | );
198 | }
199 |
200 | if (step === STEPS.IMAGES) {
201 | bodyContent = (
202 |
203 |
207 | setCustomValue("imageSrc", value)}
209 | value={imageSrc}
210 | />
211 |
212 | );
213 | }
214 |
215 | if (step === STEPS.DESCRIPTION) {
216 | bodyContent = (
217 |
218 |
222 |
230 |
231 |
239 |
240 | );
241 | }
242 |
243 | if (step === STEPS.PRICE) {
244 | bodyContent = (
245 |
246 |
250 |
260 |
261 | );
262 | }
263 |
264 | return (
265 |
276 | );
277 | };
278 |
279 | export default RentModal;
280 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
13 |
14 |
21 |
22 | [![Contributors][contributors-shield]][contributors-url]
23 | [![Forks][forks-shield]][forks-url]
24 | [![Stargazers][stars-shield]][stars-url]
25 | [![Issues][issues-shield]][issues-url]
26 | [![LinkedIn][linkedin-shield]][linkedin-url]
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
Rentpal
36 |
37 |
38 |
39 | Introducing an innovative web application that allows users to rent anything they need with ease. The platform is built with the latest technologies, including Next.js 13 App Router, React, Tailwind, Prisma, MongoDB, NextAuth, and cloudinary for image uploading, ensuring a seamless and user-friendly experience.
40 |
41 |
42 | With advanced search and filter options, users can easily find the perfect item to rent for any occasion. The reliable and secure booking system ensures a hassle-free rental process. Plus, with the cloudinary integration, it's easy to upload and manage images, so users can see exactly what they're renting.
43 |
44 |
45 | This web application is perfect for those looking to rent a tool for a DIY project, a costume for a special event, or a car for a weekend getaway. The convenience and affordability of renting through this platform cannot be beat.
46 |
47 |
48 | View Demo
49 |
50 |
51 |
52 |
53 |
54 | Table of Contents
55 |
56 | -
57 | About The Project
58 |
61 |
62 | -
63 | Getting Started
64 |
68 |
69 | -
70 | Features
71 |
72 | - Contributing
73 | - Special Thanks
74 | - Contact
75 |
76 |
77 |
78 |
79 |
80 | ## About The Project
81 |
82 | [![Product Name Screen Shot][product-screenshot]](https://example.com)
83 |
84 | (back to top)
85 |
86 | ## Built With
87 |
88 |
97 |
98 |
99 |
100 | ## Getting Started
101 |
102 | To get a local copy up and running follow these simple steps.
103 |
104 | ### Prerequisites
105 |
106 | 1. Make sure you have latest version of npm installed
107 | - npm
108 | ```sh
109 | npm install npm@latest -g
110 | ```
111 | 2. Make sure you have your accounts set up on MongoDB, GCP and Cloudinary
112 |
113 | ### Installation
114 |
115 | 1. Cloning the repository
116 |
117 | ```shell
118 | git clone https://github.com/shreyashkadam/rentpal.git
119 | ```
120 |
121 | 2. Install packages
122 |
123 | ```shell
124 | npm i
125 | ```
126 |
127 | 3. Setup .env file
128 |
129 | ```js
130 | DATABASE_URL=
131 | GOOGLE_CLIENT_ID=
132 | GOOGLE_CLIENT_SECRET=
133 | GITHUB_ID=
134 | GITHUB_SECRET=
135 | NEXTAUTH_SECRET=
136 | ```
137 |
138 | 4. Setup Prisma
139 |
140 | ```shell
141 | npx prisma db push
142 |
143 | ```
144 |
145 | 5. Start the app
146 |
147 | ```shell
148 | npm run dev
149 | ```
150 |
151 | (back to top)
152 |
153 |
154 | ## Features
155 |
156 | - Tailwind design
157 | - Tailwind animations and effects
158 | - Full responsiveness
159 | - Credential authentication
160 | - Google authentication
161 | - Github authentication
162 | - Image upload using Cloudinary CDN
163 | - Client form validation and handling using react-hook-form
164 | - Server error handling using react-toast
165 | - Calendars with react-date-range
166 | - Page loading state
167 | - Page empty state
168 | - Booking system
169 | - Customer booking cancellation
170 | - Owner booking cancellation
171 | - Creation and deletion of items
172 | - Pricing calculation
173 | - Favorites system
174 | - Shareable URL filters
175 |
176 |
177 | (back to top)
178 |
179 |
180 |
181 | ## Contributing
182 |
183 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
184 |
185 | If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
186 | Don't forget to give the project a star! Thanks again!
187 |
188 | 1. Fork the Project
189 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
190 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
191 | 4. Push to the Branch (`git push origin feature/AmazingFeature`)
192 | 5. Open a Pull Request
193 |
194 | (back to top)
195 |
196 |
197 |
198 | ## Special Thanks
199 | Special Thanks to Code with Antonio for his outstanding tutorial video on making a airbnb clone. This project has been referenced and greatly inspired by his work in the mentioned tutorial
200 |
201 | ## Contact
202 |
203 | Shreyash Kadam - [@linkedin-handle](https://linkedin.com/in/shreyash-kadam) - shreyash.kadam10@gmail.com
204 |
205 | Project Link: [https://github.com/shreyashkadam/rentpal](https://github.com/shreyashkadam/rentpal)
206 |
207 | (back to top)
208 |
209 |
210 |
211 |
212 | [contributors-shield]: https://img.shields.io/github/contributors/shreyashkadam/rentpal.svg?style=for-the-badge
213 | [contributors-url]: https://github.com/shreyashkadam/rentpal/graphs/contributors
214 | [forks-shield]: https://img.shields.io/github/forks/shreyashkadam/rentpal.svg?style=for-the-badge
215 | [forks-url]: https://github.com/shreyashkadam/rentpal/network/members
216 | [stars-shield]: https://img.shields.io/github/stars/shreyashkadam/rentpal.svg?style=for-the-badge
217 | [stars-url]: https://github.com/shreyashkadam/rentpal/stargazers
218 | [issues-shield]: https://img.shields.io/github/issues/shreyashkadam/rentpal.svg?style=for-the-badge
219 | [issues-url]: https://github.com/shreyashkadam/rentpal/issues
220 | [license-shield]: https://img.shields.io/github/license/shreyashkadam/rentpal.svg?style=for-the-badge
221 | [license-url]: https://github.com/shreyashkadam/rentpal/blob/master/LICENSE.txt
222 | [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
223 | [linkedin-url]: https://linkedin.com/in/shreyash-kadam
224 | [product-screenshot]: readme-images/screenshot3.png
225 |
--------------------------------------------------------------------------------
/app/components/footer/footer.tsx:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 |
3 | // const Footer = () => {
4 | // // Define inline CSS styles
5 |
6 |
7 |
8 | // const footerStyle = {
9 | // backgroundColor: 'white',
10 | // color: 'black',
11 | // padding: '20px',
12 | // };
13 |
14 | // const linkStyle = {
15 | // color: 'gray',
16 | // textDecoration: 'none',
17 | // marginRight: '10px',
18 | // };
19 |
20 | // const contactButtonStyle = {
21 | // marginRight: '5px',
22 | // };
23 |
24 | // const pinkLine = {
25 | // borderBottom: '10px solid pink',
26 | // margin: '20px 0',
27 | // };
28 |
29 |
30 | // return (
31 | //
75 | // );
76 | // };
77 |
78 | // export default Footer;
79 |
80 |
81 | import React from 'react';
82 |
83 | export default function App() {
84 | return (
85 |
306 | );
307 | }
--------------------------------------------------------------------------------