From 60a4c7b8fabf379345b2baadff937d53ef7b7e50 Mon Sep 17 00:00:00 2001 From: misterrodger Date: Fri, 21 Jun 2019 12:38:19 +0300 Subject: [PATCH] Update Student profile cars and RegisterPortal - Relates #115 - - --- .../RegisterPortal/RegisterPortal.css | 2 +- .../RegisterPortal/RegisterPortal.js | 116 +++++++++++++----- .../StudentCompletedJobCard.js | 14 +-- .../CurrentJobCard/CurrentJobCard.js | 14 +-- .../StudentDashboard/NewJobCard/NewJobCard.js | 14 +-- .../ShortStudentProfile.js | 4 +- .../ShortStudentProfileCard.js | 4 +- .../StudentJobsToggle/StudentJobsToggle.js | 8 +- 8 files changed, 113 insertions(+), 63 deletions(-) diff --git a/src/components/LoginRegister/RegisterPortal/RegisterPortal.css b/src/components/LoginRegister/RegisterPortal/RegisterPortal.css index f302288..dd23564 100644 --- a/src/components/LoginRegister/RegisterPortal/RegisterPortal.css +++ b/src/components/LoginRegister/RegisterPortal/RegisterPortal.css @@ -8,7 +8,7 @@ } .form--el { - margin: 1rem 1rem 0 0; + margin: .4rem .4rem 0 0; } .form--title { diff --git a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js index 71a3c2a..f789786 100644 --- a/src/components/LoginRegister/RegisterPortal/RegisterPortal.js +++ b/src/components/LoginRegister/RegisterPortal/RegisterPortal.js @@ -6,12 +6,18 @@ import axios from "axios"; const RegisterPortal = (props) => { const [user, setUser] = useState(""); - const [redirect, setRedirect] = useState(false); const [data, setData] = useState({ userName: "", email: "", password: "", - userType: "" + phoneNumber: "", + userType: "", + university: "", + yearOfStudy: "", + courseStudied: "", + skills: "", + aboutYou: "", + LinkedinURL: "" }); const handleChange = event => { @@ -22,18 +28,19 @@ const RegisterPortal = (props) => { }); }; - const handleSubmit = e => { - e.preventDefault(); - setRedirect(!redirect); + const handleSubmit = event => { + event.preventDefault(); console.log(data); console.log(user); console.log(props); + const addRegister = async () => { console.log(`Fake submitting: ${data}`); + console.log(user); try { - const response = await axios.post(`/api/${user}/join`, data); + const response = await axios.post(`/api/${user}/sign-up`, data); if(response.status === 200 ) // check if response status is ok - {props.history.push('/StudentSignup') + {props.history.push('/StudentDashboard') //success scenario } } catch (error) { @@ -41,52 +48,39 @@ const RegisterPortal = (props) => { } }; addRegister(); - // props.history.push("/StudentDashboard"); setData({ userName: "", email: "", password: "", - userType: "" + phoneNumber: "", + userType: "", + university: "", + yearOfStudy: "", + courseStudied: "", + skills: "", + aboutYou: "", + LinkedinURL: "" }); } - // render() { - // if (redirect === true) { - // return - // } - // } - return (
-
+

Welcome to Groundworks.

Enter details below.

@@ -114,6 +108,62 @@ const RegisterPortal = (props) => { name="password" value={data.password} /> +

Phone

+ +

University

+ +

Year of Study

+ +

Course of Study

+ +

Skills

+ +

About You

+ +

LinkedIn:

+ {

- Completed Project Name: {value.projectName} + {value.companyName}

- Project Brief: {value.projectBrief} + Brief: {value.projectBrief}

-

Company Name: {value.companyName}

-

Contact Person: {value.contactPerson}

+

Project: {value.projectName}

+

Contact: {value.contactPerson}

-

Project Price: {value.projectPrice}

-

Estimated Workload: {value.estimatedWorkload}

-

Project Deadline: {value.projectDeadline}

+

Pay: {value.projectPrice}

+

Hours: {value.estimatedWorkload}

+

Due: {value.projectDeadline}

diff --git a/src/components/StudentDashboard/CurrentJobCard/CurrentJobCard.js b/src/components/StudentDashboard/CurrentJobCard/CurrentJobCard.js index 92efe18..5b44ae9 100644 --- a/src/components/StudentDashboard/CurrentJobCard/CurrentJobCard.js +++ b/src/components/StudentDashboard/CurrentJobCard/CurrentJobCard.js @@ -20,20 +20,20 @@ const StudentCurrentJobCard = props => {

- Current Project Name: {value.projectName} + {value.companyName}

- Project Brief: {value.projectBrief} + Brief: {value.projectBrief}

-

Company Name: {value.companyName}

-

Contact Person: {value.contactPerson}

+

Project: {value.projectName}

+

Contact: {value.contactPerson}

-

Project Price: {value.projectPrice}

-

Estimated Workload: {value.estimatedWorkload}

-

Project Deadline: {value.projectDeadline}

+

Pay: {value.projectPrice}

+

Hours: {value.estimatedWorkload}

+

Due: {value.projectDeadline}

diff --git a/src/components/StudentDashboard/NewJobCard/NewJobCard.js b/src/components/StudentDashboard/NewJobCard/NewJobCard.js index 4051302..aee6b3d 100644 --- a/src/components/StudentDashboard/NewJobCard/NewJobCard.js +++ b/src/components/StudentDashboard/NewJobCard/NewJobCard.js @@ -20,20 +20,20 @@ const StudentNewJobCard = props => {

- Student Project Name: {value.projectName} + {value.companyName}

- Project Brief: {value.projectBrief} + Brief: {value.projectBrief}

-

Company Name: {value.companyName}

-

Contact Person: {value.contactPerson}

+

Project: {value.projectName}

+

Contact: {value.contactPerson}

-

Project Price: {value.projectPrice}

-

Estimated Workload: {value.estimatedWorkload}

-

Project Deadline: {value.projectDeadline}

+

Pay: {value.projectPrice}

+

Hours: {value.estimatedWorkload}

+

Due: {value.projectDeadline}

diff --git a/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfile.js b/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfile.js index e989c26..2bc330e 100644 --- a/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfile.js +++ b/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfile.js @@ -11,12 +11,12 @@ const ShortStudentProfile = ({ name, course, university, year }) => {

{name}

{course}

{university}

-

{year}

+

Year {year}

diff --git a/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfileCard.js b/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfileCard.js index cb568e4..452da29 100644 --- a/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfileCard.js +++ b/src/components/StudentDashboard/ShortStudentProfileCard/ShortStudentProfileCard.js @@ -7,7 +7,7 @@ const ShortStudentProfileCard = () => { useEffect(() => { const fetchData = async () => { - const result = await axios("/api/student/get-student/5d0783ded1ea443e7621cc88"); + const result = await axios("/api/student/get-student/5d0c022affa1b43f5cbb270e"); console.log(result.data); setProfile(result.data); }; @@ -18,7 +18,7 @@ const ShortStudentProfileCard = () => { return (
{ - const [grey1, setGrey1] = useState(false); + const [grey1, setGrey1] = useState(true); const [grey2, setGrey2] = useState(false); const [grey3, setGrey3] = useState(false);