Skip to content

Commit

Permalink
front: add placeholder in budget input
Browse files Browse the repository at this point in the history
  • Loading branch information
clarani committed Nov 7, 2023
1 parent f2766a1 commit cb4e0e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 7 additions & 3 deletions front/src/modules/project/components/AddOrEditProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { SerializedError } from '@reduxjs/toolkit';
import { getUserSafeWord } from 'reducers/user/userSelectors';

const emptyProject: ProjectCreateForm = {
budget: 0,
description: '',
funders: '',
image: null,
Expand Down Expand Up @@ -329,8 +328,13 @@ export default function AddOrEditProjectModal({
{t('projectBudget')}
</div>
}
value={currentProject.budget}
onChange={(e) => setCurrentProject({ ...currentProject, budget: +e.target.value })}
value={currentProject.budget !== undefined ? currentProject.budget : ''}
onChange={(e) =>
setCurrentProject({
...currentProject,
budget: e.target.value !== '' ? +e.target.value : undefined,
})
}
textRight
/>
</div>
Expand Down
9 changes: 7 additions & 2 deletions front/src/modules/study/components/AddOrEditStudyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,13 @@ export default function AddOrEditStudyModal({ editionMode, study }: Props) {
{t('studyBudget')}
</div>
}
value={currentStudy?.budget || 0}
onChange={(e) => setCurrentStudy({ ...currentStudy, budget: +e.target.value })}
value={currentStudy.budget !== undefined ? currentStudy.budget : ''}
onChange={(e) =>
setCurrentStudy({
...currentStudy,
budget: e.target.value !== '' ? +e.target.value : undefined,
})
}
textRight
/>
</div>
Expand Down

0 comments on commit cb4e0e4

Please sign in to comment.