mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
fix: Limite du nombre de responsables légaux à 2 [#27]
This commit is contained in:
@ -14,6 +14,7 @@ export default function ResponsableInputFields({
|
||||
}) {
|
||||
const t = useTranslations('ResponsableInputFields');
|
||||
const { selectedEstablishmentId } = useEstablishment();
|
||||
const MAX_GUARDIANS = 2;
|
||||
|
||||
useEffect(() => {
|
||||
const isValid =
|
||||
@ -241,8 +242,20 @@ export default function ResponsableInputFields({
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Plus
|
||||
className="w-8 h-8 text-green-500 cursor-pointer hover:text-green-700 transition-colors border-2 border-green-500 hover:border-green-700 rounded-full p-1"
|
||||
onClick={(e) => addGuardian(e)}
|
||||
className={`w-8 h-8 ${
|
||||
guardians.length >= MAX_GUARDIANS
|
||||
? 'text-gray-400 cursor-not-allowed'
|
||||
: 'text-green-500 cursor-pointer hover:text-green-700'
|
||||
} transition-colors border-2 ${
|
||||
guardians.length >= MAX_GUARDIANS
|
||||
? 'border-gray-400'
|
||||
: 'border-green-500 hover:border-green-700'
|
||||
} rounded-full p-1`}
|
||||
onClick={(e) => {
|
||||
if (guardians.length < MAX_GUARDIANS) {
|
||||
addGuardian(e);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user