forked from boolean-uk/team-dev-client-template
-
Notifications
You must be signed in to change notification settings - Fork 0
functionality added to the right menu #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tzoltie
wants to merge
13
commits into
main
Choose a base branch
from
tim-##-aside_menu
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b84cd77
component extracted from searchResults
tzoltie 4dd62ca
conditional rendering added to properly display the card
tzoltie e93f056
cohorts section of left menu created
tzoltie 4aa40ff
styling for cohort list on left menu
tzoltie 76f08ea
fill of svg updated
tzoltie 193685c
students page created
tzoltie a8fb418
number of students displayed on list shortened
tzoltie 1beafa7
styling updated for students page
tzoltie aa6210d
students page styling
tzoltie a9f0d12
listitem component created
tzoltie 6bd10f0
styling updated for students list item
tzoltie 4859d4f
refactor based on comments from review
tzoltie aa1d464
refactors based on review comments
tzoltie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -12,4 +12,5 @@ | |
| .ReactModal__Body--open, | ||
| .ReactModal__Html--open { | ||
| overflow: hidden; | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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,34 @@ | ||
| import { useEffect, useState } from "react" | ||
| import { getCohorts } from "../../service/apiClient" | ||
| import Card from "../card" | ||
| import { CohortProfileCircle } from "../profileCircle" | ||
|
|
||
| const Cohorts = () => { | ||
| const [cohorts, setCohorts] = useState([]) | ||
| useEffect(() => { | ||
| getCohorts().then(setCohorts) | ||
| }, []) | ||
|
|
||
| return ( | ||
| <Card name="cohorts"> | ||
| {cohorts.length === 0 && ( | ||
| <p>No cohorts found.</p> | ||
| )} | ||
| {cohorts.length > 0 && ( | ||
| <ul className="search-results-list"> | ||
| {cohorts.map((cohort) => ( | ||
| <li key={cohort.id} className="found-user-card"> | ||
| <CohortProfileCircle background='#64DC78'/> | ||
| <div className="found-user-details"> | ||
| <span>{`${cohort.name}`}</span> | ||
| <p>{`Cohort ${cohort.id}`}</p> | ||
| </div> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| )} | ||
| </Card> | ||
| ) | ||
| } | ||
|
|
||
| export default Cohorts |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| import ProfileCircle from "../profileCircle"; | ||
|
|
||
| const ListItem = ({ user, getInitials, currentUser, renderTeacherContent, renderStudentContent, name }) => { | ||
| const searchResults = name === 'searchResults' | ||
| return ( | ||
| <li key={user.id} className='students-user-card'> | ||
| <ProfileCircle | ||
| initials={getInitials(user.firstName, user.lastName)} | ||
| hasCascadingMenu={false} | ||
| /> | ||
|
|
||
| <div className="found-user-details"> | ||
| <span>{`${user.firstName} ${user.lastName}`}</span> | ||
| <p>{`Software Developer, Cohort ${user.cohortId}`}</p> | ||
| </div> | ||
| {searchResults && currentUser.role === "TEACHER" | ||
| ? renderTeacherContent(user) | ||
| : renderStudentContent(user)} | ||
| </li> | ||
| ); | ||
| }; | ||
|
|
||
| export default ListItem |
This file contains hidden or 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 hidden or 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 hidden or 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,27 @@ | ||
| import { useLocation } from "react-router-dom" | ||
| import UserLists from "../../components/userLists" | ||
| import { useState } from "react" | ||
| import Header from "../../components/header" | ||
| import Navigation from "../../components/navigation" | ||
| import './style.css' | ||
|
|
||
| const Students = () => { | ||
| const location = useLocation() | ||
| const { results: studentsState} = location.state || { results: []} | ||
| const [students, setStudents] = useState(studentsState) | ||
| return ( | ||
| <div className="students-page-container"> | ||
| <main className="students-main"> | ||
| <div className="top"> | ||
| <h2>Students</h2> | ||
| </div> | ||
| <div className="students"> | ||
| <UserLists results={ students }/> | ||
| </div> | ||
| </main> | ||
| </div> | ||
|
|
||
| ) | ||
| } | ||
|
|
||
| export default Students |
This file contains hidden or 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 @@ | ||
| .students-page-container { | ||
| display: grid; | ||
| grid-template-columns: auto 1fr; | ||
| grid-template-rows: auto 1fr; | ||
| height: 100vh; | ||
| background-color: #f0f5fa; | ||
| } | ||
|
|
||
| .students-main { | ||
| width: 800px; | ||
| place-self: center; | ||
| } | ||
|
|
||
| .students-user-card { | ||
| display: grid; | ||
| grid-template-columns: 56px 1fr 40px; | ||
| width: 100%; | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this setSelectedProfileId function defined? I can't see it in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is used to remove the rendered profile popup after the three dot button is clicked, and the user clicks on another part of the screen. It's used in the onClickMenu to ensure when the profile is clicked it takes the user to that users profile page