diff --git a/frontend/src/org/components/EventForm/steps/registration/ShowApplicationModal.tsx b/frontend/src/org/components/EventForm/steps/registration/ShowApplicationModal.tsx index 3188217e..0e835d12 100644 --- a/frontend/src/org/components/EventForm/steps/registration/ShowApplicationModal.tsx +++ b/frontend/src/org/components/EventForm/steps/registration/ShowApplicationModal.tsx @@ -6,12 +6,11 @@ import type { MembershipCategory, User, } from 'app/services/bisTypes' -import { EmailButton, PhoneButton, StyledModal, DataView } from 'components' -import styles from '../ParticipantsStep.module.scss' -import { FC, Fragment } from 'react' +import { EmailButton, PhoneButton, StyledModal } from 'components' import { mergeWith, omit } from 'lodash' +import { FC, Fragment } from 'react' import { withOverwriteArray } from 'utils/helpers' -import * as combinedTranslations from 'config/static/combinedTranslations' +import styles from '../ParticipantsStep.module.scss' interface IShowApplicationModalProps { open: boolean @@ -64,6 +63,7 @@ export const ShowApplicationModal: FC = ({ } : skipToken, ) + // we'll also show last year membership till end of February // we want to give people time to register for the new year // and still show continuity of membership @@ -82,6 +82,8 @@ export const ShowApplicationModal: FC = ({ withOverwriteArray, ) + console.log(currentApplication) + if (!open) return null return ( @@ -177,103 +179,106 @@ export const ShowApplicationModal: FC = ({ )} - {userId && user && ( -
-
-

Uživatel přidaný na akci:

-

- {user.first_name} {user.last_name}{' '} - {user.nickname && `(${user.nickname})`}{' '} -

-
- - {user.birthday && ( -
- Datum narození: - {user.birthday} -
- )} - {user.pronoun?.name && ( -
- Oslovení: - {user.pronoun.name} + {(!currentApplication || Object.keys(currentApplication).length === 0) && + userId && + user && ( +
+
+

Uživatel přidaný na akci:

+

+ {user.first_name} {user.last_name}{' '} + {user.nickname && `(${user.nickname})`}{' '} +

- )} - {user.email && ( -
- E-mail: - - {user.email} - -
- )} - {user.phone && ( -
- Telefon: - - {user.phone} - -
- )} - {user.health_issues && ( -
- Zdravotní omezení: - {user.health_issues} -
- )} - {user.close_person && ( -
- Blízká osoba: - {`${user.close_person.first_name} ${user.close_person.last_name}`} - {user.close_person.email && ( + {user.birthday && ( +
+ Datum narození: + {user.birthday} +
+ )} + {user.pronoun?.name && ( +
+ Oslovení: + {user.pronoun.name} +
+ )} + + {user.email && ( +
+ E-mail: - 'email: ' {user.close_person.email} + {user.email} - )} - {user.close_person.phone && ( +
+ )} + {user.phone && ( +
+ Telefon: - 'tel: ' {user.close_person.phone} + {user.phone} - )} -
- )} - {currentMemberships && currentMemberships.length !== 0 && ( -
- Členství: +
+ )} + {user.health_issues && (
- {currentMemberships.map(membership => { - return ( - - {administrationUnits && categories && ( -
- { - administrationUnits.find( - unit => - membership.administration_unit === unit.id, - )?.name - } - {' - '} - { - categories.find( - category => - membership.category.id === category.id, - )?.name - }{' '} - ({membership.year}) -
- )} -
- ) - })} + Zdravotní omezení: + {user.health_issues}
-
- )} -
- )} - {userId && + )} + {user.close_person && ( +
+ Blízká osoba: + {`${user.close_person.first_name} ${user.close_person.last_name}`} + {user.close_person.email && ( + + 'email: '{' '} + {user.close_person.email} + + )} + {user.close_person.phone && ( + + 'tel: ' {user.close_person.phone} + + )} +
+ )} + {currentMemberships && currentMemberships.length !== 0 && ( +
+ Členství: +
+ {currentMemberships.map(membership => { + return ( + + {administrationUnits && categories && ( +
+ { + administrationUnits.find( + unit => + membership.administration_unit === unit.id, + )?.name + } + {' - '} + { + categories.find( + category => + membership.category.id === category.id, + )?.name + }{' '} + ({membership.year}) +
+ )} +
+ ) + })} +
+
+ )} +
+ )} + {/* {userId && user && currentApplication && currentApplication.email === formattedUser.email && ( @@ -285,7 +290,7 @@ export const ShowApplicationModal: FC = ({ genericTranslations={combinedTranslations.generic} />
- )} + )} */} ) }