From 3155f6f9f250c51d3add8118fd74f81386659af4 Mon Sep 17 00:00:00 2001 From: dalmano Date: Tue, 18 Jun 2019 15:45:50 +0100 Subject: [PATCH] render student data Relates #96 --- .../LongStudentProfile.js | 1 + .../LongStudentProfileCard.js | 37 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfile.js diff --git a/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfile.js b/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfile.js new file mode 100644 index 0000000..85aed6a --- /dev/null +++ b/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfile.js @@ -0,0 +1 @@ +import React, { useState, useEffect } from "react"; diff --git a/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfileCard.js b/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfileCard.js index 7a74519..632b05a 100644 --- a/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfileCard.js +++ b/src/components/ClientDashboard/LongStudentProfileCard/LongStudentProfileCard.js @@ -1,28 +1,43 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import "./LongStudentProfileCard.css"; import AcceptDecline from "../../AccectDeclineButtons/AcceptDecline.js"; +import axios from "axios"; const LongStudentProfileCard = () => { + const [data, setData] = useState([]); + + useEffect(() => { + const fetchData = async () => { + const result = await axios( + "/api/student/get-student/5d0783ded1ea443e7621cc88" + ); + console.log(result.data); + setData(result.data); + }; + fetchData(); + }, []); + return (
-

Student Name

+

+ Student Name: {data.firstName} + {data.lastName} +

- Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem - Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum - Lorem Ipsum + About Myself: {data.aboutYou}

-

Student Email

-

Student Phone

-

Student Linkedin

+

Email: {data.email}

+

Phone: {data.phoneNumber}

+

Linkedin: {data.LinkedinURL}

-

University name

-

Location

-

Year of Study

+

University: {data.university}

+

Course Studied: {data.courseStudied}

+

Year of Study: {data.yearOfStudy}