Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ const App = () => {

return (
<>
<NavBar>
handleLogin={handleLogin}
handleLogout={handleLogout}
userId={userId}
</NavBar>
<Router>
<Skeleton path="/" handleLogin={handleLogin} handleLogout={handleLogout} userId={userId} userIdentity={userIdentity} />
<Profile path="/Profile"
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/pages/AddCollege.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const AddCollege = ({userId}) => {
<input type="text" placeholder="College" size="50" ref={nameEl} />
<br></br>
<br></br>
<input type="checkbox" value="Reach Target Safety" placeholder="Pick College Type" size="50" ref={typeEl}/>
<input type="text" placeholder="Input type (R for reaches, T for targets, S for safeties)" size="50" ref={typeEl} />
<br></br>
<br></br>
<input type="text" placeholder="Application Deadline (MM/DD/YY)" size="50" ref={deadlineEl} />
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/pages/Profile.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.header {
width: 100%;
height: 75px;
height: 10vh;
display: flex;
justify-content: center;
align-items: center;
Expand All @@ -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 {
Expand Down
62 changes: 20 additions & 42 deletions client/src/components/pages/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,32 @@ 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;
}
else{
hasStuff = true;
}

var bigList = [];

if (hasStuff){
for (var j=0; j<colleges.length; j++){
var temp = [deadlines[j], decisions[j], colleges[j]];
console.log(temp);
bigList.push(temp);
}
//this sorts the list of deadlines we are displaying by earliest deadline

bigList.sort(function(x, y) {
if (Date.parse(x[0])-Date.parse(y[0]) < 0){
return -1;
Expand All @@ -75,37 +77,16 @@ const Profile = (props) => {
return 0;
}
});

for (var i=0; i<colleges.length; i++){
deadlinesList.push(
<div>
<h2>{bigList[i][2]}</h2>
<h3>App Deadline: {bigList[i][0]}</h3>
<h3>--------------------------------------------------------------------------------------</h3>
</div>
)
}
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<colleges.length; i++){
decisionsList.push(
<div>
<h2>{bigList[i][2]}</h2>
<h3>Decision Date: {bigList[i][1]}</h3>
<h3>--------------------------------------------------------------------------------------</h3>
<hr></hr>
</div>
)
}

}
else{
deadlinesList = <div>No App Deadlines or Decisions!</div>
Expand All @@ -128,32 +109,29 @@ const Profile = (props) => {
<div>
<nav className="header">
<font>
<strong>Welcome back {props.userIdentity} </strong>
<button onClick={handleAddCollege} className="button-54"> Add College </button>
<button onClick={handleDashboard} className="button-54"> Your Dashboard </button>
<strong>Welcome back {props.userIdentity}</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onClick={handleAddCollege} className="button-54"> Add College </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onClick={handleDashboard} className="button-54"> Your Dashboard </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onClick={handleHome} className="button-54"> Home Page </button>

</font>
</nav>
<div className="grid">
<div className="grid-item item-1">
<div className="grid-item item-1">
<h1>Profile Info</h1>
<h2>Name: {props.userIdentity}</h2>
<h2>Number of Applications: {deadlinesList.length}</h2>
<h2>Number of Reaches: {reaches}</h2>
<h2>Number of Targets: {targets}</h2>
<h2>Number of Safeties: {safeties}</h2>

</div>
<div className="grid-item item-2">
<h1>Decision Dates: </h1>
<h2>-------------------------------------------------------------------</h2>
{decisionsList}
</div>
<div className="grid-item item-3">
<h1>Application Deadlines: </h1>
<h2>-------------------------------------------------------------------</h2>
{deadlinesList}</div>
<h1>Dates: </h1>
<hr></hr>
{deadlinesList}
</div>
</div>
</div>
) : (
Expand Down