├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt └── src ├── App.css ├── App.js ├── App.test.js ├── Components ├── Auth │ ├── Auth.jsx │ ├── SignUp.jsx │ ├── User.js │ └── style.css └── Layout │ ├── Header.js │ ├── SideNav.css │ └── Sidebar.js ├── Config ├── Language.json └── config.js ├── Password ├── ChangePassword.jsx ├── Forget.css ├── ForgetPassword.jsx ├── LogoutPop.jsx ├── Passsword │ ├── Password.css │ └── PasswordStrength.js └── ResetPassword.jsx ├── ResumeFile ├── A4.js ├── About.js ├── Education.js ├── Hobbies.js ├── Language.js ├── MainForm.js ├── Project.js ├── Reme.css ├── Resume │ ├── One.css │ └── One.js ├── Skills.js ├── Success.js ├── Technologies.js ├── Tools.js ├── Work.js └── style.css ├── Router ├── Index.jsx └── Route.jsx ├── Service ├── Auth.jsx ├── Blog.jsx ├── Password.jsx ├── Print.jsx ├── Resume.jsx └── User.jsx ├── View ├── Admin │ ├── CronaVirus.jsx │ └── Userlist.jsx ├── Blog │ ├── Blog.css │ ├── Blog.jsx │ ├── BlogDetail.jsx │ ├── BlogUser.jsx │ └── Tags.jsx ├── Feed │ ├── AddFeed.jsx │ ├── Feed.css │ ├── Feed.jsx │ └── Likers.jsx ├── Home.js ├── Profile │ ├── EditModel.jsx │ ├── EditProfile.jsx │ ├── Profile.css │ └── Profile.jsx └── User │ ├── Details.jsx │ ├── EditProfile.jsx │ ├── Profile.jsx │ ├── ResumeList.jsx │ └── ViewResume.jsx ├── img ├── bg.svg ├── blue.svg ├── greenform-01.svg └── purpleform.svg ├── index.css ├── index.js ├── logo.svg ├── serviceWorker.js └── setupTests.js /.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 | ## DEMO 2 | 3 | #### FrontEnd : [https://beautiresume.herokuapp.com/](https://beautiresume.herokuapp.com/) If you get error while running this app please reload page it will work. 4 | 5 | #### Backend: [https://softbike.herokuapp.com/api/1/data/resume/](https://softbike.herokuapp.com/api/1/data/resume/) If you get error while running this app please reload page it will work. 6 | 7 | ### Features 8 | 9 | - Login/Registration (Send Email Confirmation after Registration\_ 10 | - Change Password 11 | - Forget Password 12 | - Session Timeout (Auto Logout after 5 minutes inactive session) 13 | - Write Blog 14 | - Filter blog by(Author or By Tag) and (Like on Post, Comment on post, See user Who liked your post, Follow Or unfollow user) 15 | - Post (Like on Post, Comment on post, See user Who liked your post, Follow Or unfollow user) 16 | - Update Used deatils 17 | - User profile view. 18 | - Minimal Design 19 | - Create/Edit/Delete Your Resume 20 | - User Profile 21 | - Admin Panel 22 | - Create/View/Edit/Delete A User 23 | - Pagination on All blog list and Live search 24 | - Create/View/Edit/Delete A Resume By Any User 25 | 26 | ## Frontend Setup 27 | 28 | 1. Navigate the current working directory to : `cd` dir. 29 | 2. Install the all frontend dependencies using npm: `npm install`. 30 | 3. Run the server: `npm start`. 31 | 32 | ### Creating The First Resume 33 | 34 | 1. Make sure that both Backend and Frontend Servers are running. 35 | 2. Open your browser and navigate to [localhost:3000](localhost:3000). 36 | 3. Go To [http://localhost:3000/](http://localhost:3000/). 37 | 4. Go To Signup page if you are not registered [http://localhost:3000/register/](http://localhost:3000/register/). 38 | 5. Login with the superuser credentials created while setting up the Backend (Step: 8) 39 | 6. Navigate To _Dashboard -> Your all resume_ ([http://localhost:3000/user/view/resume/create-new-post](http://localhost:3000/user/view/resume/)). 40 | 41 | ## Backend API Documentation 42 | 43 | API Documentation is generated using the default tool provided by Django Rest Framework. 44 | 45 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 46 | 47 | ## Sample Image 48 | 49 | #### Login Page 50 | 51 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.02.12-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 52 | 53 | #### Register(Send confirmation email after registration) 54 | 55 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.02.20-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 56 | 57 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.02.27-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa27ac0280339750413) 58 | 59 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.01.40-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 60 | 61 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.24.15-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa245da2351370223357) 62 | 63 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.55.20-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 64 | 65 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.55.46-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 66 | 67 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.55.58-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 68 | 69 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.56.34-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 70 | 71 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.57.06-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 72 | 73 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.59.46-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 74 | 75 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.59.52-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 76 | 77 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-9.59.57-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 78 | 79 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.00.01-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 80 | 81 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.00.22-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 82 | 83 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.00.40-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 84 | 85 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.00.46-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 86 | 87 | [![image](https://www.linkpicture.com/q/Screen-Shot-2020-11-14-at-10.01.57-AM.png)](https://www.linkpicture.com/view.php?img=LPic5fafa1042a69d353861954) 88 | 89 | ## Available Scripts 90 | 91 | In the project directory, you can run: 92 | 93 | ### `npm start` 94 | 95 | Runs the app in the development mode.
96 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 97 | 98 | The page will reload if you make edits.
99 | You will also see any lint errors in the console. 100 | 101 | ### `npm test` 102 | 103 | Launches the test runner in the interactive watch mode.
104 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 105 | 106 | ### `npm run build` 107 | 108 | Builds the app for production to the `build` folder.
109 | It correctly bundles React in production mode and optimizes the build for the best performance. 110 | 111 | The build is minified and the filenames include the hashes.
112 | Your app is ready to be deployed! 113 | 114 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 115 | 116 | ### `npm run eject` 117 | 118 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 119 | 120 | 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. 121 | 122 | 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. 123 | 124 | 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. 125 | 126 | ## Learn More 127 | 128 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 129 | 130 | To learn React, check out the [React documentation](https://reactjs.org/). 131 | 132 | ### Code Splitting 133 | 134 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 135 | 136 | ### Analyzing the Bundle Size 137 | 138 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 139 | 140 | ### Making a Progressive Web App 141 | 142 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 143 | 144 | ### Advanced Configuration 145 | 146 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 147 | 148 | ### Deployment 149 | 150 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 151 | 152 | ### `npm run build` fails to minify 153 | 154 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 155 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "resumebuilder", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^4.9.3", 7 | "@material-ui/icons": "^4.9.1", 8 | "@progress/kendo-drawing": "^1.6.0", 9 | "@progress/kendo-react-pdf": "^3.11.0", 10 | "@testing-library/jest-dom": "^4.2.4", 11 | "@testing-library/react": "^9.4.0", 12 | "@testing-library/user-event": "^7.2.1", 13 | "apexcharts": "^3.15.6", 14 | "axios": "^0.19.2", 15 | "html2canvas": "^1.0.0-rc.5", 16 | "i18next": "^19.3.1", 17 | "i18next-browser-languagedetector": "^4.0.1", 18 | "i18next-xhr-backend": "^3.2.2", 19 | "jspdf": "^1.5.3", 20 | "leaflet": "^1.6.0", 21 | "local-storage": "^2.0.0", 22 | "moment": "^2.24.0", 23 | "paginate-array": "^2.1.0", 24 | "react": "^16.10.6", 25 | "react-bootstrap": "^1.0.0-beta.16", 26 | "react-dom": "^16.8.6", 27 | "react-i18next": "^11.3.3", 28 | "react-lazy-load-image-component": "^1.5.0", 29 | "react-leaflet": "^2.6.1", 30 | "react-router-dom": "^5.1.2", 31 | "react-scripts": "3.0.1", 32 | "sweetalert2": "^9.7.2", 33 | "universal-cookie": "^4.0.3" 34 | }, 35 | "scripts": { 36 | "start": "react-scripts start", 37 | "build": "react-scripts build", 38 | "test": "react-scripts test", 39 | "eject": "react-scripts eject" 40 | }, 41 | "eslintConfig": { 42 | "extends": "react-app" 43 | }, 44 | "browserslist": { 45 | "production": [ 46 | ">0.2%", 47 | "not dead", 48 | "not op_mini all" 49 | ], 50 | "development": [ 51 | "last 1 chrome version", 52 | "last 1 firefox version", 53 | "last 1 safari version" 54 | ] 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamrraj/React-Resume-Generator/42d73ba6e506d96525f3b6032884b07e152f77d0/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 17 | 18 | 22 | 26 | 30 | 36 | 40 | 41 | 45 | 46 | 55 | 56 | Resume Builder 57 | 58 | 59 | 60 |
61 | 71 | 72 | 77 | 82 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamrraj/React-Resume-Generator/42d73ba6e506d96525f3b6032884b07e152f77d0/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamrraj/React-Resume-Generator/42d73ba6e506d96525f3b6032884b07e152f77d0/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 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Router from "./Router/Route" 3 | // import "./App.css" 4 | 5 | 6 | 7 | class App extends Component { 8 | render() { 9 | return ( 10 |
11 | 12 |
13 | ); 14 | } 15 | } 16 | 17 | export default App; 18 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | const { getByText } = render(); 7 | const linkElement = getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /src/Components/Auth/Auth.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | // import ls from "local-storage"; 3 | import Swal from "sweetalert2"; 4 | import axios from "axios"; 5 | import config from "../../Config/config"; 6 | import Visibility from "@material-ui/icons/Visibility"; 7 | import VisibilityOff from "@material-ui/icons/VisibilityOff"; 8 | 9 | // import Cookies from "universal-cookie"; 10 | 11 | const CLIENT_ID = "Resume-Builder"; 12 | const GRANT_TYPE = "password"; 13 | 14 | function Auth() { 15 | const [password, setPassword] = useState({ 16 | username: "", 17 | password: "", 18 | }); 19 | 20 | const [showPassword, setShowPassword] = useState(false); 21 | 22 | const handleChange = (event) => { 23 | const { name, value } = event.target; 24 | setPassword({ ...password, [name]: value }); 25 | }; 26 | 27 | const handleClickShowPassword = () => { 28 | setShowPassword(!showPassword); 29 | }; 30 | 31 | const handleSubmit = (e) => { 32 | e.preventDefault(); 33 | Swal.fire({ 34 | title: "Loading", 35 | type: "warning", 36 | showCancelButton: false, 37 | showConfirmButton: false, 38 | timerProgressBar: true, 39 | onBeforeOpen: () => { 40 | Swal.showLoading(); 41 | }, 42 | }); 43 | 44 | axios({ 45 | method: "post", 46 | url: config.apiUrl.login, 47 | headers: { 48 | "Content-Type": "application/x-www-form-urlencoded", 49 | }, 50 | 51 | data: `grant_type=${GRANT_TYPE}&username=${password.username}&password=${password.password}&client_id=${CLIENT_ID}`, 52 | }) 53 | .then((response) => { 54 | localStorage.setItem("username", password.username); 55 | localStorage.setItem("Token", response.data.access_token); 56 | 57 | Swal.fire({ 58 | title: "Log in", 59 | icon: "success", 60 | text: "You Successfully loggedin", 61 | showConfirmButton: false, 62 | timer: 3000, 63 | }); 64 | setTimeout(function () { 65 | window.location.href = "/feed/"; 66 | }, 2000); 67 | }) 68 | .catch((reject) => { 69 | console.log(reject); 70 | Swal.fire({ 71 | title: "Login Error", 72 | icon: "error", 73 | text: reject.response.data.message, 74 | timer: 2000, 75 | }); 76 | }); 77 | }; 78 | 79 | return ( 80 |
81 | {/* */} 82 |
83 |
84 |
85 |
86 | {/* */} 87 |
88 |
89 | Forget Password 94 |
95 |
96 |
97 |
98 |

99 | Login 100 |

101 |

102 | Welcome to Resume Builder Login page 103 |

104 |
105 |
110 |
111 | 119 |
120 |
121 | 129 | 134 | {showPassword ? ( 135 | 136 | ) : ( 137 | 138 | )} 139 | 140 |
141 | 142 | 149 |
150 |
151 | 167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 | ); 176 | } 177 | 178 | export default Auth; 179 | -------------------------------------------------------------------------------- /src/Components/Auth/SignUp.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import Visibility from "@material-ui/icons/Visibility"; 3 | import VisibilityOff from "@material-ui/icons/VisibilityOff"; 4 | import Swal from "sweetalert2"; 5 | import axios from "axios"; 6 | import config from "../../Config/config"; 7 | import PasswordStrength from "../../Password/Passsword/PasswordStrength"; 8 | 9 | function SignUp() { 10 | const [password, setPassword] = useState({ 11 | username: "", 12 | password: "", 13 | confirmPassword: "", 14 | email: "", 15 | }); 16 | 17 | const [showPassword, setShowPassword] = useState(false); 18 | 19 | const handleChange = (event) => { 20 | const { name, value } = event.target; 21 | setPassword({ ...password, [name]: value }); 22 | }; 23 | 24 | const handleClickShowPassword = () => { 25 | setShowPassword(!showPassword); 26 | }; 27 | 28 | const handleSubmit = (e) => { 29 | e.preventDefault(); 30 | Swal.fire({ 31 | title: "Loading", 32 | type: "warning", 33 | showCancelButton: false, 34 | showConfirmButton: false, 35 | timerProgressBar: true, 36 | onBeforeOpen: () => { 37 | Swal.showLoading(); 38 | }, 39 | }); 40 | 41 | const re = RegExp(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/); 42 | const isOk = re.test(password.password); 43 | 44 | if (isOk) { 45 | axios({ 46 | method: "post", 47 | url: config.apiUrl.register, 48 | headers: { 49 | Accept: "application/json", 50 | "Content-Type": "application/json", 51 | }, 52 | 53 | data: password, 54 | }) 55 | .then((response) => { 56 | Swal.fire({ 57 | title: "Registerd", 58 | icon: "success", 59 | text: `Successfully Register Please check your email "${password.email} "to confirm account !!`, 60 | showConfirmButton: false, 61 | timer: 3000, 62 | }); 63 | setTimeout(function () { 64 | window.location.href = "/"; 65 | }, 2000); 66 | }) 67 | .catch((err) => { 68 | console.log(err); 69 | Swal.fire({ 70 | title: "Registerd", 71 | icon: "error", 72 | text: err.response.data["message"] 73 | ? err.response.data["message"] 74 | : "Seems like this username is already in use", 75 | timer: 2000, 76 | }); 77 | }); 78 | } else { 79 | Swal.fire({ 80 | title: "Password Error", 81 | icon: "warning", 82 | text: 83 | "Your password must contain at least one small , big letter and least one digit", 84 | timer: 2000, 85 | }); 86 | } 87 | }; 88 | return ( 89 |
90 | {/* */} 91 |
92 |
93 |
94 |
95 | {/* */} 96 |
97 |
98 | Forget Password 103 |
104 |
105 |
106 |
107 |

108 | Register 109 |

110 |

111 | Welcome to Resume Builder Register page 112 |

113 |
114 |
119 |
120 | 128 |
129 | 130 |
131 | 139 |
140 |
141 | 149 | 154 | {showPassword ? ( 155 | 156 | ) : ( 157 | 158 | )} 159 | 160 | 161 | 162 |
163 | 164 |
165 | 173 | 174 | {password.password !== password.confirmPassword ? ( 175 | password.confirmPassword.length > 1 ? ( 176 | 180 | Password did not match 181 | 182 | ) : ( 183 | "" 184 | ) 185 | ) : password.confirmPassword.length > 1 ? ( 186 | 190 | Password matched 191 | 192 | ) : ( 193 | "" 194 | )} 195 |
196 | 197 | 207 |
208 |
209 | 218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 | ); 227 | } 228 | 229 | export default SignUp; 230 | -------------------------------------------------------------------------------- /src/Components/Auth/User.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { getUser } from "../../Service/Auth"; 3 | import config from "../../Config/Config"; 4 | 5 | export class User extends Component { 6 | constructor(props) { 7 | super(props); 8 | this.state = { 9 | name: "", 10 | walk: [] 11 | }; 12 | } 13 | 14 | async componentDidMount() { 15 | let authToken = localStorage.getItem("Token"); 16 | const res = await fetch(config.apiUrl.me, { 17 | method: "GET", 18 | headers: { 19 | Accept: "application/json", 20 | "Content-Type": "application/json", 21 | Authorization: "Bearer " + authToken 22 | } 23 | }); 24 | const walk = await res.json(); 25 | localStorage.setItem("Name", walk.first_name); 26 | this.setState({ 27 | walk 28 | }); 29 | } 30 | 31 | render() { 32 | const { walk } = this.state; 33 | 34 | return ( 35 | 36 | {/* {localStorage.getItem("Name")} */} 37 | {walk.first_name} {walk.last_name} 38 | 39 | ); 40 | } 41 | } 42 | 43 | export default User; 44 | -------------------------------------------------------------------------------- /src/Components/Auth/style.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Montserrat|Raleway:400,500,700|Roboto&display=swap"); 2 | *, 3 | *, 4 | ::after, 5 | *::before { 6 | margin: 0; 7 | padding: 0; 8 | box-sizing: border-box; 9 | list-style: none; 10 | border: none; 11 | outline: none; 12 | text-decoration: none; 13 | } 14 | a:hover { 15 | text-decoration: none; 16 | } 17 | 18 | button { 19 | width: 200px; 20 | height: 55px; 21 | font-family: "Montserrat", sans-serif; 22 | font-size: 1.2rem; 23 | text-transform: capitalize; 24 | cursor: pointer; 25 | } 26 | 27 | .container { 28 | max-width: 90%; 29 | margin: 0 auto; 30 | } 31 | 32 | .flex { 33 | display: flex; 34 | } 35 | 36 | .flex-column { 37 | flex-direction: column; 38 | } 39 | 40 | .items-center { 41 | align-items: center; 42 | } 43 | 44 | .justify-center { 45 | justify-content: center; 46 | } 47 | 48 | .justify-between { 49 | justify-content: space-between; 50 | } 51 | 52 | body { 53 | background-color: rgba(244, 255, 246, 0.83); 54 | } 55 | 56 | header { 57 | height: 100vh; 58 | background-image: url("../../img/bg.svg"); 59 | background-size: cover; 60 | background-position: center; 61 | } 62 | header .login, 63 | header .signup { 64 | height: 100%; 65 | } 66 | header .login form, 67 | header .signup form { 68 | width: 80%; 69 | background-color: #fff; 70 | height: 90%; 71 | box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.16); 72 | border-radius: 30px; 73 | overflow: hidden; 74 | position: relative; 75 | } 76 | header .login form aside, 77 | header .signup form aside { 78 | width: 40%; 79 | background-image: linear-gradient(to right, #bc4e9cd1, #f80759b3); 80 | position: relative; 81 | } 82 | header .login form aside:after, 83 | header .signup form aside:after { 84 | width: 100%; 85 | height: 100%; 86 | content: ""; 87 | position: absolute; 88 | top: 0; 89 | left: 0; 90 | background-color: rgba(228, 171, 220, 0.42); 91 | clip-path: circle(30% at 30% 0%); 92 | } 93 | header .login form aside:before, 94 | header .signup form aside:before { 95 | width: 100%; 96 | height: 100%; 97 | content: ""; 98 | position: absolute; 99 | top: 0; 100 | left: 0; 101 | background-color: rgba(228, 171, 220, 0.42); 102 | clip-path: circle(40% at 0% 0%); 103 | } 104 | header .login form aside h1, 105 | header .signup form aside h1 { 106 | font-family: "Roboto", sans-serif; 107 | font-size: 2.5rem; 108 | text-align: center; 109 | color: #fff; 110 | text-transform: capitalize; 111 | line-height: 2; 112 | } 113 | header .login form aside h2, 114 | header .signup form aside h2 { 115 | font-family: "Raleway", sans-serif; 116 | font-size: 1rem; 117 | line-height: 1.7; 118 | letter-spacing: 0.5px; 119 | text-align: center; 120 | padding: 1rem 2rem; 121 | color: #fef; 122 | margin-top: -1rem; 123 | font-weight: 200; 124 | text-transform: capitalize; 125 | } 126 | header .login form aside button, 127 | header .signup form aside button { 128 | border-radius: 30px; 129 | color: #fff; 130 | border: 1px solid #fff; 131 | background-color: transparent; 132 | margin-top: 1rem; 133 | } 134 | header .login form .content, 135 | header .signup form .content { 136 | width: 60%; 137 | } 138 | header .login form .content .text, 139 | header .signup form .content .text { 140 | padding: 2rem 0; 141 | margin-top: -2rem; 142 | } 143 | header .login form .content .text h1, 144 | header .signup form .content .text h1 { 145 | text-align: center; 146 | font-family: "Raleway", sans-serif; 147 | font-size: 2rem; 148 | line-height: 2; 149 | letter-spacing: 1px; 150 | text-transform: capitalize; 151 | color: #bb41aa; 152 | } 153 | header .login form .content .text .icon, 154 | header .signup form .content .text .icon { 155 | margin-bottom: 1rem; 156 | } 157 | header .login form .content .text .icon i, 158 | header .signup form .content .text .icon i { 159 | font-size: 1.7rem; 160 | color: rgba(88, 27, 152, 0.67); 161 | margin-left: 0.5rem; 162 | } 163 | header .login form .content .text span, 164 | header .signup form .content .text span { 165 | font-family: "Raleway", sans-serif; 166 | color: rgba(61, 71, 76, 0.92); 167 | } 168 | header .login form .content .form-group, 169 | header .signup form .content .form-group { 170 | width: 85%; 171 | } 172 | header .login form .content .form-group input, 173 | header .signup form .content .form-group input { 174 | width: 100%; 175 | height: 55px; 176 | font-family: "Raleway", sans-serif; 177 | font-size: 1.1rem; 178 | padding-left: 1rem; 179 | /* text-transform: capitalize; */ 180 | margin-bottom: 1rem; 181 | background-color: #f0f0f0; 182 | border-radius: 4px; 183 | } 184 | header .login form .content .form-group input[type="submit"], 185 | header .signup form .content .form-group input[type="submit"] { 186 | width: 200px; 187 | border-radius: 30px; 188 | text-align: center; 189 | cursor: pointer; 190 | background-image: linear-gradient(to right, #bc4e9c, #f80759); 191 | color: #fff; 192 | } 193 | 194 | @media screen and (max-width: 967px) { 195 | header { 196 | min-height: 120vh !important; 197 | } 198 | header .signup, 199 | header .login { 200 | width: 90%; 201 | min-height: 100% !important; 202 | } 203 | header .signup form, 204 | header .login form { 205 | width: 105% !important; 206 | flex-direction: column !important; 207 | justify-content: center; 208 | align-items: center; 209 | min-height: 110vh; 210 | } 211 | header .signup form aside, 212 | header .login form aside { 213 | width: 100%; 214 | min-height: 40%; 215 | padding-top: 2rem; 216 | } 217 | header .signup form aside h1, 218 | header .login form aside h1 { 219 | font-size: 1.7rem; 220 | margin-top: 1.5rem; 221 | } 222 | header .signup form aside h2, 223 | header .login form aside h2 { 224 | font-size: 1rem; 225 | width: 80%; 226 | } 227 | header .signup form aside button, 228 | header .login form aside button { 229 | margin: 0; 230 | } 231 | header .signup form .content, 232 | header .login form .content { 233 | width: 100%; 234 | min-height: 80%; 235 | justify-content: flex-start; 236 | } 237 | header .signup form .content .text, 238 | header .login form .content .text { 239 | padding: 0; 240 | margin-top: 1rem; 241 | margin-bottom: 1rem; 242 | } 243 | header .signup form .content .text h1, 244 | header .login form .content .text h1 { 245 | font-size: 1.4rem; 246 | } 247 | header .signup form .content .form-group, 248 | header .login form .content .form-group { 249 | width: 95%; 250 | } 251 | header .login form aside { 252 | order: 1 !important; 253 | } 254 | header .login form .content { 255 | order: 2 !important; 256 | } 257 | header .login form .content .text { 258 | margin-top: 3rem; 259 | margin-bottom: 2rem; 260 | } 261 | } 262 | 263 | /*# sourceMappingURL=style.css.map */ 264 | -------------------------------------------------------------------------------- /src/Components/Layout/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { withRouter } from "react-router-dom"; 3 | import SideBar from "./Sidebar"; 4 | 5 | 6 | class Header extends Component { 7 | constructor(props) { 8 | super(props); 9 | this.state = { 10 | search: "", 11 | logged_in: localStorage.getItem("Token") ? true : false 12 | }; 13 | } 14 | 15 | render() { 16 | const { loggedIn } = this.props; 17 | return ( 18 |
19 | {loggedIn && ( 20 | 35 | )} 36 |
37 | ); 38 | } 39 | } 40 | 41 | export default withRouter(Header); 42 | -------------------------------------------------------------------------------- /src/Components/Layout/SideNav.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --navcover-z-index: 99; 3 | --sidenav-z-index: 100; 4 | } 5 | 6 | .nav-cover { 7 | position: fixed; 8 | z-index: var(--navcover-z-index); 9 | top: 0; 10 | right: 0; 11 | width: 0; 12 | height: 100%; 13 | /* background-color: rgba(0, 0, 0, 0.5); */ 14 | } 15 | 16 | .side-nav { 17 | height: 100%; 18 | width: 0; /* to be set in js */ 19 | position: fixed; 20 | overflow-x: hidden; 21 | z-index: var(--sidenav-z-index); 22 | top: 0; 23 | right: 0; 24 | background: white; 25 | padding-top: 3.5rem; 26 | transition: 0.5s; 27 | } 28 | 29 | .side-nav a { 30 | padding: 0.5rem 0.5rem 0.5rem 1rem; 31 | text-decoration: none; 32 | font-size: 17px; 33 | color: #818181; 34 | display: block; 35 | transition: 0.53s; 36 | padding-left: 30px; 37 | padding-top: 20px; 38 | color: black; 39 | font-weight: normal; 40 | } 41 | 42 | /* .side-nav a:hover { 43 | color: #f1f1f1; 44 | } */ 45 | 46 | .sideheader_image { 47 | height: 50px; 48 | width: 250px; 49 | margin-bottom: -20px; 50 | } 51 | 52 | .side-nav .close-nav { 53 | position: absolute; 54 | top: 1rem; 55 | right: 1rem; 56 | font-size: 2.2rem; 57 | } 58 | 59 | .site-wrapper { 60 | transition: margin-left 0.5s; 61 | } 62 | 63 | .open-nav { 64 | font-size: 2rem; 65 | cursor: pointer; 66 | position: relative; 67 | top: -5px; 68 | } 69 | -------------------------------------------------------------------------------- /src/Components/Layout/Sidebar.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./SideNav.css"; 3 | // import User from "../User"; 4 | import Cookies from "universal-cookie"; 5 | import { withRouter } from "react-router-dom"; 6 | import { getUser } from "../../Service/Auth"; 7 | import LogoutPopup from "../../Password/LogoutPop"; 8 | const cookies = new Cookies(); 9 | 10 | class SideBar extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | this.state = { 14 | showNav: false, 15 | status: [], 16 | user: [], 17 | }; 18 | } 19 | 20 | // componentDidMount() { 21 | // if (cookies.get("Token") === null || cookies.get("Token") === undefined) { 22 | 23 | // localStorage.clear(); 24 | // this.props.history.push("/"); 25 | // window.location.reload(1); 26 | 27 | // // setTimeout(function() { 28 | // // window.location.reload(1); 29 | // // }, 1000); 30 | // } else { 31 | // //console.log(cookies.get("Token")); 32 | // } 33 | // } 34 | 35 | async componentDidMount() { 36 | let username = window.localStorage.getItem("username"); 37 | getUser(username).then((data) => { 38 | this.setState({ username: data, status: data.is_superuser }); 39 | }); 40 | } 41 | 42 | onLogout() { 43 | window.localStorage.clear(); 44 | cookies.remove("Token"); 45 | window.location.href = "/"; 46 | window.location.reload(1); 47 | } 48 | 49 | openNavClick = (e) => { 50 | e.preventDefault(); 51 | this.openNav(); 52 | }; 53 | 54 | closeNavClick = (e) => { 55 | e.preventDefault(); 56 | this.closeNav(); 57 | }; 58 | 59 | openNav = () => { 60 | this.setState({ 61 | showNav: true, 62 | }); 63 | 64 | document.addEventListener("keydown", this.handleEscKey); 65 | }; 66 | closeNav = () => { 67 | this.setState({ 68 | showNav: false, 69 | }); 70 | 71 | document.removeEventListener("keydown", this.handleEscKey); 72 | }; 73 | 74 | handleEscKey = (e) => { 75 | if (e.key === "Escape") { 76 | this.closeNav(); 77 | } 78 | }; 79 | 80 | render() { 81 | const { showNav, status } = this.state; 82 | let navCoverStyle = { width: showNav ? "100%" : "0" }; 83 | let sideNavStyle = { width: showNav ? "270px" : "0" }; 84 | console.log(status); 85 | return ( 86 | 87 | 88 | 93 | ☰ 94 | 95 |