Skip to content

Commit

Permalink
Merge pull request #295 from SELab-2/merge_problems_fix
Browse files Browse the repository at this point in the history
fixed missing properties
  • Loading branch information
Bendemeurichy authored May 20, 2024
2 parents c95e8e2 + 97c8a76 commit 56374be
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 31 deletions.
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

0 comments on commit 56374be

Please sign in to comment.