From b46d41cba3608c6915168f0fc7eb5c3230f235fd Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Mon, 20 May 2024 23:58:03 +0200 Subject: [PATCH] positie jaarkiezer verandert --- .../frontend/src/components/TabSwitcher.tsx | 75 +++++++++++++++---- .../src/pages/mainPage/ArchivedView.tsx | 2 +- .../src/pages/mainPage/CoursesView.tsx | 2 +- .../frontend/src/pages/mainPage/MainPage.tsx | 44 ++--------- 4 files changed, 71 insertions(+), 52 deletions(-) diff --git a/frontend/frontend/src/components/TabSwitcher.tsx b/frontend/frontend/src/components/TabSwitcher.tsx index 9c213db8..591416fa 100644 --- a/frontend/frontend/src/components/TabSwitcher.tsx +++ b/frontend/frontend/src/components/TabSwitcher.tsx @@ -8,8 +8,11 @@ import { ReactNode } from 'react' import { t } from 'i18next' import theme from '../Theme.ts' import { grey } from '@mui/material/colors' +import { Box, MenuItem, Select } from '@mui/material' interface TabSwitcherProps { + selectedYear: number + setSelectedYear: (year: number) => void titles: string[] nodes: ReactNode[] } @@ -22,25 +25,69 @@ interface TabSwitcherProps { * the number of titles and nodes should be the same */ -export default function TabSwitcher({ titles, nodes }: TabSwitcherProps) { +export default function TabSwitcher({ + selectedYear, + setSelectedYear, + titles, + nodes, +}: TabSwitcherProps) { titles.length !== nodes.length && console.error('The number of titles and nodes should be the same') return ( - - - {titles.map((title, index) => ( - - {t(title)} - + <> + + + + {titles.map((title, index) => ( + + {t(title)} + + ))} + + + + + + {nodes.map((node, index) => ( + + {node} + ))} - - {nodes.map((node, index) => ( - - {node} - - ))} - + + ) } diff --git a/frontend/frontend/src/pages/mainPage/ArchivedView.tsx b/frontend/frontend/src/pages/mainPage/ArchivedView.tsx index 5dec46d6..d128b0bb 100644 --- a/frontend/frontend/src/pages/mainPage/ArchivedView.tsx +++ b/frontend/frontend/src/pages/mainPage/ArchivedView.tsx @@ -21,7 +21,7 @@ export function ArchivedView({ <> {[...Array(3)].map((_, index) => ( @@ -216,8 +218,8 @@ export default function MainPage() { md: 'row', }} minWidth={{ - md: '40svw', - lg: '49svw', + md: '57svw', + lg: '78svw', }} > {[...Array(3)].map((_, index) => ( @@ -322,37 +324,7 @@ export default function MainPage() { ] } /> - - - + {/* Add a calendar to the right of the mainpage. */}