Certain but she but shyness why cottage. Guy the put instrument sir entreaties affronting. Pretended exquisite see cordially the you. Weeks quiet do vexed.
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 |
--------------------------------------------------------------------------------