forked from CodeYourFuture/cyf-final-project-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from RbAvci/RbAvci-Frontend---Display-all-user…
…s-for-Mentor-/-recruiter #68-Frontend - Display all users for Mentor / recruiter- Rabia Avci
- Loading branch information
Showing
9 changed files
with
313 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.grad-card { | ||
border: 1px solid #DEDEDE; | ||
text-align: center; | ||
width: 220px; | ||
text-decoration: none; | ||
color: #333333; | ||
transition: box-shadow 0.3s ease; | ||
border-radius: 3rem; | ||
box-shadow: 0 5px 20px 10px rgba(0, 0, 0, 0.1); | ||
margin: 2rem; | ||
padding: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.grad-card img { | ||
border-radius: 50%; | ||
width: 150px; | ||
height: 150px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.grad-card h3 { | ||
margin: 10px 0; | ||
font-size: 1.2em; | ||
color: #333333; | ||
} | ||
|
||
.grad-card p { | ||
margin: 5px 0; | ||
color: #888888; | ||
} | ||
|
||
.grad-card:hover { | ||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.grad-card a { | ||
text-decoration: none; | ||
color: #333333; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import "./GradCard.css"; | ||
|
||
const GradCard = ({ grad }) => { | ||
return ( | ||
<Link to={`/profile/${grad.id}`} className="grad-card" key={grad.id}> | ||
<img | ||
src={`https://github.com/${grad.github_username}.png`} | ||
alt={`${grad.username}'s Avatar`} | ||
/> | ||
<h3>{grad.username}</h3> | ||
<p>Activity Score: </p> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default GradCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
.mentor-dashboard { | ||
font-family: 'Arial', sans-serif; | ||
padding: 20px; | ||
background-color: #F9F9F9; | ||
min-height: 100vh; | ||
} | ||
|
||
.mentor-dashboard header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 20px; | ||
margin-top: 75px; | ||
} | ||
|
||
.mentor-dashboard header h1 { | ||
font-family: "Lato", sans-serif; | ||
font-weight: 300; | ||
color: #333333; | ||
text-decoration: none; | ||
} | ||
|
||
.header-links a { | ||
margin-left: 20px; | ||
text-decoration: none; | ||
color: #333333; | ||
font-size: 16px; | ||
font-family: "Lato", sans-serif; | ||
font-weight: 400; | ||
} | ||
|
||
.header-links a:hover { | ||
text-decoration: underline; | ||
color: #333333; | ||
} | ||
|
||
#filter-search { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 10px; | ||
padding: 1rem; | ||
border-radius: 1rem; | ||
box-shadow: 0 5px 20px 10px rgba(0, 0, 0, 0.2); | ||
margin-bottom: 20px; | ||
} | ||
|
||
#filter-search input, | ||
#filter-search select { | ||
width: 100%; | ||
max-width: 300px; | ||
padding: 10px; | ||
margin: 10px 0; | ||
border: 1px solid #A9A9A9; | ||
border-radius: 4px; | ||
box-sizing: border-box; | ||
padding-left: 50px; | ||
} | ||
|
||
#filter-search input:focus, | ||
#filter-search select:focus { | ||
border-color: #EE4434; | ||
} | ||
|
||
#grads-cards { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
gap: 20px; | ||
} | ||
|
||
.grad-card { | ||
display: block; | ||
background-color: #ffffff; | ||
padding: 20px; | ||
border: 1px solid #DEDEDE; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
width: 220px; | ||
color: #333333; | ||
transition: box-shadow 0.3s ease; | ||
} | ||
|
||
.grad-card img { | ||
border-radius: 50%; | ||
width: 100px; | ||
height: 100px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.grad-card h3 { | ||
margin: 10px 0; | ||
font-size: 1.2em; | ||
} | ||
|
||
.grad-card p { | ||
margin: 5px 0; | ||
color: #888888; | ||
} | ||
|
||
.grad-card:hover { | ||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
#show-all-grads { | ||
padding: 10px 15px; | ||
background-color: #EE4434; | ||
color: white; | ||
font-weight: bold; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
#show-all-grads:hover { | ||
background-color: #d32f2f; | ||
} | ||
|
||
.search-container { | ||
position: relative; | ||
} | ||
|
||
.search-icon { | ||
position: absolute; | ||
top: 50%; | ||
left: 10px; | ||
transform: translateY(-50%); | ||
color: #888888; | ||
pointer-events: none; | ||
} | ||
|
||
#search { | ||
padding-left: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import "./MentorDashboard.css"; | ||
import GradCard from "../components/GradsCards/GradCard"; | ||
import "@fortawesome/fontawesome-free/css/all.min.css"; | ||
|
||
const MentorDashboard = () => { | ||
const [grads, setGrads] = useState([]); | ||
|
||
useEffect(() => { | ||
fetch("api/getAllGradUsers", { | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${localStorage.getItem("token")}`, | ||
}, | ||
}) | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
console.log(JSON.stringify(data)); | ||
if (data.success) { | ||
setGrads(data.data); | ||
} else { | ||
console.error("Failed to fetch graduate users"); | ||
} | ||
}) | ||
.catch((error) => console.error("Error fetching graduate users:", error)); | ||
}, []); | ||
|
||
return ( | ||
<div className="mentor-dashboard"> | ||
<header> | ||
<h1>Welcome Mentor</h1> | ||
<div className="header-links"> | ||
<a href="/settings">Settings</a> | ||
<a href="/logout">Logout</a> | ||
</div> | ||
</header> | ||
|
||
<section id="filter-search"> | ||
<div className="search-container"> | ||
<i className="fas fa-search search-icon"></i> | ||
<input | ||
type="text" | ||
id="search" | ||
placeholder="Search by name & skill..." | ||
/> | ||
</div> | ||
<input type="text" id="skill-filter" placeholder="Filter by skill..." /> | ||
<div className="sort-select-container"> | ||
<select id="sort-order"> | ||
<option value="">Sort by activity score</option> | ||
<option value="asc">Ascending</option> | ||
<option value="desc">Descending</option> | ||
</select> | ||
</div> | ||
<button id="show-all-grads">Show All Grads</button> | ||
</section> | ||
|
||
<section id="grads-cards"> | ||
{grads.map((grad) => ( | ||
<GradCard grad={grad} key={grad.id} /> | ||
))} | ||
</section> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MentorDashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters