From 246123ea4fc44a1e7eb730135d18f25187d0b826 Mon Sep 17 00:00:00 2001 From: Bryant Xia Date: Tue, 25 Jan 2022 20:20:45 -0500 Subject: [PATCH] grind sesh --- client/src/components/App.js | 5 -- client/src/components/pages/AddCollege.js | 2 +- client/src/components/pages/Profile.css | 8 +-- client/src/components/pages/Profile.js | 62 ++++++++--------------- 4 files changed, 25 insertions(+), 52 deletions(-) diff --git a/client/src/components/App.js b/client/src/components/App.js index bfc73b0..d6680d4 100644 --- a/client/src/components/App.js +++ b/client/src/components/App.js @@ -46,11 +46,6 @@ const App = () => { return ( <> - - handleLogin={handleLogin} - handleLogout={handleLogout} - userId={userId} - {



- +



diff --git a/client/src/components/pages/Profile.css b/client/src/components/pages/Profile.css index 09d063a..5d0ba7d 100644 --- a/client/src/components/pages/Profile.css +++ b/client/src/components/pages/Profile.css @@ -1,6 +1,6 @@ .header { width: 100%; - height: 75px; + height: 10vh; display: flex; justify-content: center; align-items: center; @@ -15,17 +15,17 @@ .grid-item { width: 33.33333%; - height: 700px; + height: 90vh; overflow-y: scroll; } .item-1 { - background-color: #FACFAD + background-color: white } .item-2 { background-color: white } .item-3 { - background-color: greenyellow + background-color: white } .NavBar-container { diff --git a/client/src/components/pages/Profile.js b/client/src/components/pages/Profile.js index 8e49b04..3f26660 100644 --- a/client/src/components/pages/Profile.js +++ b/client/src/components/pages/Profile.js @@ -40,15 +40,15 @@ const Profile = (props) => { ) } + else{ - useEffect(() => { - get("/api/user", {userid: props.userId}).then((user) => { - setColleges(user.colleges); - setDeadlines(user.app_deadlines); - setDecisions(user.decision_dates); - setTypes(user.college_type); - }) - }, []) + + get("/api/user", {userid: props.userId}).then((user) => { + setColleges(user.colleges); + setDeadlines(user.app_deadlines); + setDecisions(user.decision_dates); + setTypes(user.college_type); + }) if (colleges == null){ hasStuff = false; @@ -56,14 +56,16 @@ const Profile = (props) => { else{ hasStuff = true; } + var bigList = []; + if (hasStuff){ for (var j=0; j { return 0; } }); - for (var i=0; i

{bigList[i][2]}

App Deadline: {bigList[i][0]}

-

--------------------------------------------------------------------------------------

- - ) - } - bigList.sort(function(x, y) { - if (Date.parse(x[1])-Date.parse(y[1]) < 0){ - return -1; - } - else if (Date.parse(x[1])-Date.parse(y[1])>0){ - return 1; - } - else{ - return 0; - } - }); - for (var i=0; i -

{bigList[i][2]}

Decision Date: {bigList[i][1]}

-

--------------------------------------------------------------------------------------

+
) } - } else{ deadlinesList =
No App Deadlines or Decisions!
@@ -128,32 +109,29 @@ const Profile = (props) => {
-
+

Profile Info

Name: {props.userIdentity}

Number of Applications: {deadlinesList.length}

Number of Reaches: {reaches}

Number of Targets: {targets}

Number of Safeties: {safeties}

-
-

Decision Dates:

-

-------------------------------------------------------------------

- {decisionsList}
-

Application Deadlines:

-

-------------------------------------------------------------------

- {deadlinesList}
+

Dates:

+
+ {deadlinesList} +
) : (