From 30317b1810a89a4ecc8d956634119b5c3c56bd1a Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Sun, 25 Feb 2024 19:37:27 +0800 Subject: [PATCH] style: Rename departement in department in the code --- src/App.tsx | 2 +- src/pages/global-info/GlobalInfo.tsx | 16 ++++++++-------- src/pages/per-picture-info/PerPictureInfo.tsx | 2 +- .../per-picture-info/PictureInfoEditModal.tsx | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6fe81f9..a04df4e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -75,7 +75,7 @@ function App (): JSX.Element { const [imageUploads, setImageUploads] = useState([]) const [globalInfo, setGlobalInfo] = useState( - { consent: true, datetime: new Date(), departement: 'Aine' } + { consent: true, datetime: new Date(), department: 'Aine' } ) const [, setPicturesInfo] = useState([]) diff --git a/src/pages/global-info/GlobalInfo.tsx b/src/pages/global-info/GlobalInfo.tsx index 7455a7a..bccec62 100644 --- a/src/pages/global-info/GlobalInfo.tsx +++ b/src/pages/global-info/GlobalInfo.tsx @@ -114,17 +114,17 @@ const departments: DepartmentInfo = { export interface GlobalInfoData { datetime: Date - departement: string + department: string consent: boolean } export const GlobalInfo = ({ imageUploads, onSubmit }: { imageUploads: File[], onSubmit: (output: GlobalInfoData) => void }): JSX.Element => { const [consentCheckboxChecked, setConsentCheckboxChecked] = useState(false) const [date, setDate] = useState(new Date(imageUploads[0].lastModified)) - const [departement, setDepartement] = useState(null) + const [department, setDepartment] = useState(null) const isValid = (): boolean => { - if (!consentCheckboxChecked && (departement === null)) return false + if (!consentCheckboxChecked && (department === null)) return false if (date === null || date.getTime() > Date.now()) { // If the date is in the future, it's not valid return false @@ -136,7 +136,7 @@ export const GlobalInfo = ({ imageUploads, onSubmit }: { imageUploads: File[], o if (!isValid()) { return } onSubmit({ datetime: date!, - departement: departement as string, + department: department!, consent: consentCheckboxChecked }) } @@ -146,7 +146,7 @@ export const GlobalInfo = ({ imageUploads, onSubmit }: { imageUploads: File[], o

Ajoutez des informations pour ces photos

Vous pourrez éditer l'emplacement pour chaque photo à l'étape suivante.

- +