diff --git a/src/components/Homepage/Founders/Founders.js b/src/components/Homepage/Founders/Founders.js index 948d490..4db682b 100644 --- a/src/components/Homepage/Founders/Founders.js +++ b/src/components/Homepage/Founders/Founders.js @@ -1,7 +1,8 @@ import React from "react"; import "./Founders.css"; import Founder from "./Founder/Founder"; -import { Link } from "react-router-dom"; +import { Link } from 'react-router-dom'; + const Founders = () => { return ( @@ -36,9 +37,10 @@ const Founders = () => { out to find a solution, which led us to Groundworks. Our way to revolutionise how companies connect with students worldwide.
- - - + + ); diff --git a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js index 37f4f4f..71a3c2a 100644 --- a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js +++ b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js @@ -1,10 +1,12 @@ import React, { useState } from "react"; +import {withRouter} from 'react-router-dom' import "./RegisterPortal.css"; import axios from "axios"; -const RegisterPortal = () => { - const [user, setUser] = useState(""); +const RegisterPortal = (props) => { + const [user, setUser] = useState(""); + const [redirect, setRedirect] = useState(false); const [data, setData] = useState({ userName: "", email: "", @@ -22,13 +24,18 @@ const RegisterPortal = () => { const handleSubmit = e => { e.preventDefault(); + setRedirect(!redirect); console.log(data); console.log(user); - + console.log(props); const addRegister = async () => { console.log(`Fake submitting: ${data}`); try { - return await axios.post(`/api/${user}/join`, data); + const response = await axios.post(`/api/${user}/join`, data); + if(response.status === 200 ) // check if response status is ok + {props.history.push('/StudentSignup') + //success scenario + } } catch (error) { console.error(error); } @@ -43,7 +50,13 @@ const RegisterPortal = () => { password: "", userType: "" }); - }; + } + + // render() { + // if (redirect === true) { + // return