├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── fakeData.json ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json ├── robots.txt └── testimonials.json ├── src ├── App.css ├── App.js ├── App.test.js ├── Firebase │ ├── firebase.config.js │ └── firebase.init.js ├── components │ ├── Home │ │ ├── Contacts │ │ │ ├── Contacts.css │ │ │ └── Contacts.js │ │ ├── Header │ │ │ ├── Header.css │ │ │ └── Header.js │ │ ├── HeaderMain │ │ │ └── HeaderMain.js │ │ ├── Home │ │ │ └── Home.js │ │ ├── TestimonialCard │ │ │ └── TestimonialCard.js │ │ ├── Testimonials │ │ │ └── Testimonials.js │ │ ├── VehicleCard │ │ │ ├── VehicleCard.css │ │ │ └── VehicleCard.js │ │ └── Vehicles │ │ │ └── Vehicles.js │ ├── ServiceDetail │ │ ├── ServiceDetail.js │ │ └── Success.js │ └── Shared │ │ ├── Footer │ │ └── Footer.js │ │ ├── FooterQuickLinks │ │ └── FooterQuickLinks.js │ │ ├── Login │ │ └── Login.js │ │ ├── Navbar │ │ └── Navbar.js │ │ ├── NotFound │ │ ├── NotFound.css │ │ └── NotFound.js │ │ └── PrivateRoute │ │ └── PrivateRoute.js ├── contexts │ └── AuthProvider.js ├── hooks │ ├── useAuth.js │ └── useFirebase.js ├── images │ ├── 404page.png │ ├── 654.eps │ ├── 654.jpg │ ├── Honda.png │ ├── License free.txt │ ├── License premium.txt │ ├── Mito.png │ ├── aboutImage.jpg │ ├── architeture.jpg │ ├── banner_car.png │ ├── banner_image.png │ ├── car-dealer-showing-new-red-sports-auto.zip │ ├── invertedComma.png │ ├── isuzu.png │ └── jeep.png ├── index.css ├── index.js ├── logo.svg ├── reportWebVitals.js └── setupTests.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "restaurent-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@fortawesome/free-brands-svg-icons": "^5.15.4", 7 | "@fortawesome/free-solid-svg-icons": "^5.15.4", 8 | "@fortawesome/react-fontawesome": "^0.1.15", 9 | "@testing-library/jest-dom": "^5.14.1", 10 | "@testing-library/react": "^11.2.7", 11 | "@testing-library/user-event": "^12.8.3", 12 | "axios": "^0.24.0", 13 | "firebase": "^9.1.3", 14 | "install": "^0.13.0", 15 | "npm": "^8.1.0", 16 | "react": "^17.0.2", 17 | "react-dom": "^17.0.2", 18 | "react-router-dom": "^5.3.0", 19 | "react-scripts": "4.0.3", 20 | "web-vitals": "^1.1.2" 21 | }, 22 | "scripts": { 23 | "start": "react-scripts start", 24 | "build": "react-scripts build", 25 | "test": "react-scripts test", 26 | "eject": "react-scripts eject" 27 | }, 28 | "eslintConfig": { 29 | "extends": [ 30 | "react-app", 31 | "react-app/jest" 32 | ] 33 | }, 34 | "browserslist": { 35 | "production": [ 36 | ">0.2%", 37 | "not dead", 38 | "not op_mini all" 39 | ], 40 | "development": [ 41 | "last 1 chrome version", 42 | "last 1 firefox version", 43 | "last 1 safari version" 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/fakeData.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "60795d4e0489a32f948c4167", 4 | "name": "Honda Sedan", 5 | "price": "132", 6 | "description": "Vehicle Type: Sedan, Doors: 2, Seats: 2, Luggage: 2 Suitcases / 2 Bags, Transmission: Automatic", 7 | "imageURL": "https://i.ibb.co/54WzQjR/Honda.png" 8 | }, 9 | { 10 | "_id": "60795e440489a32f948c4168", 11 | "name": "MitoSedan", 12 | "price": "221", 13 | "description": "Vehicle Type: Sedan, Doors: 2, Seats: 2, Luggage: 2 Suitcases / 2 Bags, Transmission: Manual", 14 | "imageURL": "https://i.ibb.co/802Rwsq/Mito.png" 15 | }, 16 | { 17 | "_id": "60795fc20489a32f948c4169", 18 | "name": "Isuzu Tacoma", 19 | "price": "105", 20 | "description": "Vehicle Type: Pickup Truck, Doors: 5, Seats: 4, Luggage: 6 Suitcases / 8 Bags, Transmission: Manual", 21 | "imageURL": "https://i.ibb.co/SJK7QYs/isuzu.png" 22 | }, 23 | { 24 | "_id": "6079615d0489a32f948c416a", 25 | "name": "Chevrolet Crossover", 26 | "price": "434", 27 | "description": "Vehicle Type: Crossover, Doors: 5, Seats: 7, Luggage: 5Suitcases / 5Bags, Transmission: Automatic", 28 | "imageURL": "https://i.ibb.co/VggL0Wz/jeep.png" 29 | } 30 | ] -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | 28 | 29 | 30 | React App 31 | 32 | 33 | 34 |
35 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/testimonials.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "60791a7350b72a58dcd71a1f", 4 | "name": "Shahbaj", 5 | "designation": "CEO, Mama Jaben.", 6 | "description": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 7 | }, 8 | { 9 | "_id": "607c3e0412b2953a045d9303", 10 | "name": "David Smith", 11 | "designation": "CEO, XYZ Company", 12 | "description": "Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." 13 | }, 14 | { 15 | "_id": "607c3e4d12b2953a045d9304", 16 | "name": "Luke Shaw", 17 | "designation": "Accountant, ABCD Bank", 18 | "description": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 19 | }, 20 | { 21 | "_id": "607ff663c236bd00154d8227", 22 | "name": "Fardin", 23 | "designation": "CEO, Evergreen-shop.com", 24 | "description": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 25 | } 26 | ] -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | BrowserRouter as Router, 4 | Switch, 5 | Route, 6 | Link 7 | } from "react-router-dom"; 8 | import Home from "./components/Home/Home/Home"; 9 | import ServiceDetail from "./components/ServiceDetail/ServiceDetail"; 10 | import Success from "./components/ServiceDetail/Success"; 11 | import Login from "./components/Shared/Login/Login"; 12 | import Navbar from "./components/Shared/Navbar/Navbar"; 13 | import NotFound from "./components/Shared/NotFound/NotFound"; 14 | import PrivateRoute from "./components/Shared/PrivateRoute/PrivateRoute"; 15 | import AuthProvider from "./contexts/AuthProvider"; 16 | 17 | 18 | function App() { 19 | return ( 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ); 46 | } 47 | 48 | export default App; 49 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /src/Firebase/firebase.config.js: -------------------------------------------------------------------------------- 1 | const firebaseConfig = { 2 | apiKey: "AIzaSyC8wRqDuhLLWPaeqCL39XF7Q3XcxARfwr0", 3 | authDomain: "car-rental-phero.firebaseapp.com", 4 | projectId: "car-rental-phero", 5 | storageBucket: "car-rental-phero.appspot.com", 6 | messagingSenderId: "796181797049", 7 | appId: "1:796181797049:web:07ef23a0971445e8d8a368" 8 | }; 9 | export default firebaseConfig 10 | -------------------------------------------------------------------------------- /src/Firebase/firebase.init.js: -------------------------------------------------------------------------------- 1 | import { initializeApp } from "firebase/app"; 2 | import firebaseConfig from "./firebase.config"; 3 | const initializeAuthentication = () => { 4 | initializeApp(firebaseConfig); 5 | } 6 | 7 | export default initializeAuthentication; -------------------------------------------------------------------------------- /src/components/Home/Contacts/Contacts.css: -------------------------------------------------------------------------------- 1 | .contact{ 2 | background: rgba(12, 11, 27, 0.9); 3 | position: relative; 4 | z-index: 1; 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Home/Contacts/Contacts.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Contacts.css' 3 | import a from '../../../images/654.jpg' 4 | import b from '../../../images/aboutImage.jpg' 5 | // import c from '../../../images/architecture.jpg' 6 | const Contacts = () => { 7 | const images =[a,b]; 8 | let index = Math.floor(Math.random()* images.length) 9 | return ( 10 | 11 | //
12 | //
13 | //
14 | //
Contact
15 | //

Leave Your Message

16 | //
17 | //
18 | //
19 | //
20 | // 21 | //
22 | //
23 | // 24 | //
25 | //
26 | // 27 | //
28 | //
29 | // 30 | //
31 | //
32 | //
33 | //
34 | //
35 | ); 36 | }; 37 | 38 | export default Contacts; -------------------------------------------------------------------------------- /src/components/Home/Header/Header.css: -------------------------------------------------------------------------------- 1 | .header-container { 2 | 3 | position: relative; 4 | /* background-color: #f8f8f8; */ 5 | background-size: cover; 6 | } 7 | 8 | .header-container::after { 9 | height: 700px; 10 | content: ' '; 11 | position: absolute; 12 | top: 0; 13 | width: 44%; 14 | right: 0; 15 | background-image: url(../../../images/banner_image.png); 16 | background-repeat: no-repeat; 17 | z-index: -50; 18 | } -------------------------------------------------------------------------------- /src/components/Home/Header/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Navbar from '../../Shared/Navbar/Navbar'; 3 | import HeaderMain from '../HeaderMain/HeaderMain'; 4 | import './Header.css' 5 | const Header = () => { 6 | return ( 7 |
8 | {/* */} 9 | 10 |
11 | ); 12 | }; 13 | 14 | export default Header; -------------------------------------------------------------------------------- /src/components/Home/HeaderMain/HeaderMain.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import carBanner from '../../../images/banner_car.png' 3 | const HeaderMain = () => { 4 | return ( 5 |
6 |
7 |

Plan your trip now

8 |

Save big with our
car rental

9 |

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Adipisci perferendis fuga officia dicta, voluptatem provident!

10 | Book Ride 11 |
12 |
13 | 14 |
15 |
16 | ); 17 | }; 18 | 19 | export default HeaderMain; -------------------------------------------------------------------------------- /src/components/Home/Home/Home.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Footer from '../../Shared/Footer/Footer'; 3 | import Contacts from '../Contacts/Contacts'; 4 | import Header from '../Header/Header'; 5 | import Testimonials from '../Testimonials/Testimonials'; 6 | import Vehicles from '../Vehicles/Vehicles'; 7 | 8 | const Home = () => { 9 | return ( 10 |
11 |
12 | 13 | {/* */} 14 | 15 | 16 |
17 |
18 | ); 19 | }; 20 | 21 | export default Home; -------------------------------------------------------------------------------- /src/components/Home/TestimonialCard/TestimonialCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 3 | import { faStar } from '@fortawesome/free-solid-svg-icons'; 4 | 5 | const TestimonialCard = (props) => { 6 | const { name, designation, description } = props.testimonial; 7 | 8 | return ( 9 |
10 |
11 |
12 |
{name}
13 | {designation} 14 |

{description}

15 |
16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 |
26 |
27 | ); 28 | }; 29 | 30 | export default TestimonialCard; -------------------------------------------------------------------------------- /src/components/Home/Testimonials/Testimonials.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import TestimonialCard from '../TestimonialCard/TestimonialCard'; 3 | 4 | const Testimonials = () => { 5 | const [testimonials, setTestimonials] = useState([]); 6 | 7 | // Loading Data 8 | useEffect(() => { 9 | fetch('./testimonials.json') 10 | .then(res => res.json()) 11 | .then(reviews => { 12 | setTestimonials(reviews); 13 | }) 14 | }, []) 15 | 16 | return ( 17 |
18 |
19 |

Reviewed by People

20 |

Clients'Testimonials

21 |

Certain but she but shyness why cottage.
Guy the put instrument sir entreaties affronting. Pretended exquisite see cordially the you.
Weeks quiet do vexed.

22 | 23 | 24 | 25 |
26 | { 27 | testimonials.map(testimonial => ) 28 | } 29 |
30 |
31 |
32 | ); 33 | }; 34 | 35 | export default Testimonials; -------------------------------------------------------------------------------- /src/components/Home/VehicleCard/VehicleCard.css: -------------------------------------------------------------------------------- 1 | .vehicleCard:hover img{ 2 | overflow: hidden; 3 | transform: scale(1.2); 4 | transition: transform 1s; 5 | } -------------------------------------------------------------------------------- /src/components/Home/VehicleCard/VehicleCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useHistory } from 'react-router'; 3 | import './VehicleCard.css' 4 | 5 | const VehicleCard = (props) => { 6 | const { name, price, imageURL, description, _id } = props.vehicle; 7 | let history = useHistory(); 8 | const bookVehicle = (id) => { 9 | 10 | history.push(`/bookVehicle/${id}`) 11 | } 12 | return ( 13 |
14 |
15 |
16 | 17 |
18 |
19 |
{name}
20 |

{description}

21 |
22 |
23 |
24 |

$ {price}

25 | 26 |
27 |
28 |
29 |
30 | ); 31 | }; 32 | 33 | export default VehicleCard; -------------------------------------------------------------------------------- /src/components/Home/Vehicles/Vehicles.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import VehicleCard from '../VehicleCard/VehicleCard'; 3 | 4 | 5 | const Vehicles = () => { 6 | const [vehicles, setVehicles] = useState([]); 7 | 8 | // Loading Data 9 | useEffect(() => { 10 | fetch('./fakeData.json') 11 | .then(res => res.json()) 12 | .then(data => { 13 | 14 | setVehicles(data); 15 | }) 16 | }, []) 17 | return ( 18 |
19 |

Vehicle Models

20 |

Our Vehicles

21 |

To contribute to positive change and achieve our
sustainability goals with many extraordinary

22 | 23 | {/* render vehicles from server side */} 24 |
25 | { 26 | vehicles.map(vehicle => ) 27 | } 28 |
29 |
30 | ); 31 | }; 32 | 33 | export default Vehicles; -------------------------------------------------------------------------------- /src/components/ServiceDetail/ServiceDetail.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import { useParams } from 'react-router'; 3 | import useAuth from '../../hooks/useAuth'; 4 | 5 | const ServiceDetail = () => { 6 | const {id} = useParams(); 7 | console.log(id); 8 | const { loggedInUser } = useAuth(); 9 | const [vehicles, setVehicles] = useState([]); 10 | 11 | // Loading Data 12 | useEffect(() => { 13 | fetch('https://raw.githubusercontent.com/ShahbajKhan/fakeDate/main/fakeData.json') 14 | .then(res => res.json()) 15 | .then(data => { 16 | const matchedVehicle = data.find(vehicle => vehicle._id === id) 17 | setVehicles(matchedVehicle); 18 | }) 19 | }, [id]) 20 | const purchase =()=>{ 21 | const info = { 22 | product_name: vehicles?.name, 23 | product_profile: vehicles?.description, 24 | product_image: vehicles?.imageURL, 25 | total_amount: vehicles?.price, 26 | cus_name: loggedInUser?.displayName, 27 | cus_email:loggedInUser?.email 28 | 29 | } 30 | fetch(`http://localhost:5000/init`,{ 31 | method: 'POST', 32 | headers:{ 33 | "content-type" :"application/json" 34 | }, 35 | body: JSON.stringify(info) 36 | }) 37 | .then(res => res.json()) 38 | .then(data => { 39 | console.log(data); 40 | window.location.replace(data) 41 | }) 42 | 43 | } 44 | 45 | return ( 46 |
47 |
48 | 49 |

Plan your trip now

50 |

{vehicles?.name}

51 |

{vehicles?.description}

52 |

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Adipisci perferendis fuga officia dicta, voluptatem provident!

53 | 54 |
55 |
56 | 57 |
58 |
59 | ); 60 | }; 61 | 62 | export default ServiceDetail; -------------------------------------------------------------------------------- /src/components/ServiceDetail/Success.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import React, { useEffect } from 'react'; 3 | import { useState } from 'react'; 4 | import { useHistory, useLocation, useParams } from 'react-router'; 5 | 6 | const Success = () => { 7 | let history = useHistory() 8 | const { id } = useParams(); 9 | const [vehicles, setVehicles] = useState([]); 10 | useEffect(() => { 11 | axios.get(`http://localhost:5000/orders/${id}`) 12 | .then(res => setVehicles(res.data)) 13 | }, [id]) 14 | const validatePayment = () => { 15 | const data = { 16 | tran_id: id, 17 | val_id: vehicles?.val_id 18 | } 19 | axios.post(`http://localhost:5000/validate`, data) 20 | .then(res => { 21 | if (res.data) { 22 | alert("Order placed successfully") 23 | history.push('/home') 24 | } 25 | }) 26 | } 27 | 28 | return ( 29 |
30 |

Payment Successful. Confirm your Order

31 |
32 | 33 |
34 | 35 |

Plan your trip now

36 |

{vehicles?.product_name}

37 |

{vehicles?.product_profile}

38 |

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Adipisci perferendis fuga officia dicta, voluptatem provident!

39 | 40 | 41 |
42 |
43 | 44 |
45 |
46 |
47 | ); 48 | }; 49 | 50 | export default Success; -------------------------------------------------------------------------------- /src/components/Shared/Footer/Footer.js: -------------------------------------------------------------------------------- 1 | import { faFacebook, faInstagram, faTwitter, faWhatsapp } from '@fortawesome/free-brands-svg-icons'; 2 | import { faMapMarkerAlt, faMarker } from '@fortawesome/free-solid-svg-icons'; 3 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 4 | import React from 'react'; 5 | import { Link } from 'react-router-dom'; 6 | import FooterQuickLinks from '../FooterQuickLinks/FooterQuickLinks'; 7 | 8 | const Footer = () => { 9 | return ( 10 | 36 | ); 37 | }; 38 | 39 | export default Footer; -------------------------------------------------------------------------------- /src/components/Shared/FooterQuickLinks/FooterQuickLinks.js: -------------------------------------------------------------------------------- 1 | import { faCar, faCommentDots, faHome, faPlus } from '@fortawesome/free-solid-svg-icons'; 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 3 | import React from 'react'; 4 | import { Link } from 'react-router-dom'; 5 | 6 | const FooterQuickLinks = () => { 7 | return ( 8 | 9 | 31 | 32 | ); 33 | }; 34 | 35 | export default FooterQuickLinks; -------------------------------------------------------------------------------- /src/components/Shared/Login/Login.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { useHistory, useLocation } from 'react-router'; 3 | import useAuth from '../../../hooks/useAuth'; 4 | import BannerImage from '../../../images/aboutImage.jpg' 5 | import Navbar from '../Navbar/Navbar'; 6 | 7 | const Login = () => { 8 | const [name, setName] = useState(""); 9 | const [email, setEmail] = useState(""); 10 | const [password, setPassword] = useState(""); 11 | const { signInUsingGoogle, registerUser, setUserName } = useAuth(); 12 | const location = useLocation(); 13 | const history = useHistory(); 14 | const redirect_uri = location?.state?.from || "/home" 15 | const handleGoogleLogin = () => { 16 | signInUsingGoogle() 17 | .then(result => { 18 | history.push(redirect_uri); 19 | }) 20 | } 21 | const handleEmailChange = e => { 22 | setEmail(e.target.value) 23 | } 24 | const handlePasswordChange = e => { 25 | setPassword(e.target.value) 26 | } 27 | const handleNameChange = e => { 28 | setName(e.target.value) 29 | } 30 | const createUser = e => { 31 | e.preventDefault(); 32 | console.log(email, password); 33 | registerUser(email, password).then(result => { 34 | setUserName(name) 35 | .then(result => { 36 | console.log("name updated", name) 37 | }) 38 | history.push(redirect_uri); 39 | }) 40 | 41 | } 42 | return ( 43 |
44 | 45 |
46 |
47 |
48 | 49 | 50 |
51 |
52 | 53 | 54 |
55 |
56 | 57 | 58 |
59 |
60 | 61 |
62 |
63 | 64 |
65 | 66 | 67 |
68 | 69 | 70 |
71 | 72 |
73 |
74 |
75 | ); 76 | }; 77 | 78 | export default Login; -------------------------------------------------------------------------------- /src/components/Shared/Navbar/Navbar.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { useEffect, useState } from 'react/cjs/react.development'; 4 | import useAuth from '../../../hooks/useAuth'; 5 | import carLogo from '../../../images/654.jpg' 6 | const Navbar = () => { 7 | 8 | const {loggedInUser, logOut} = useAuth(); 9 | 10 | 11 | return ( 12 |
13 | 38 |
39 | ); 40 | }; 41 | 42 | export default Navbar; -------------------------------------------------------------------------------- /src/components/Shared/NotFound/NotFound.css: -------------------------------------------------------------------------------- 1 | .notFound{ 2 | height: 100vh; 3 | background-image: url('../../../images/404page.png'); 4 | background-repeat: no-repeat; 5 | background-size: cover; 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | } -------------------------------------------------------------------------------- /src/components/Shared/NotFound/NotFound.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import './NotFound.css' 4 | const NotFound = () => { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | }; 11 | 12 | export default NotFound; -------------------------------------------------------------------------------- /src/components/Shared/PrivateRoute/PrivateRoute.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Redirect, Route } from 'react-router'; 3 | import useAuth from '../../../hooks/useAuth'; 4 | 5 | const PrivateRoute = ({ children, ...rest }) => { 6 | const { loggedInUser, isLoading } = useAuth(); 7 | console.log(loggedInUser); 8 | if (isLoading) { 9 | return ( 10 |
11 | Loading... 12 |
13 | ); 14 | } 15 | return ( 16 | 19 | loggedInUser?.email ? children : 24 | 25 | } 26 | > 27 | 28 | 29 | ); 30 | }; 31 | 32 | export default PrivateRoute; -------------------------------------------------------------------------------- /src/contexts/AuthProvider.js: -------------------------------------------------------------------------------- 1 | import React, { createContext } from 'react'; 2 | import useFirebase from '../hooks/useFirebase'; 3 | 4 | 5 | export const AuthContext = createContext(); 6 | const AuthProvider = ({children}) => { 7 | const allContext = useFirebase(); 8 | 9 | return ( 10 | 11 | {children} 12 | 13 | ); 14 | }; 15 | 16 | export default AuthProvider; -------------------------------------------------------------------------------- /src/hooks/useAuth.js: -------------------------------------------------------------------------------- 1 | import { useContext } from "react" 2 | import { AuthContext } from "../contexts/AuthProvider" 3 | 4 | const useAuth = () => { 5 | return useContext(AuthContext); 6 | } 7 | 8 | export default useAuth; 9 | -------------------------------------------------------------------------------- /src/hooks/useFirebase.js: -------------------------------------------------------------------------------- 1 | import { getAuth, signInWithPopup, GoogleAuthProvider, signOut, onAuthStateChanged, createUserWithEmailAndPassword,updateProfile } from "firebase/auth"; 2 | import { useState } from "react"; 3 | import { useEffect } from "react/cjs/react.development"; 4 | import initializeAuthentication from "../Firebase/firebase.init"; 5 | 6 | initializeAuthentication(); 7 | const useFirebase = () => { 8 | const [loggedInUser, setLoggedInUser] = useState({}); 9 | const [isLoading, setIsLoading] = useState(true); 10 | const auth = getAuth(); 11 | 12 | const signInUsingGoogle = () => { 13 | setIsLoading(true); 14 | const googleProvider = new GoogleAuthProvider(); 15 | 16 | return signInWithPopup(auth, googleProvider) 17 | .finally(() => setIsLoading(false)) 18 | } 19 | 20 | const registerUser = (email, password) => { 21 | // console.log("from hook", email, password); 22 | setIsLoading(true); 23 | return createUserWithEmailAndPassword(auth, email, password) 24 | 25 | .finally(() => setIsLoading(false)) 26 | } 27 | 28 | const setUserName = (name) => { 29 | return updateProfile(auth.currentUser, { displayName: name }) 30 | 31 | } 32 | useEffect(() => { 33 | const unsubscribed = onAuthStateChanged(auth, user => { 34 | if (user) { 35 | setLoggedInUser(user) 36 | } 37 | else { 38 | setLoggedInUser({}) 39 | } 40 | setIsLoading(false); 41 | }); 42 | return () => unsubscribed; 43 | }, [auth]) 44 | 45 | 46 | const logOut = () => { 47 | setIsLoading(true); 48 | signOut(auth).then(() => { 49 | setLoggedInUser({}); 50 | }) 51 | .finally(() => setIsLoading(false)) 52 | } 53 | return { 54 | loggedInUser, 55 | signInUsingGoogle, 56 | logOut, 57 | isLoading, 58 | registerUser, 59 | setUserName 60 | } 61 | } 62 | 63 | export default useFirebase; -------------------------------------------------------------------------------- /src/images/404page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/404page.png -------------------------------------------------------------------------------- /src/images/654.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/654.eps -------------------------------------------------------------------------------- /src/images/654.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/654.jpg -------------------------------------------------------------------------------- /src/images/Honda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/Honda.png -------------------------------------------------------------------------------- /src/images/License free.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT NOTICE: This license only applies if you downloaded this content as 2 | an unsubscribed user. If you are a premium user (ie, you pay a subscription) 3 | you are bound to the license terms described in the accompanying file 4 | "License premium.txt". 5 | 6 | --------------------- 7 | 8 | You must attribute the image to its author: 9 | 10 | In order to use a content or a part of it, you must attribute it to iconicbestiary / Freepik, 11 | so we will be able to continue creating new graphic resources every day. 12 | 13 | 14 | How to attribute it? 15 | 16 | For websites: 17 | 18 | Please, copy this code on your website to accredit the author: 19 | Designed by iconicbestiary / Freepik 20 | 21 | For printing: 22 | 23 | Paste this text on the final work so the authorship is known. 24 | - For example, in the acknowledgements chapter of a book: 25 | "Designed by iconicbestiary / Freepik" 26 | 27 | 28 | You are free to use this image: 29 | 30 | - For both personal and commercial projects and to modify it. 31 | - In a website or presentation template or application or as part of your design. 32 | 33 | You are not allowed to: 34 | 35 | - Sub-license, resell or rent it. 36 | - Include it in any online or offline archive or database. 37 | 38 | The full terms of the license are described in section 7 of the Freepik 39 | terms of use, available online in the following link: 40 | 41 | http://www.freepik.com/terms_of_use 42 | 43 | The terms described in the above link have precedence over the terms described 44 | in the present document. In case of disagreement, the Freepik Terms of Use 45 | will prevail. 46 | -------------------------------------------------------------------------------- /src/images/License premium.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT NOTICE: This license only applies if you downloaded this content as 2 | a subscribed (or "premium") user. If you are an unsubscribed user (or "free" 3 | user) you are bound to the license terms described in the accompanying file 4 | "License free.txt". 5 | 6 | --------------------- 7 | 8 | You can download from your profile in Freepik a personalized license stating 9 | your right to use this content as a "premium" user: 10 | 11 | https://profile.freepik.com/my_downloads 12 | 13 | You are free to use this image: 14 | 15 | - For both personal and commercial projects and to modify it. 16 | - In a website or presentation template or application or as part of your design. 17 | 18 | You are not allowed to: 19 | 20 | - Sub-license, resell or rent it. 21 | - Include it in any online or offline archive or database. 22 | 23 | The full terms of the license are described in sections 7 and 8 of the Freepik 24 | terms of use, available online in the following link: 25 | 26 | http://www.freepik.com/terms_of_use 27 | 28 | The terms described in the above link have precedence over the terms described 29 | in the present document. In case of disagreement, the Freepik Terms of Use 30 | will prevail. 31 | -------------------------------------------------------------------------------- /src/images/Mito.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/Mito.png -------------------------------------------------------------------------------- /src/images/aboutImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/aboutImage.jpg -------------------------------------------------------------------------------- /src/images/architeture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/architeture.jpg -------------------------------------------------------------------------------- /src/images/banner_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/banner_car.png -------------------------------------------------------------------------------- /src/images/banner_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/banner_image.png -------------------------------------------------------------------------------- /src/images/car-dealer-showing-new-red-sports-auto.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/car-dealer-showing-new-red-sports-auto.zip -------------------------------------------------------------------------------- /src/images/invertedComma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/invertedComma.png -------------------------------------------------------------------------------- /src/images/isuzu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/isuzu.png -------------------------------------------------------------------------------- /src/images/jeep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/ssl-commerz-client-side/3a87703a76873815ae78fc9c1eaa7905858d4889/src/images/jeep.png -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | --------------------------------------------------------------------------------