From a6eba6703bfde11b0a6a84a648872e4ed76b97b1 Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:01:51 +0530 Subject: [PATCH 01/84] Update App.js --- src/components/App.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/App.js b/src/components/App.js index d0c2135..948591f 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -6,11 +6,14 @@ import * as actions from "../actions"; import Login from "./Login"; import Signup from "./Signup"; import About from "./About"; +import ResetLink from "./ResetLink"; import Dashboard from "./Dashboard"; +import ResetPassword from "./ResetPassword"; import SurveyNew from "./SurveyNew"; import Header from "./Header"; import "./App.css"; import ActivationEmail from "./ActivationEmail"; +// import ResetPassword from "./ResetPassword.js"; class App extends Component { // componentDidMount() { @@ -46,7 +49,12 @@ class App extends Component { path="/api/activate/:token" component={ActivationEmail} /> - + + + + + + {/* */} From bbbaa25ca01ca95d38074037e6ffb7b85d6200a2 Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:03:32 +0530 Subject: [PATCH 02/84] Update Login.js --- src/components/Login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Login.js b/src/components/Login.js index 49889ed..327eaf3 100644 --- a/src/components/Login.js +++ b/src/components/Login.js @@ -82,7 +82,7 @@ const Login = () => { required /> - + Forget Password ? From b72140bc187a598edd1f9535c263de3bd645acfd Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 19:05:43 +0530 Subject: [PATCH 03/84] Add files via upload --- src/components/ResetLink.js | 49 +++++++++++++++++++++++++++++ src/components/ResetPassword.css | 31 ++++++++++++++++++ src/components/ResetPassword.js | 54 ++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 src/components/ResetLink.js create mode 100644 src/components/ResetPassword.css create mode 100644 src/components/ResetPassword.js diff --git a/src/components/ResetLink.js b/src/components/ResetLink.js new file mode 100644 index 0000000..745688a --- /dev/null +++ b/src/components/ResetLink.js @@ -0,0 +1,49 @@ +import React, { useState } from "react"; +import axios from "axios"; + +const initialState = { + email: "", + err: "", + success: "", +}; + +const ResetLink = () => { + const [data, setData] = useState(initialState); + const { email, err, success } = data; + + const handleChangeInput = (e) => { + const { name, value } = e.target; + setData({ ...data, [name]: value, err: "", success: "" }); + }; + + const forgetPassword = async () => { + try { + const res = await axios.post("http://localhost:3000/api/resetlink", { + email, + }); + return setData({ ...data, err: "", success: res.data.msg }); + } catch (err) { + console.log(err); + console.log(email); + } + }; + + return ( +
+
+

Forget Password? Don't Worry we got you!

+ + + + +
+
+ ); +}; +export default ResetLink; diff --git a/src/components/ResetPassword.css b/src/components/ResetPassword.css new file mode 100644 index 0000000..c662c63 --- /dev/null +++ b/src/components/ResetPassword.css @@ -0,0 +1,31 @@ +fg_pass h2 { + color: #555; + text-transform: uppercase; + text-align: center; + font-size: 2rem; + margin: 50px 0; + letter-spacing: 1.3px; +} +.fg_pass .row { + max-width: 500px; + margin: auto; + padding: 0 10px; +} +.fg_pass .row input { + width: 100%; + height: 45px; + border: 1px solid #ccc; + outline: none; + padding: 0 15px; + border-radius: 3px; + margin: 5px 0; +} +.fg_pass .row button { + background: #333; + color: white; + padding: 10px 30px; + text-transform: uppercase; + letter-spacing: 1.3px; + border-radius: 3px; + margin-top: 15px; +} diff --git a/src/components/ResetPassword.js b/src/components/ResetPassword.js new file mode 100644 index 0000000..93bea59 --- /dev/null +++ b/src/components/ResetPassword.js @@ -0,0 +1,54 @@ +import React, { useState } from "react"; +import axios from "axios"; +import { useParams } from "react-router-dom"; +import "./ResetPassword.css"; +const initialState = { + password: "", + err: "", + success: "", +}; + +function ResetPassword() { + const [data, setData] = useState(initialState); + const { token } = useParams(); + + const { password, err, success } = data; + + const handleChangeInput = (e) => { + const { name, value } = e.target; + setData({ ...data, [name]: value, err: "", success: "" }); + }; + + const handleResetPassword = async () => { + try { + const res = await axios.post( + `http://localhost:2000/api/changepassword/${token}`, + { password }, + { + headers: { Authorization: token }, + } + ); + return setData({ ...data, err: "", success: res.data.msg }); + } catch (err) { + console.log(err); + } + }; + + return ( +
+

Reset Password

+
+ + + +
+
+ ); +} +export default ResetPassword; From 6d109fb00507a198f5741f198c6e1167c3f08380 Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:42:11 +0530 Subject: [PATCH 04/84] Update Signup.css --- src/components/Signup.css | 116 -------------------------------------- 1 file changed, 116 deletions(-) diff --git a/src/components/Signup.css b/src/components/Signup.css index 731176a..f55cd88 100644 --- a/src/components/Signup.css +++ b/src/components/Signup.css @@ -1,120 +1,4 @@ -/* * { - margin: 0; - padding: 3px; -} - -body { - background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/38816/image-from-rawpixel-id-2044837-jpeg.jpg") - center center no-repeat; - background-size: cover; - width: 100vw; - height: 100vh; - display: grid; - align-items: center; - justify-items: center; - font-size: 65pt; - font-family: "Spartan"; - color: #366a83; -/* } -.contact-us { - background: #f8f4e5; - padding: 50px 100px; - border-top: 10px solid #f45702; -} - -.form-title { - padding-left: 58px; - color: #277eb1; -} - -.register { - color: #366a83; -} - -.clearfix { - color: #366a83; - text-decoration: none; - padding-left: 50px; - font-size: 15pt; -} -label, -input, -textarea { - display: block; - width: 100%; - font-size: 15pt; - line-height: 24pt; - font-family: "Spartan"; -} -input { - margin-bottom: 12pt * 2; -} - -h3 { - font-weight: normal; - font-size: 10pt; - line-height: 12pt * 2; - font-style: italic; - margin: 0 0 0.5em 0; -} -span { - font-size: 8pt; -} -em { - color: #f45702; - font-weight: bold; -} -input, -textarea { - border: none; - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 2px; - background: #f8f4e5; - padding-left: 5px; - outline: none; -} -input:focus, -textarea:focus { - border: 1px solid #6bd4b1; -} -textarea { - resize: none; -} - -button { - display: block; - float: right; - line-height: 12pt * 2; - padding: 0 20px; - border: none; - background: #f45702; - color: white; - letter-spacing: 2px; - transition: 0.2s all ease-in-out; - border-bottom: 2px solid transparent; - outline: none; - - /* &:hover - background: inherit - color: #f45702 - border-bottom: 2px solid #f45702 */ -/* } -::selection { - background: rgb(255, 199, 184); -} */ -/* -input:-webkit-autofill, -input:-webkit-autofill:hover, -input:-webkit-autofill:focus, -textarea:-webkit-autofill, -textarea:-webkit-autofill:hover, -textarea:-webkit-autofill:focus { - border: 1px solid #6bd4b1; - -webkit-text-fill-color: #2a293e; -} */ -/* -webkit-box-shadow: 0 0 0px 1000px #f8f4e5; inset} */ -/* transition: background-color 5000s ease-in-out 0s} */ .head { position: absolute; From 20c8c0d56f1afd1fada4d072eca3e0ccfcb4e5a9 Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:43:30 +0530 Subject: [PATCH 05/84] Update Dashboard.js --- src/components/Dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index 5f91b8f..c01e2b5 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -1,5 +1,5 @@ const DashBoard = () => { - return

Hiiiii DashBoard

; + return

Hi this is DashBoard

; }; export default DashBoard; From e494334da41e7b5caef35a13fed8956739ff1d2e Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:44:14 +0530 Subject: [PATCH 06/84] Update App.js --- src/components/App.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 948591f..0ad585e 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -16,19 +16,14 @@ import ActivationEmail from "./ActivationEmail"; // import ResetPassword from "./ResetPassword.js"; class App extends Component { - // componentDidMount() { - // this.props.fetchUser(); - // } + render() { return (
- {/* -
- */} - {/*
*/} + From bcdbb7a3581aee19ab22392aa4a787c929a86eb6 Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:45:59 +0530 Subject: [PATCH 07/84] Update ActivationEmail.js --- src/components/ActivationEmail.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/components/ActivationEmail.js b/src/components/ActivationEmail.js index 0fd5bda..6fb4b2c 100644 --- a/src/components/ActivationEmail.js +++ b/src/components/ActivationEmail.js @@ -26,26 +26,13 @@ function ActivationEmail() { } }, [token]); - // const res = await fetch("/api/signup", { - // method: "POST", - // headers: { - // "Content-Type": "application/json", - // }, - - // const [err, setErr] = useState(""); - // const [success, setSuccess] = useState(""); - // useEffect(()=>{ - // if(tonpmken){ - // const - // } - // }) return (
{err && showErrMsg(err)} {success && showSuccessMsg(success)} {/* Kindly click on this link */}

Successs!!

- {/*
); } From 1c16040263dd6275b1d4e0ab1b656a9bcdffe73d Mon Sep 17 00:00:00 2001 From: SanjamSinghKalsi <80076219+SanjamSinghKalsi@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:46:36 +0530 Subject: [PATCH 08/84] Update About.js --- src/components/About.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/About.js b/src/components/About.js index ebdb35a..a525bd8 100644 --- a/src/components/About.js +++ b/src/components/About.js @@ -4,13 +4,7 @@ import "./About.css"; const About = () => { return ( <> - {/* - - */} - - {/* */} - {/*