diff --git a/frontend/src/pages/_admin/default/BannerList.js b/frontend/src/pages/_admin/default/BannerList.js index df6bceae..9bc6b65c 100644 --- a/frontend/src/pages/_admin/default/BannerList.js +++ b/frontend/src/pages/_admin/default/BannerList.js @@ -1,9 +1,7 @@ import React, { useCallback, useState, useEffect } from 'react' -import { useSelector, useDispatch } from 'react-redux' +import { useSelector } from 'react-redux' -import { Grid, Box, Typography } from '@mui/material' - -import Divider from 'components/generic/Divider' +import { Grid2 as Grid, Box, Typography } from '@mui/material' import { useTranslation } from 'react-i18next' import { IconButton } from '@mui/material' @@ -12,9 +10,10 @@ import EditIcon from '@mui/icons-material/Edit' import BannerService from 'services/banner' import * as AuthSelectors from 'reducers/auth/selectors' +import { useNavigate } from 'react-router-dom' export default ({ data = [] }) => { - const dispatch = useDispatch() + const navigate = useNavigate() const { t } = useTranslation() const idToken = useSelector(AuthSelectors.getIdToken) const [banner, setBanner] = useState(data) @@ -43,36 +42,31 @@ export default ({ data = [] }) => { {banner.map(company => ( -
- - handleRemove(company.slug)} - > - - - - dispatch( - push(`admin/banner/${company.slug}`), - ) - } - > - - - {company.name} - {company.icon} - {company.buttons.map(i => ( - <> - {i.text} {i.push} - - ))} - - -
+ + handleRemove(company.slug)} + > + + + + navigate(`admin/banner/${company.slug}`) + } + > + + + {company.name} + {company.icon} + {company.buttons.map(i => ( + <> + {i.text} {i.push} + + ))} + ))}
diff --git a/frontend/src/pages/_admin/default/EventPriority.js b/frontend/src/pages/_admin/default/EventPriority.js index 5d09bf3e..74ada20c 100644 --- a/frontend/src/pages/_admin/default/EventPriority.js +++ b/frontend/src/pages/_admin/default/EventPriority.js @@ -1,8 +1,9 @@ import React, { useCallback, useState, useEffect } from 'react' import { useSelector } from 'react-redux' -import { Grid, Box, Typography } from '@mui/material' -import Divider from 'components/generic/Divider' +import { Grid2 as Grid, Box, Typography, IconButton } from '@mui/material' +import AddCircle from '@mui/icons-material/AddCircle' +import RemoveCircleIcon from '@mui/icons-material/RemoveCircle' import { useTranslation } from 'react-i18next' @@ -37,20 +38,17 @@ export default ({ data = [] }) => { {t('event_priority_')} - + {events.map(event => ( - - - {event.slug} - - {event.frontPagePriority} - - - + + {event.slug} + handleClick(event, 1)}> + + + {event.frontPagePriority} + handleClick(event, -1)}> + + ))} diff --git a/frontend/src/pages/_admin/default/HackerpackList.js b/frontend/src/pages/_admin/default/HackerpackList.js index 97f98cad..11692539 100644 --- a/frontend/src/pages/_admin/default/HackerpackList.js +++ b/frontend/src/pages/_admin/default/HackerpackList.js @@ -1,9 +1,8 @@ import React, { useCallback, useState, useEffect } from 'react' -import { useSelector, useDispatch } from 'react-redux' +import { useSelector } from 'react-redux' -import { Grid, Box, Typography } from '@mui/material' +import { Grid2 as Grid, Box, Typography } from '@mui/material' import CompanySection from 'components/hackerpack/CompanySection' -import Divider from 'components/generic/Divider' import { useTranslation } from 'react-i18next' import { IconButton } from '@mui/material' @@ -16,7 +15,6 @@ import { useNavigate } from 'react-router-dom' export default ({ data = [] }) => { const navigate = useNavigate() - const dispatch = useDispatch() const { t } = useTranslation() const idToken = useSelector(AuthSelectors.getIdToken) const [hackerpack, setHackerpack] = useState(data) @@ -72,7 +70,6 @@ export default ({ data = [] }) => { link={company.link} /> - ))} diff --git a/frontend/src/pages/_admin/default/NewBannerForm.js b/frontend/src/pages/_admin/default/NewBannerForm.js index 788a6285..e29a27be 100644 --- a/frontend/src/pages/_admin/default/NewBannerForm.js +++ b/frontend/src/pages/_admin/default/NewBannerForm.js @@ -1,7 +1,7 @@ import React, { useState, useCallback, useEffect } from 'react' import { useSelector, useDispatch } from 'react-redux' -import { Grid, Box, Typography } from '@mui/material' +import { Grid2 as Grid, Box, Typography } from '@mui/material' import TextInput from 'components/inputs/TextInput' import Button from 'components/generic/Button' @@ -71,12 +71,12 @@ export default () => { Create new frontpage banner - + {error} - + { disabled={loading} /> - +