Skip to content
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

Moved mentee sessions to profile #184

Merged
merged 1 commit into from
Sep 18, 2023
Merged
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
11 changes: 0 additions & 11 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Profile from "./pages/Register/Profile";
import EditProfile from "./pages/Profile/EditProfile";
import MentorSessions from "./pages/Sessions/MentorSessions";
import SessionSignup from "./pages/SessionSignup/SessionSignup";
import MenteeSessions from "./pages/Sessions/MenteeSessions";
import TimeSlot from "./pages/Profile/TimeSlot";
import CurrentAvailabilities from "./pages/Profile/Current Availabilities";
import { Routes, Route } from "react-router-dom";
Expand Down Expand Up @@ -149,16 +148,6 @@ function App() {
/>
}
/>
<Route
path="/menteesessions"
element={
<MenteeSessions
token={token}
setAuth={setAuth}
isLoggedIn={isLoggedIn}
/>
}
/>
<Route
path="/sessionsignup"
element={
Expand Down
21 changes: 8 additions & 13 deletions src/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from "react-router-dom";
import { useState, useEffect } from "react";
import { useState } from "react";
import AppBar from "@mui/material/AppBar";
import Box from "@mui/material/Box";
import Toolbar from "@mui/material/Toolbar";
Expand All @@ -9,7 +9,6 @@ import IconButton from "@mui/material/IconButton";
import MenuIcon from "@mui/icons-material/Menu";
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import axios from "axios";
import PacmanLoader from "react-spinners/PacmanLoader";

const NavBar = ({ handleLogout, isLoggedIn, token, loading }) => {
Expand Down Expand Up @@ -73,15 +72,6 @@ const NavBar = ({ handleLogout, isLoggedIn, token, loading }) => {
Mentor Sessions
</MenuItem>
)}
{isMentee && (
<MenuItem
onClick={handleClose}
component={Link}
to="/menteesessions"
>
Mentee Sessions
</MenuItem>
)}
<MenuItem
onClick={handleClose}
component={Link}
Expand All @@ -93,7 +83,12 @@ const NavBar = ({ handleLogout, isLoggedIn, token, loading }) => {
</div>
)}

<Typography variant="h3" component="div" sx={{ flexGrow: 1 }} data-test="Nav-Title">
<Typography
variant="h3"
component="div"
sx={{ flexGrow: 1 }}
data-test="Nav-Title"
>
<p className="nav--title">Momentum Mentors</p>
</Typography>

Expand Down Expand Up @@ -128,7 +123,7 @@ const NavBar = ({ handleLogout, isLoggedIn, token, loading }) => {
</Button>
</Box>
) : (
<Link to="/" >
<Link to="/">
{loading ? (
<Button
id="loading--button"
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Profile/ProfileMentee.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Switch } from "@mui/material";
import FormControlLabel from "@mui/material/FormControlLabel";
import { styled } from "@mui/material/styles";
import Survey from "./Survey"
import MenteeSessions from "../Sessions/MenteeSessions"

export default function ProfileMentee({ token, pk, setAuth }) {
// first name, last name, phone number
Expand Down Expand Up @@ -231,6 +232,7 @@ export default function ProfileMentee({ token, pk, setAuth }) {
</Grid>

</Grid>
<MenteeSessions token={token} pk={pk}/>
</Box>
</Box>
<Survey/>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/SessionSignup/SessionSignup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
Select,
Grid,
Typography,
Container,
} from "@mui/material";

export default function SessionSignup({ token }) {
Expand Down Expand Up @@ -214,7 +213,7 @@ export default function SessionSignup({ token }) {
)
.then((response) => {
console.log("Session created successfully");
navigate("/menteesessions");
navigate("/profile");
})
.catch((error) => {
console.log("error:", error);
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Sessions/MenteeCanceled.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default function MenteeSessions({ token, pk, setAuth }) {
<Box className="menteecanceled--component">
{/* filter and add only canceled sessions */}
<Typography
variant="h2"
variant="h5"
component="div"
sx={{ flexGrow: 1, marginTop: "4rem", padding: "1rem" }}
sx={{ flexGrow: 1, marginTop: "1rem", padding: "1rem" }}
>
Canceled:
</Typography>
Expand All @@ -38,7 +38,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
sx={{
flexGrow: 1,
marginLeft: "1rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand All @@ -64,7 +64,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
flexGrow: 1,
marginLeft: "1rem",
marginTop: "1.75rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Sessions/MenteeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default function MenteeSessions({ token, pk, setAuth }) {
<Box className="menteerequest--component">
{/* Filter and add only pending sessions */}
<Typography
variant="h2"
variant="h5"
component="div"
sx={{ flexGrow: 1, marginTop: "4rem", padding: "1rem" }}
sx={{ flexGrow: 1, marginTop: "1rem", padding: "1rem" }}
>
Request:
</Typography>
Expand All @@ -40,7 +40,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
sx={{
flexGrow: 1,
marginLeft: "1rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand All @@ -66,7 +66,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
flexGrow: 1,
marginLeft: "1rem",
marginTop: "1.75rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Sessions/MenteeScheduled.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default function MenteeSessions({ token, pk, setAuth }) {
<Box className="menteescheduled--page">
{/* Filter and add only confirmed sessions */}
<Typography
variant="h2"
variant="h5"
component="div"
sx={{ flexGrow: 1, marginTop: "4rem", padding: "1rem" }}
sx={{ flexGrow: 1, marginTop: "1rem", padding: "1rem" }}
>
Scheduled:
</Typography>
Expand All @@ -40,7 +40,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
sx={{
flexGrow: 1,
marginLeft: "1rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand All @@ -66,7 +66,7 @@ export default function MenteeSessions({ token, pk, setAuth }) {
flexGrow: 1,
marginLeft: "1rem",
marginTop: "1.75rem",
fontSize: "25px",
fontSize: "20px",
textAlign: "center",
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ export default function MenteeSessions({ token, pk, setAuth }) {
return (
<Box className="menteesessions--page">
<Typography
variant="h2"
variant="h4"
component="div"
sx={{
flexGrow: 1,
textAlign: "center",
paddingLeft: "1rem",
marginTop: "2rem",
textDecoration: "underline",
}}
>
Mentee Session
Expand Down