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

fixed missing properties #295

Merged
merged 1 commit into from
May 20, 2024
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
64 changes: 33 additions & 31 deletions frontend/frontend/src/components/TabSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { grey } from '@mui/material/colors'
import { Box, MenuItem, Select } from '@mui/material'

interface TabSwitcherProps {
selectedYear: number
selectedYear?: number
setSelectedYear: (year: number) => void
titles: string[]
nodes: ReactNode[]
Expand Down Expand Up @@ -49,37 +49,39 @@ export default function TabSwitcher({
</Tab>
))}
</TabsList>
<Box
height={'100%'}
display={'flex'}
flexDirection={'column'}
justifyContent={'center'}
alignItems={'flex-start'}
mb={2}
>
<Select
variant={'outlined'}
color={'primary'}
value={selectedYear}
onChange={(e) =>
setSelectedYear(e.target.value as number)
}
label="Select Academic Year"
sx={{
minWidth: 150,
'& .MuiSelect-outlined': {
border: 1.5,
borderColor: 'primary.main',
},
}}
{selectedYear && (
<Box
height={'100%'}
display={'flex'}
flexDirection={'column'}
justifyContent={'center'}
alignItems={'flex-start'}
mb={2}
>
{[2022, 2023, 2024, 2025].map((year) => (
<MenuItem key={year} value={year}>
{year}
</MenuItem>
))}
</Select>
</Box>
<Select
variant={'outlined'}
color={'primary'}
value={selectedYear}
onChange={(e) =>
setSelectedYear(e.target.value as number)
}
label="Select Academic Year"
sx={{
minWidth: 150,
'& .MuiSelect-outlined': {
border: 1.5,
borderColor: 'primary.main',
},
}}
>
{[2022, 2023, 2024, 2025].map((year) => (
<MenuItem key={year} value={year}>
{year}
</MenuItem>
))}
</Select>
</Box>
)}
</Box>
{nodes.map((node, index) => (
<TabPanel id={`node${index}`} key={index} value={index}>
Expand Down
4 changes: 4 additions & 0 deletions frontend/frontend/src/pages/subjectsPage/SubjectsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ export function SubjectsPage() {
/>
) : (
<TabSwitcher
selectedYear={undefined}
setSelectedYear={() => undefined}
titles={[
'current_projects',
'archived',
Expand Down Expand Up @@ -400,6 +402,8 @@ export function SubjectsPage() {
/>
) : (
<TabSwitcher
selectedYear={undefined}
setSelectedYear={() => undefined}
titles={[
'current_projects',
'archived',
Expand Down
Loading