diff --git a/frontend/src/components/inputs/BooleanInput/index.js b/frontend/src/components/inputs/BooleanInput/index.js index bbfb10fbc..046750ad5 100644 --- a/frontend/src/components/inputs/BooleanInput/index.js +++ b/frontend/src/components/inputs/BooleanInput/index.js @@ -43,9 +43,8 @@ const BooleanInput = ({ value, onChange, alignCenter = false }) => { return ( ({ + display: 'flex', + flexDirection: 'row', + justifyContent: 'flex-end', + alignItems: 'center', + backgroundColor: hasErrors + ? theme.palette.error.main + : theme.palette.primary.main, + padding: '1rem', + [theme.breakpoints.up('md')]: { + paddingLeft: `calc(${SIDEBAR_WIDTH} + 1rem)`, + }, + position: 'fixed', + transition: 'bottom 0.33s ease', + width: '100%', + bottom: dirty ? 0 : '-100px', + right: 0, + zIndex: 500, + color: 'white', +})) const BottomBar = ({ errors, @@ -36,35 +60,34 @@ const BottomBar = ({ }, []) const renderErrorsButton = () => ( - - + + {Object.keys(errors).length} errors - - + ) return ( <> - + {loading && ( - - - + + + {loadingText} - + @@ -81,7 +104,7 @@ const BottomBar = ({ )} {!loading && hasErrors && renderErrorsButton()} - + {dirty && } { {label && {label}} - + { onChange={handleDateChange} /> - + { onChange={handleMonthChange} /> - + { // console.log('counry here', value, country) return ( - + { {!fieldsDisabled && ( <> - + { } /> - + { allowCreate /> - + { onChange={degree => handleChange('degree', degree)} /> - + ( - - - + + + + ) + + 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 ( - + { return ( - + { onChange={setRole} /> - + Years of experience - + { ))} - + { - + {value.map(({ role, years }, index) => [ , - + handleRemove(index)} + > + {t('Remove_')} + + } + > - - handleRemove(index)} - color="default" //TODO this should be red - > - {t('Remove_')} - - , ])} diff --git a/frontend/src/components/inputs/PhoneNumberInput/index.js b/frontend/src/components/inputs/PhoneNumberInput/index.js index 0f1595472..a1ebfb0af 100644 --- a/frontend/src/components/inputs/PhoneNumberInput/index.js +++ b/frontend/src/components/inputs/PhoneNumberInput/index.js @@ -1,6 +1,6 @@ import React, { useCallback } from 'react' -import { Grid, InputAdornment, Box, Typography } from '@mui/material' +import { Grid2 as Grid, InputAdornment, Box, Typography } from '@mui/material' import Select from 'components/inputs/Select' import TextInput from 'components/inputs/TextInput' @@ -34,7 +34,12 @@ const PhoneNumberInput = React.memo( direction="row" alignItems="flex-end" > - + - + - + {t('Current_pro_situation_')} @@ -65,7 +65,7 @@ const RecruitmentOptionInput = ({ {value.status && value.status !== 'not-interested' ? ( <> - + {t('Cool_partners_')} @@ -81,7 +81,7 @@ const RecruitmentOptionInput = ({ } /> - + {t('Relocation_option_')} diff --git a/frontend/src/components/inputs/Select/index.js b/frontend/src/components/inputs/Select/index.js index 2d8b53ff3..7ef877726 100644 --- a/frontend/src/components/inputs/Select/index.js +++ b/frontend/src/components/inputs/Select/index.js @@ -1,32 +1,15 @@ import React, { useMemo, useCallback } from 'react' import PropTypes from 'prop-types' -import clsx from 'clsx' import Select from 'react-select' import CreatableSelect from 'react-select/creatable' -import { SelectOptions } from '@hackjunction/shared' import Typography from '@mui/material/Typography' import TextField from '@mui/material/TextField' -import Paper from '@mui/material/Paper' import Chip from '@mui/material/Chip' import Avatar from '@mui/material/Avatar' import MenuItem from '@mui/material/MenuItem' +import Box from '@mui/material/Box' import CancelIcon from '@mui/icons-material/Cancel' - -const NoOptionsMessage = props => ( - // - {props.children} -) -// {/* */} - -NoOptionsMessage.propTypes = { - children: PropTypes.node, - innerProps: PropTypes.object.isRequired, - selectProps: PropTypes.object.isRequired, -} +import { SelectOptions } from '@hackjunction/shared' const inputComponent = ({ inputRef, ...props }) => ( @@ -52,16 +35,19 @@ const Control = props => { return ( ) } @@ -116,30 +102,25 @@ Option.propTypes = { isSelected: PropTypes.bool.isRequired, } -// const Placeholder = props => ( -// -// {props.children} -// -// ) +const Placeholder = props => ( + + {props.children} + +) -// Placeholder.propTypes = { -// children: PropTypes.node, -// innerProps: PropTypes.object, -// selectProps: PropTypes.object.isRequired, -// } +Placeholder.propTypes = { + children: PropTypes.node, + innerProps: PropTypes.object, + selectProps: PropTypes.object.isRequired, +} const SingleValue = props => ( - // - {props.children} + {props.children} ) -// {/* */} SingleValue.propTypes = { children: PropTypes.node, @@ -147,25 +128,31 @@ SingleValue.propTypes = { selectProps: PropTypes.object.isRequired, } -// const ValueContainer = props => ( -// -// {props.children} -// -// ) +const ValueContainer = props => ( + + {props.children} + +) -// ValueContainer.propTypes = { -// children: PropTypes.node, -// selectProps: PropTypes.object.isRequired, -// } +ValueContainer.propTypes = { + children: PropTypes.node, + selectProps: PropTypes.object.isRequired, +} const MultiValue = props => ( : null} tabIndex={-1} label={props.children} - className={clsx(props.selectProps.classes?.chip, { - [props.selectProps.classes?.chipFocused]: props.isFocused, - })} + sx={{ margin: '0.25rem 0.125rem' }} onDelete={props.removeProps.onClick} deleteIcon={} /> @@ -182,31 +169,14 @@ MultiValue.propTypes = { selectProps: PropTypes.object.isRequired, } -const Menu = props => ( - // - {props.children} -) - -// {/* */} -Menu.propTypes = { - children: PropTypes.element.isRequired, - innerProps: PropTypes.object.isRequired, - selectProps: PropTypes.object.isRequired, -} - +//https://react-select.com/components const components = { Control, - Menu, MultiValue, - NoOptionsMessage, Option, - // Placeholder, + Placeholder, SingleValue, - // ValueContainer, + ValueContainer, } const IntegrationReactSelect = ({ @@ -220,23 +190,12 @@ const IntegrationReactSelect = ({ onBlur, onChange, options = [], - // placeholder, + placeholder, value, allowCreate = false, }) => { - // const theme = useTheme() const inputId = 'select-' + name - // const selectStyles = { - // input: base => ({ - // ...base, - // color: theme.palette.text.primary, - // '& input': { - // font: 'inherit', - // }, - // }), - // } - const _options = useMemo(() => { if (Array.isArray(options)) { return options @@ -335,7 +294,6 @@ const IntegrationReactSelect = ({ const SelectProps = { isDisabled: disabled, autoFocus, - // styles: selectStyles, inputId, TextFieldProps: { label, @@ -344,7 +302,7 @@ const IntegrationReactSelect = ({ shrink: true, }, }, - // placeholder, + placeholder, options: _options, components, value: transformedInput, @@ -356,13 +314,13 @@ const IntegrationReactSelect = ({ } return ( - + {allowCreate ? ( ) : ( )} - + ) } @@ -378,7 +336,7 @@ IntegrationReactSelect.propTypes = { onChange: PropTypes.func.isRequired, options: PropTypes.oneOfType([PropTypes.array, PropTypes.string]) .isRequired, - // placeholder: PropTypes.string, + placeholder: PropTypes.string, value: PropTypes.any, allowCreate: PropTypes.bool, } diff --git a/frontend/src/components/inputs/SkillsInput/index.js b/frontend/src/components/inputs/SkillsInput/index.js index 44c0ac0fd..0c80d3727 100644 --- a/frontend/src/components/inputs/SkillsInput/index.js +++ b/frontend/src/components/inputs/SkillsInput/index.js @@ -1,16 +1,14 @@ import React, { useCallback, useState, useRef } from 'react' import { - Grid, + Grid2 as Grid, Typography, Button, - Box, FormControlLabel, RadioGroup, Radio, List, ListItem, ListItemText, - ListItemSecondaryAction, Divider, } from '@mui/material' import { Skills } from '@hackjunction/shared' @@ -59,7 +57,7 @@ export default React.memo(({ value = [], onChange, onBlur, autoFocus }) => { return ( - + { onChange={setSkill} /> - + {t('Level_of_expertise_')} - + { ))} - - + - - {t('Add_')} - - + {t('Add_')} + - + {value.map(({ skill, level }, index) => [ , - + handleRemove(index)} + > + {t('Remove_')} + + } + > @@ -125,7 +134,7 @@ export default React.memo(({ value = [], onChange, onBlur, autoFocus }) => { secondary={ {Skills.getDescriptionForSkillLevel( level, @@ -133,11 +142,6 @@ export default React.memo(({ value = [], onChange, onBlur, autoFocus }) => { } /> - - handleRemove(index)}> - {t('Remove_')} - - , ])} diff --git a/frontend/src/components/inputs/TextAreaInput/index.js b/frontend/src/components/inputs/TextAreaInput/index.js index 029925ba4..d0a706e64 100644 --- a/frontend/src/components/inputs/TextAreaInput/index.js +++ b/frontend/src/components/inputs/TextAreaInput/index.js @@ -43,7 +43,13 @@ const TextAreaInput = React.memo( return ( { const [errorLength, setErrorLength] = useState(errorLengthBase) const handleChange = useCallback( @@ -46,6 +47,7 @@ const TextInput = React.memo( textFieldFormat = ( { - 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={() => } - render={() => ( - - )} - /> - ) -} diff --git a/frontend/src/pages/_account/profile/index.js b/frontend/src/pages/_account/profile/index.js index ddd844f47..d5f1b999e 100644 --- a/frontend/src/pages/_account/profile/index.js +++ b/frontend/src/pages/_account/profile/index.js @@ -1,7 +1,8 @@ import React, { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { Box, Grid, Typography } from '@mui/material' +import { Box, Grid2 as Grid, Typography } from '@mui/material' +import { styled } from '@mui/material/styles' import { Formik, FastField, Field } from 'formik' import { RegistrationFields } from '@hackjunction/shared' @@ -26,32 +27,14 @@ import * as UserActions from 'reducers/user/actions' import * as SnackbarActions from 'reducers/snackbar/actions' import { useTranslation } from 'react-i18next' -import { debugGroup } from 'utils/debuggingTools' -// const useStyles = makeStyles(theme => ({ -// topWrapper: { -// display: 'flex', -// flexDirection: 'column', -// alignItems: 'center', -// background: 'white', -// borderRadius: '7px', -// boxShadow: '2px 7px 15px rgba(0, 0, 0, 0.12)', -// padding: theme.spacing(3), -// [theme.breakpoints.up('md')]: { -// flexDirection: 'row', -// alignItems: 'flex-start', -// }, -// }, -// box: { -// background: 'white', -// borderRadius: '7px', -// boxShadow: '2px 7px 30px rgba(0, 0, 0, 0.12)', -// padding: theme.spacing(3), -// }, -// imageUpload: { -// width: '300px', -// height: '300px', -// }, -// })) + +const ProfileBox = styled('div')(({ theme }) => ({ + borderRadius: '7px', + boxShadow: '2px 7px 30px rgba(0, 0, 0, 0.12)', + padding: theme.spacing(3), + background: 'white', + marginBottom: '1.5rem', +})) export default () => { const dispatch = useDispatch() @@ -61,8 +44,6 @@ export default () => { const loading = userProfileLoading || !hasProfile const { t } = useTranslation() - // const classes = useStyles() - const validationSchema = data => { const validations = {} Object.keys(data).forEach(field => { @@ -114,17 +95,30 @@ export default () => { > {formikProps => ( <> - - + + ( { )} /> - + - + ( @@ -173,7 +173,7 @@ export default () => { )} /> - + ( @@ -195,7 +195,7 @@ export default () => { )} /> - + ( @@ -223,7 +223,7 @@ export default () => { })} - + ( @@ -248,7 +248,7 @@ export default () => { {t('Contact_phone_')} - + ( @@ -271,7 +271,7 @@ export default () => { )} /> - + ( @@ -296,19 +296,24 @@ export default () => { - - + + + {t('Profile_details_')} - + {t('Pre_filled_details_', { owner: config.PLATFORM_OWNER_NAME, privacy: config.PRIVACY_URL, })} - + ( @@ -342,34 +347,32 @@ export default () => { } - - - ( - - form.setFieldValue( - field.name, - value, - ) - } - onBlur={() => - form.setFieldTouched( - field.name, - ) - } - /> - )} - /> - + + ( + + form.setFieldValue( + field.name, + value, + ) + } + onBlur={() => + form.setFieldTouched( + field.name, + ) + } + /> + )} + /> { RegistrationFields.getField( @@ -378,7 +381,7 @@ export default () => { } - + ( @@ -403,7 +406,7 @@ export default () => { )} /> - + ( @@ -426,7 +429,7 @@ export default () => { )} /> - + ( @@ -450,7 +453,7 @@ export default () => { )} /> - + ( @@ -474,7 +477,7 @@ export default () => { )} /> - + ( @@ -501,8 +504,9 @@ export default () => { /> - - + + + {t('Education_')} @@ -527,8 +531,9 @@ export default () => { /> )} /> - - + + + {t('Skills_')} {t('Enter_skills_')} @@ -547,8 +552,9 @@ export default () => { /> )} /> - - + + + {t('Pro_roles_')} @@ -569,8 +575,9 @@ export default () => { /> )} /> - - + + + {t('Recruitment_pref_')} @@ -592,8 +599,9 @@ export default () => { /> )} /> - - + + + {t('Additional_links_')} @@ -601,7 +609,7 @@ export default () => { {t('You_can_link_')} - + ( @@ -635,7 +643,7 @@ export default () => { } - + ( @@ -669,7 +677,7 @@ export default () => { } - + ( @@ -703,7 +711,7 @@ export default () => { } - + ( @@ -738,8 +746,8 @@ export default () => { - - + + import('./pages/_dashboard')) const OrganiserRouter = lazy( () => import('./pages/_dashboard/renderDashboard/organiser/router'), ) -const AccountRouter = lazy(() => import('./pages/_account')) const RecruitmentEvents = lazy( () => import('./pages/_dashboard/renderDashboard/default/events/Partner'), ) @@ -77,10 +76,6 @@ const routes = [ path: '/dashboard/*', element: , }, - { - path: '/account/*', - element: , - }, { path: '/recruitment', element: (