From 47e9a71cf2b3329fe1003ba9b7015ddf67cfa70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20S=C3=B6derlund?= Date: Wed, 9 Jul 2025 21:26:11 +0300 Subject: [PATCH 1/6] Update ImageUpload to MUI v6 --- .../components/inputs/ImageUpload/index.js | 135 +++++++++++------- 1 file changed, 84 insertions(+), 51 deletions(-) diff --git a/frontend/src/components/inputs/ImageUpload/index.js b/frontend/src/components/inputs/ImageUpload/index.js index 825a3be84..010bcf3de 100644 --- a/frontend/src/components/inputs/ImageUpload/index.js +++ b/frontend/src/components/inputs/ImageUpload/index.js @@ -1,12 +1,54 @@ import React, { useState, useCallback } from 'react' import Upload from 'antd/es/upload' import { useDispatch, useSelector } from 'react-redux' + import { Box, Typography, CircularProgress } from '@mui/material' import DeleteIcon from '@mui/icons-material/Delete' import VisibilityIcon from '@mui/icons-material/Visibility' +import { styled } from '@mui/material/styles' + import * as AuthSelectors from 'reducers/auth/selectors' import * as SnackbarActions from 'reducers/snackbar/actions' -import clsx from 'clsx' + +const EmptyWrapper = styled('div')({ + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', +}) + +const ButtonOverlay = styled('div')({ + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%', + background: 'rgba(0,0,0,0.6)', + opacity: 0, + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + transition: 'opacity 0.2s ease', + '&:hover': { + opacity: 1, + }, + color: 'white', +}) + +const ImageButton = styled('div')({ + padding: '8px', + display: 'flex', + alignItems: 'center', + gap: '16px', + '&:hover': { + background: 'rgba(255,255,255,0.2)', + }, +}) const ImageUpload = ({ value, @@ -75,65 +117,56 @@ const ImageUpload = ({ ) const renderLoading = () => ( - - - + + + + ) + + const renderEmpty = () => ( + + Click or drag a file to upload + ) const renderImage = () => ( - - + - - - - - - Remove image - - - window.open(value.url, '_blank')} - > - - - - View original - - - - - ) - - const renderEmpty = () => ( - - - Click or drag a file to upload - - + + + + Remove image + + window.open(value.url, '_blank')}> + + View original + + + ) return ( - + Date: Wed, 9 Jul 2025 22:27:34 +0300 Subject: [PATCH 2/6] Delete old /account page and account navbar --- .../components/navbars/AccountNavBar/index.js | 24 --------- .../src/pages/_account/dashboard/index.js | 49 ------------------- frontend/src/pages/_account/index.js | 48 ------------------ frontend/src/routes.js | 5 -- 4 files changed, 126 deletions(-) delete mode 100644 frontend/src/components/navbars/AccountNavBar/index.js delete mode 100644 frontend/src/pages/_account/dashboard/index.js delete mode 100644 frontend/src/pages/_account/index.js diff --git a/frontend/src/components/navbars/AccountNavBar/index.js b/frontend/src/components/navbars/AccountNavBar/index.js deleted file mode 100644 index 3379c201a..000000000 --- a/frontend/src/components/navbars/AccountNavBar/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react' -import { useSelector } from 'react-redux' -import UserMenu from 'components/UserMenu' -import * as UserSelectors from 'reducers/user/selectors' - -const Header = () => { - const userProfile = useSelector(UserSelectors.userProfile) - return ( -
-
-
- - Hi, {userProfile?.firstName} - -
-
- -
-
-
- ) -} - -export default Header diff --git a/frontend/src/pages/_account/dashboard/index.js b/frontend/src/pages/_account/dashboard/index.js deleted file mode 100644 index 0aae93693..000000000 --- a/frontend/src/pages/_account/dashboard/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react' - -import { useSelector } from 'react-redux' -import { Grid, Box, Typography } from '@mui/material' - -import * as AuthSelectors from 'reducers/auth/selectors' - -import EventCardSmall from 'components/events/EventCardSmall' -import PageWrapper from 'components/layouts/PageWrapper' - -import { useRegistrationsByUser } from 'graphql/queries/registrations' -import { useTranslation } from 'react-i18next' -import { useNavigate } from 'react-router-dom' - -export default () => { - const navigate = useNavigate() - const userId = useSelector(AuthSelectors.getUserId) - const [registrations = [], loading, error] = useRegistrationsByUser(userId) - const { t } = useTranslation() - - return ( - - - - - - {t('Your_registrations_')} - - {registrations.length === 0 && ( - - {t('Looks_like_register_')} - - )} - - {registrations.map(registration => ( - - - navigate(`/dashboard/event/${event?.slug}`) - } - /> - - ))} - - - - ) -} diff --git a/frontend/src/pages/_account/index.js b/frontend/src/pages/_account/index.js deleted file mode 100644 index f04a6a675..000000000 --- a/frontend/src/pages/_account/index.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react' - -import { useResolvedPath, useLocation } from 'react-router' - -import MaterialTabsLayout from 'components/layouts/MaterialTabsLayout' -// import AccountNavBar from 'components/navbars/AccountNavBar' -import GlobalNavBar from 'components/navbars/GlobalNavBar' - -import Footer from 'components/layouts/Footer' -import PageWrapper from 'components/layouts/PageWrapper' - -import Dashboard from './dashboard' -import Profile from './profile' - -import { useTranslation } from 'react-i18next' - -export default () => { - const url = useResolvedPath('').pathname - const location = useLocation() - const { t } = useTranslation() - return ( - } - footer={() =>