Skip to content

Commit

Permalink
Merge pull request #159 from capelhoworth/#60-no-skills-dropdown
Browse files Browse the repository at this point in the history
added conditional on sessions signup page so if no mentors are availa…
  • Loading branch information
nzeager authored Sep 6, 2023
2 parents 1b40a0d + 552549c commit c383470
Showing 1 changed file with 39 additions and 31 deletions.
70 changes: 39 additions & 31 deletions src/pages/SessionSignup/SessionSignup.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,38 +317,46 @@ export default function SessionSignup({ token }) {
>
Select a Mentor for {selectedDayLabel}:
</Typography>
{/* Once a skill and day is selected view a list of mentors that have the skill selected and have an open avaliblity on the day they selected */}
<Grid
container
marginTop={"2rem"}
justifyContent={"center"}
sx={{ paddingBottom: "5rem" }}
>
{filteredMentors.map((mentor) =>
mentor.skills ? (
<Grid
item
xs={12}
sm={6}
md={3}
key={mentor.pk}
sx={{ padding: 1 }}
>
<MentorCard
mentor={mentor}
token={token}
selectedDay={selectedDay}
handleSlotSelect={handleSlotSelect}
handleSubmitSession={handleSubmitSession}
issue={issue}
setIssue={setIssue}
/>
</Grid>
) : null
)}
</Grid>
{/* Conditionally render the message if no mentors are available */}
{selectedSkill && selectedDay && filteredMentors.length === 0 ? (
<Typography
variant="h6"
sx={{ marginTop: "1rem", marginLeft: "4.5rem", color: "#FFFFFF" }}
>
No mentors are available for {selectedSkill} at this time.
</Typography>
) : (
<Grid
container
marginTop={"2rem"}
justifyContent={"center"}
sx={{ paddingBottom: "5rem" }}
>
{filteredMentors.map((mentor) =>
mentor.skills ? (
<Grid
item
xs={12}
sm={6}
md={3}
key={mentor.pk}
sx={{ padding: 1 }}
>
<MentorCard
mentor={mentor}
token={token}
selectedDay={selectedDay}
handleSlotSelect={handleSlotSelect}
handleSubmitSession={handleSubmitSession}
issue={issue}
setIssue={setIssue}
/>
</Grid>
) : null
)}
</Grid>
)}
</Box>

{/* <SessionForm /> */}
</Box>
);
Expand Down

0 comments on commit c383470

Please sign in to comment.