Skip to content

Commit 65cf82d

Browse files
committed
#3873 commented out unimplemented pages on the sidebar
1 parent 3d74c61 commit 65cf82d

1 file changed

Lines changed: 42 additions & 31 deletions

File tree

src/frontend/src/layouts/Sidebar/Sidebar.tsx

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import HomeIcon from '@mui/icons-material/Home';
1111
import AlignHorizontalLeftIcon from '@mui/icons-material/AlignHorizontalLeft';
1212
import RateReviewIcon from '@mui/icons-material/RateReview';
1313
import DashboardIcon from '@mui/icons-material/Dashboard';
14-
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism';
14+
// To be uncommented after guest sponsors page is developed
15+
// import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism';
1516
import FolderIcon from '@mui/icons-material/Folder';
1617
import SyncAltIcon from '@mui/icons-material/SyncAlt';
1718
import GroupIcon from '@mui/icons-material/Group';
@@ -25,9 +26,10 @@ import DrawerHeader from '../../components/DrawerHeader';
2526
import { Cached, ChevronLeft, ChevronRight } from '@mui/icons-material';
2627
import { useHomePageContext } from '../../app/HomePageContext';
2728
import { isGuest, TeamType } from 'shared';
28-
import * as MuiIcons from '@mui/icons-material';
29-
import { useAllTeamTypes } from '../../hooks/team-types.hooks';
30-
import ErrorPage from '../../pages/ErrorPage';
29+
// To be uncommented after divisions page is developed
30+
// import * as MuiIcons from '@mui/icons-material';
31+
// import { useAllTeamTypes } from '../../hooks/team-types.hooks';
32+
// import ErrorPage from '../../pages/ErrorPage';
3133
import BarChartIcon from '@mui/icons-material/BarChart';
3234
import { useCurrentUser } from '../../hooks/users.hooks';
3335
import QueryStatsIcon from '@mui/icons-material/QueryStats';
@@ -47,18 +49,19 @@ const Sidebar = ({ drawerOpen, setDrawerOpen, moveContent, setMoveContent }: Sid
4749
const { onPNMHomePage, onOnboardingHomePage } = useHomePageContext();
4850
const user = useCurrentUser();
4951
const { onGuestHomePage } = useHomePageContext();
50-
const { isError: teamsError, error: teamsErrorMsg, data: teams } = useAllTeamTypes();
52+
// const { isError: teamsError, error: teamsErrorMsg, data: teams } = useAllTeamTypes();
5153

52-
const allTeams: LinkItem[] = (teams ?? []).map((team: TeamType) => {
53-
const IconComponent = MuiIcons[(team.iconName in MuiIcons ? team.iconName : 'Circle') as keyof typeof MuiIcons];
54-
return {
55-
name: team.name,
56-
icon: <IconComponent />,
57-
route: routes.TEAMS + '/' + team.teamTypeId
58-
};
59-
});
54+
// To be uncommented once guest divisions pages are developed
55+
// const allTeams: LinkItem[] = (teams ?? []).map((team: TeamType) => {
56+
// const IconComponent = MuiIcons[(team.iconName in MuiIcons ? team.iconName : 'Circle') as keyof typeof MuiIcons];
57+
// return {
58+
// name: team.name,
59+
// icon: <IconComponent />,
60+
// route: routes.TEAMS + '/' + team.teamTypeId
61+
// };
62+
// });
6063

61-
if (teamsError) return <ErrorPage error={teamsErrorMsg} />;
64+
// if (teamsError) return <ErrorPage error={teamsErrorMsg} />;
6265
const memberLinkItems: LinkItem[] = [
6366
{
6467
name: 'Home',
@@ -130,18 +133,25 @@ const Sidebar = ({ drawerOpen, setDrawerOpen, moveContent, setMoveContent }: Sid
130133
}
131134
]
132135
},
133-
!onGuestHomePage
134-
? {
135-
name: 'Teams',
136-
icon: <GroupIcon />,
137-
route: routes.TEAMS
138-
}
139-
: {
140-
name: 'Divisions',
141-
icon: <GroupIcon />,
142-
route: routes.TEAMS,
143-
subItems: allTeams
144-
},
136+
137+
// Teams tab here to be replaced with below code once guest divisions is developed
138+
!onGuestHomePage && {
139+
name: 'Teams',
140+
icon: <GroupIcon />,
141+
route: routes.TEAMS
142+
},
143+
// !onGuestHomePage
144+
// ? {
145+
// name: 'Teams',
146+
// icon: <GroupIcon />,
147+
// route: routes.TEAMS
148+
// }
149+
// : {
150+
// name: 'Divisions',
151+
// icon: <GroupIcon />,
152+
// route: routes.TEAMS,
153+
// subItems: allTeams
154+
// },
145155
!onGuestHomePage && {
146156
name: 'Calendar',
147157
icon: <CalendarTodayIcon />,
@@ -152,11 +162,12 @@ const Sidebar = ({ drawerOpen, setDrawerOpen, moveContent, setMoveContent }: Sid
152162
icon: <Cached />,
153163
route: routes.RETROSPECTIVE
154164
},
155-
onGuestHomePage && {
156-
name: 'Sponsors',
157-
icon: <VolunteerActivismIcon />,
158-
route: routes.RETROSPECTIVE
159-
},
165+
// To be uncommented once guest mode sponsors page is developed
166+
// onGuestHomePage && {
167+
// name: 'Sponsors',
168+
// icon: <VolunteerActivismIcon />,
169+
// route: routes.RETROSPECTIVE
170+
// },
160171
{
161172
name: 'Info',
162173
icon: <QuestionMarkIcon />,

0 commit comments

Comments
 (0)