diff --git a/src/features/AuthServiceApp/hooks/useAuthFields.tsx b/src/features/AuthServiceApp/hooks/useAuthFields.tsx index c9d66bbd..b2bce7bf 100644 --- a/src/features/AuthServiceApp/hooks/useAuthFields.tsx +++ b/src/features/AuthServiceApp/hooks/useAuthFields.tsx @@ -7,6 +7,8 @@ import { useState } from 'react' import { isValidEmail } from 'features/AuthServiceApp/helpers/isValidEmail' import { isValidPassword } from 'features/AuthServiceApp/helpers/isValidPassword' +import { PAGES } from 'features/AuthServiceApp/config/pages' + export const useAuthFields = (page: 'login'|'registration') => { const [email, setEmail] = useState('') const [password, setPassword] = useState('') @@ -20,7 +22,7 @@ export const useAuthFields = (page: 'login'|'registration') => { const onEmailChange = ({ target: { value } }: ChangeEvent) => { setError('') setEmail(value) - const isRegisterPage = page === 'registration' + const isRegisterPage = page === PAGES.registration if (password.length && !checkPassword(password) && isRegisterPage) { setError('check_password') } @@ -29,7 +31,7 @@ export const useAuthFields = (page: 'login'|'registration') => { const onPasswordChange = ({ target: { value } }: ChangeEvent) => { setError('') setPassword(value) - const isRegisterPage = page === 'registration' + const isRegisterPage = page === PAGES.registration if (!checkPassword(value) && isRegisterPage) { setError('check_password') } diff --git a/src/features/ProfileHeader/index.tsx b/src/features/ProfileHeader/index.tsx index a45fdaa0..5cdb1c05 100644 --- a/src/features/ProfileHeader/index.tsx +++ b/src/features/ProfileHeader/index.tsx @@ -33,6 +33,11 @@ type Props = { profileId?: number, } +const profileWithImage = { + 316: 'Spain', + 5704: 'Tunis', +} + export const ProfileHeader = ({ children, color: headerColor, @@ -46,7 +51,8 @@ export const ProfileHeader = ({ } = usePageParams() const color = useProfileColor(profileId) - const imageHeader = (profileId === 5704 || profileId === 316) + // @ts-ignore + const imageHeader = Boolean(profileWithImage[profileId]) && sportType === SportTypes.FOOTBALL && profileType === ProfileTypes.TOURNAMENTS ? `/images/${profileId}` : headerImage