fix(#188): tunisia pr fix

pull/108/head
Rakov Roman 3 years ago
parent eafdc35971
commit ba23f5258d
  1. 6
      src/features/AuthServiceApp/hooks/useAuthFields.tsx
  2. 8
      src/features/ProfileHeader/index.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<HTMLInputElement>) => {
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<HTMLInputElement>) => {
setError('')
setPassword(value)
const isRegisterPage = page === 'registration'
const isRegisterPage = page === PAGES.registration
if (!checkPassword(value) && isRegisterPage) {
setError('check_password')
}

@ -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

Loading…
Cancel
Save