-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add style and rightsManagement fields
- Loading branch information
1 parent
3d6ea3e
commit 9c2680d
Showing
4 changed files
with
179 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,22 @@ | ||
import { FormGroup, Stack } from "@mui/material"; | ||
import { Stack } from "@mui/material"; | ||
import Typography from "@mui/material/Typography"; | ||
import { Field } from "../../Form/Field"; | ||
import { UseFormRegister, UseFormReturn } from "react-hook-form"; | ||
import { Schema, z } from "zod"; | ||
import { FormContent } from "../ContactFormDialog"; | ||
|
||
type Props = { | ||
errors: any; | ||
register: UseFormRegister<z.TypeOf<Schema>>; | ||
control?: UseFormReturn<any, any, any>["control"]; | ||
}; | ||
|
||
const civilities = [ | ||
{ label: "Madame", value: "Female" }, | ||
{ label: "Monsieur", value: "Male" }, | ||
]; | ||
|
||
export const InformationsForm = ({ errors, register, control }: Props) => { | ||
return ( | ||
<Stack> | ||
<Typography sx={{ mt: 2, mb: 1 }}>Informations du contact</Typography> | ||
<FormGroup> | ||
<Field | ||
control={control} | ||
label="Civilité" | ||
name="civility" | ||
type="radios" | ||
error={errors?.civility?.message} | ||
options={civilities} | ||
/> | ||
<Field label="Nom" error={errors.lastName?.message} {...register("lastName")} /> | ||
<Field label="Prénom" error={errors.firstName?.message} {...register("firstName")} /> | ||
<Field label="Fonction" error={errors.function?.message} {...register("function")} /> | ||
<Field label="Adresse courriel" error={errors.email?.message} {...register("email")} /> | ||
<Field | ||
sx={{ width: "150px" }} | ||
label="Téléphone 1" | ||
error={errors.phone?.message} | ||
{...register("phone")} | ||
/> | ||
</FormGroup> | ||
<Typography sx={{ pb: 3 }} variant="titleMedium" fontSize={18}> | ||
Informations du contact | ||
</Typography> | ||
<FormContent errors={errors} register={register} control={control} /> | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,71 @@ | ||
import Stack from "@mui/material/Stack"; | ||
import Typography from "@mui/material/Typography"; | ||
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; | ||
import { Row } from "../../Row"; | ||
import { InputLabel, TextField } from "@mui/material"; | ||
|
||
export const RightsManagementForm = () => { | ||
return <Typography sx={{ mt: 2, mb: 1 }}>Ajouter des droits</Typography>; | ||
return ( | ||
<Stack> | ||
<Typography sx={{ pb: 3 }} variant="titleMedium" fontSize={18}> | ||
Ajouter des droits | ||
</Typography> | ||
<Row spacing={1} alignItems={"flex-start"}> | ||
<InfoOutlinedIcon fontSize="smallIcon" /> | ||
<Typography variant="bodyMedium"> | ||
La sélection de l’identifiant de l’unité enquêtée, d’une source, d’un millésime <br /> et d’une | ||
période est nécessaire pour l’ajout de droits | ||
</Typography> | ||
</Row> | ||
<form action="#"> | ||
<Stack gap={2} pt={5}> | ||
<Row gap={3}> | ||
<InputLabel | ||
id="id" | ||
sx={{ typography: "bodyMedium", fontWeight: "700", color: "black.main" }} | ||
> | ||
Identifiant du compte | ||
</InputLabel> | ||
<TextField sx={{ width: "300px" }} id="id" variant="outlined" size="small" /> | ||
</Row> | ||
<Row gap={3} justifyContent={"space-between"}> | ||
<InputLabel | ||
id="idSu" | ||
sx={{ typography: "bodyMedium", fontWeight: "700", color: "black.main" }} | ||
> | ||
Identifiant de l’unité enquêtée | ||
</InputLabel> | ||
<TextField sx={{ width: "300px" }} id="idSu" variant="outlined" size="small" /> | ||
</Row> | ||
<Row gap={3} justifyContent={"space-between"}> | ||
<InputLabel | ||
id="idSource" | ||
sx={{ typography: "bodyMedium", fontWeight: "700", color: "black.main" }} | ||
> | ||
Source | ||
</InputLabel> | ||
<TextField sx={{ width: "300px" }} id="idSource" variant="outlined" size="small" /> | ||
</Row> | ||
<Row gap={3} justifyContent={"space-between"}> | ||
<InputLabel | ||
id="year" | ||
sx={{ typography: "bodyMedium", fontWeight: "700", color: "black.main" }} | ||
> | ||
Millésime | ||
</InputLabel> | ||
<TextField sx={{ width: "300px" }} id="year" variant="outlined" size="small" /> | ||
</Row> | ||
<Row gap={3} justifyContent={"space-between"}> | ||
<InputLabel | ||
id="period" | ||
sx={{ typography: "bodyMedium", fontWeight: "700", color: "black.main" }} | ||
> | ||
Période | ||
</InputLabel> | ||
<TextField sx={{ width: "300px" }} id="period" variant="outlined" size="small" /> | ||
</Row> | ||
</Stack> | ||
</form> | ||
</Stack> | ||
); | ||
}; |